From 2e56df478dda9f1b5d2e4971fda64d6fdd49cbd5 Mon Sep 17 00:00:00 2001 From: Tadhg O'Higgins <2626258+tadhg-ohiggins@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:06:23 -0800 Subject: [PATCH 1/2] Add required metadata to ADR issue template (#2750) * ADR for changing ADR process. * ADR issue template metadata. --- .github/ISSUE_TEMPLATE/adr-issue-template.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/adr-issue-template.md b/.github/ISSUE_TEMPLATE/adr-issue-template.md index d87ff73e59..2fe89c8c8c 100644 --- a/.github/ISSUE_TEMPLATE/adr-issue-template.md +++ b/.github/ISSUE_TEMPLATE/adr-issue-template.md @@ -1,3 +1,11 @@ +--- +name: ADR issue template +about: Starting point for architecture decision records +title: '[ADR] ' +labels: 'adr' +assignees: '' +--- + ## Areas of impact - [ ] Compliance From ad1b6e7f8aee34a2920d25afba714bac5d980a6b Mon Sep 17 00:00:00 2001 From: "Hassan D. M. Sambo" <hassandeme.mamasambo@gsa.gov> Date: Tue, 7 Nov 2023 15:24:22 -0500 Subject: [PATCH 2/2] #2671 Added GitHub workflow file for historic data migrator (#2738) * #2671 Added GitHub workflow file for historic data migrator * #2671 Updated ReadMe and workflow * Update .github/workflows/historic-data-migrator.yml Co-authored-by: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> * Update .github/workflows/historic-data-migrator.yml Co-authored-by: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> * Update .github/workflows/historic-data-migrator.yml Co-authored-by: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> --------- Co-authored-by: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> --- .github/workflows/historic-data-migrator.yml | 42 +++++++++++++++++++ backend/census_historical_migration/README.md | 6 +++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/historic-data-migrator.yml diff --git a/.github/workflows/historic-data-migrator.yml b/.github/workflows/historic-data-migrator.yml new file mode 100644 index 0000000000..3ec4875dc8 --- /dev/null +++ b/.github/workflows/historic-data-migrator.yml @@ -0,0 +1,42 @@ +--- +name: Historic Data Migration +on: + workflow_dispatch: + inputs: + environment: + required: true + type: choice + description: The environment the workflow should run on. + options: + - dev + - staging + - preview + dbkeys: + required: false + type: string + description: Comma-separated list of report-IDs. + years: + required: false + type: string + description: Comma-separated list of report years. The list of years needs to be the same length as the list of dbkeys. + +jobs: + historic-data-migrator: + name: Generate and disseminate historic data in ${{ inputs.environment }} database + runs-on: ubuntu-latest + environment: ${{ inputs.environment }} + env: + space: ${{ inputs.environment }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run Django command to generate and disseminate historic data in ${{ inputs.environment }} + uses: cloud-gov/cg-cli-tools@main + with: + cf_username: ${{ secrets.CF_USERNAME }} + cf_password: ${{ secrets.CF_PASSWORD }} + cf_org: gsa-tts-oros-fac + cf_space: ${{ env.space }} + command: cf run-task gsa-fac -k 2G -m 2G --name historic_data_migrator --command "python manage.py historic-data-migrator --dbkeys ${{ inputs.dbkeys }} --years ${{ inputs.years }}" diff --git a/backend/census_historical_migration/README.md b/backend/census_historical_migration/README.md index 209400fa09..b36aa33dad 100644 --- a/backend/census_historical_migration/README.md +++ b/backend/census_historical_migration/README.md @@ -18,3 +18,9 @@ docker compose run web python manage.py historic_workbook_generator ``` - `year` is optional and defaults to `22`. - The `output` directory will be created if it doesn't already exist. + +### How to trigger historic data migrator from GitHub: +- Go to GitHub Actions and select `Historic data migrator` action +- Next, click on `Run workflow` on top right and +- Provide the target `environment` along with optional parameters such as `dbkeys` and `years` +- Click `Run`