-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4409 from GSA-TTS/main
- Loading branch information
Showing
73 changed files
with
1,841 additions
and
855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: Check Tables Daily | ||
on: | ||
schedule: | ||
# Invoke every 12 hours | ||
- cron: '0 */12 * * *' | ||
workflow_dispatch: null | ||
|
||
jobs: | ||
check-tables: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
environment: | ||
- name: dev | ||
- name: staging | ||
- name: production | ||
- name: preview | ||
uses: ./.github/workflows/fac-check-tables.yml | ||
secrets: inherit | ||
with: | ||
environment: ${{ matrix.environment.name }} | ||
util_version: "v0.1.8" | ||
backup_operation: "check_tables" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
name: Check existing tables in an environment | ||
### Common Commands: | ||
# ./fac-backup-util.sh v0.1.8 check_tables | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
required: true | ||
type: choice | ||
options: | ||
- 'dev' | ||
- 'preview' | ||
- 'staging' | ||
- 'production' | ||
util_version: | ||
description: Version for fac backup utility to use (ex. vX.Y.Z) | ||
required: true | ||
type: string | ||
backup_operation: | ||
description: Operation for fac-backup-utility | ||
required: true | ||
type: choice | ||
options: | ||
- 'check_tables' | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: true | ||
type: string | ||
util_version: | ||
description: Version for fac backup utility to use (ex. vX.Y.Z) | ||
required: true | ||
type: string | ||
backup_operation: | ||
description: Operation for fac-backup-utility | ||
required: true | ||
type: string | ||
jobs: | ||
fac-check-tables: | ||
name: Check tables in FAC Database | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
env: | ||
space: ${{ inputs.environment }} | ||
steps: | ||
- name: Check tables in ${{ env.space }} | ||
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 3G --name check_tables --command "./fac-backup-util.sh ${{ inputs.util_version }} ${{ inputs.backup_operation }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,12 +47,25 @@ jobs: | |
pwd | ||
ls -al | grep 'coverage' | ||
- name: Coverage Action | ||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: ./coverage.xml | ||
badge: true | ||
fail_below_min: true | ||
format: markdown | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '85 90' | ||
|
||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: github.event_name == 'pull_request' | ||
uses: orgoro/[email protected] | ||
with: | ||
coverageFile: ./coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
recreate: true | ||
path: code-coverage-results.md | ||
|
||
a11y-testing: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,12 +49,25 @@ jobs: | |
pwd | ||
ls -al | grep 'coverage' | ||
- name: Coverage Action | ||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: ./coverage.xml | ||
badge: true | ||
fail_below_min: false | ||
format: markdown | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '85' | ||
|
||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: github.event_name == 'pull_request' | ||
uses: orgoro/[email protected] | ||
with: | ||
coverageFile: ./coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
recreate: true | ||
path: code-coverage-results.md | ||
|
||
a11y-testing: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
backend/audit/intakelib/transforms/xform_clean_version_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import logging | ||
from audit.intakelib.intermediate_representation import ( | ||
get_range_by_name, | ||
replace_range_by_name, | ||
) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def remove_equals_and_quotes(ir): | ||
versions = get_range_by_name(ir, "version") | ||
new_values = list( | ||
map( | ||
lambda v: v.replace("=", "").replace('"', "") if v else v, | ||
versions["values"], | ||
) | ||
) | ||
new_ir = replace_range_by_name(ir, "version", new_values) | ||
|
||
return new_ir |
Oops, something went wrong.