Skip to content

Commit

Permalink
Merge branch 'main' into pfb-apnea-copy-app
Browse files Browse the repository at this point in the history
  • Loading branch information
batemapf authored Sep 28, 2023
2 parents db98ca8 + 6bd4f5c commit 99c6b95
Show file tree
Hide file tree
Showing 71 changed files with 1,820 additions and 751 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ENV AWS_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
# Add VA Root CA to Docker Certificate Authority (CA) Store so that NODE can use it for requests.
ADD http://crl.pki.va.gov/PKI/AIA/VA/VA-Internal-S2-RCA1-v1.cer /usr/local/share/ca-certificates/
RUN mv /usr/local/share/ca-certificates/VA-Internal-S2-RCA1-v1.cer /usr/local/share/ca-certificates/VA-Internal-S2-RCA1-v1.cer.crt
ADD http://crl.pki.va.gov/PKI/AIA/VA/VA-Internal-S2-RCA2.cer /usr/local/share/ca-certificates/VA-Internal-S2-RCA2.cer.crt
RUN update-ca-certificates
# Display VA Internal certificates that are now trusted
RUN awk -v cmd='openssl x509 -noout -subject' '/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt | grep -i 'VA-Internal'
Expand Down
3 changes: 3 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
self-hosted-runner:
labels:
- asg
6 changes: 6 additions & 0 deletions .github/emass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"systemID": 1027,
"systemName": "Veterans-Facing Services Platform-Va.gov",
"systemOwnerName": "VA.gov CMS Team",
"systemOwnerEmail": "[email protected]"
}
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
steps:
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0
with:
stale-pr-message: 'This PR is stale because it has been open 120 days with no activity. It will recieve a stale label every day for 14 days before being closed unless it recieves a comment or the stale label is removed.'
stale-pr-message: 'This PR is stale because it has been open 120 days with no activity. It will receive a stale label every day for 14 days before being closed unless it receives a comment or the stale label is removed.'
days-before-pr-stale: 120
days-before-pr-close: 14
30 changes: 30 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CodeQL
'on':
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: 19 1 * * 4
workflow_dispatch: null
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
concurrency: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language:
- javascript
steps:
- name: Run Code Scanning
uses: department-of-veterans-affairs/codeql-tools/codeql-analysis@main
with:
language: ${{ matrix.language }}
84 changes: 61 additions & 23 deletions .github/workflows/content-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
DRUPAL_ADDRESS: https://prod.cms.va.gov
INSTANCE_TYPE: m6i.4xlarge
MAXIMUM_HEAP: 5000
# secrets.ACTIONS_RUNNER_DEBUG is set to 'true' when re-running a workflow with debug.
# secrets.ACTIONS_RUNNER_DEBUG is set to 'true' when re-running a workflow with debug.
ACTIONS_RUNNER_DEBUG: ${{ secrets.ACTIONS_RUNNER_DEBUG }}

jobs:
Expand Down Expand Up @@ -66,8 +66,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify-start:
name: Notify Start
notify-start-slack:
name: Notify Start (Slack)
runs-on: [self-hosted, asg]
needs: validate-build-status
steps:
Expand Down Expand Up @@ -430,7 +430,7 @@ jobs:
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
url: ${{ env.DRUPAL_ADDRESS }}/api/govdelivery_bulletins/queue?EndTime=${{ needs.build.outputs.vagovprod_buildtime }}&src=gha&runId=${{ github.run_id }}&runNumber=${{ github.run_number }}
method: GET
# This should not prevent the job from continuing.
# A failure here should not prevent the workflow from continuing.
continue-on-error: true

- name: Export deploy end time
Expand All @@ -448,14 +448,8 @@ jobs:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Notify Slack
uses: department-of-veterans-affairs/platform-release-tools-actions/slack-notify@8c496a4b0c9158d18edcd9be8722ed0f79e8c5b4 #
continue-on-error: true
with:
payload: '{"attachments": [{"color": "#2EB67D","blocks": [{"type": "section","text": {"type": "mrkdwn","text": "content release using ${{ needs.validate-build-status.outputs.TAG }} is complete."}}]}]}'
channel_id: ${{ env.CONTENT_BUILD_CHANNEL_ID }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Wait for the CMS to be ready
uses: ./.github/workflows/wait-for-cms-ready

- name: Notify CMS - Ready
uses: ./.github/workflows/authenticated-cms-request
Expand All @@ -465,21 +459,43 @@ jobs:
url: ${{ env.DRUPAL_ADDRESS }}/api/content_release/ready
method: GET

notify-success-slack:
name: Notify Success (Slack)
runs-on: [self-hosted, asg]
needs:
- validate-build-status
- deploy

steps:
- name: Notify Slack
uses: department-of-veterans-affairs/platform-release-tools-actions/slack-notify@8c496a4b0c9158d18edcd9be8722ed0f79e8c5b4 #
continue-on-error: true
with:
payload: '{"attachments": [{"color": "#2EB67D","blocks": [{"type": "section","text": {"type": "mrkdwn","text": "content release using ${{ needs.validate-build-status.outputs.TAG }} is complete."}}]}]}'
channel_id: ${{ env.CONTENT_BUILD_CHANNEL_ID }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

notify-failure:
name: Notify Failure
runs-on: [self-hosted, asg]
if: |
(failure() && needs.deploy.result != 'success')
needs: deploy

steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-gov-west-1

- name: Wait for the CMS to be ready
uses: ./.github/workflows/wait-for-cms-ready

- name: Notify CMS - Error
uses: ./.github/workflows/authenticated-cms-request
with:
Expand All @@ -488,15 +504,6 @@ jobs:
url: ${{ env.DRUPAL_ADDRESS }}/api/content_release/error
method: GET

- name: Notify Slack
uses: department-of-veterans-affairs/platform-release-tools-actions/slack-notify@8c496a4b0c9158d18edcd9be8722ed0f79e8c5b4 #
continue-on-error: true
with:
payload: '{"attachments": [{"color": "#2EB67D","blocks": [{"type": "section","text": {"type": "mrkdwn","text": ":bangbang: <!subteam^S010U41C30V|cms-helpdesk> Content release using ${{ needs.validate-build-status.outputs.TAG }} has failed."}}]}]}'
channel_id: ${{ env.CONTENT_BUILD_CHANNEL_ID }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Get Datadog token from Parameter Store
uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest
with:
Expand Down Expand Up @@ -525,6 +532,38 @@ jobs:
-H "DD-API-KEY: ${{ env.GHA_CONTENT_BUILD_DATADOG_API_KEY }}" \
-d @- < event.json
notify-failure-slack:
name: Notify Failure (Slack)
runs-on: [self-hosted, asg]
if: |
(failure() && needs.deploy.result != 'success')
needs: deploy
steps:
- name: Notify Slack
uses: department-of-veterans-affairs/platform-release-tools-actions/slack-notify@8c496a4b0c9158d18edcd9be8722ed0f79e8c5b4
continue-on-error: true
with:
payload: >
{
"attachments": [
{
"color": "#2EB67D",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":bangbang: <!subteam^S010U41C30V|cms-helpdesk> Content release using ${{ needs.validate-build-status.outputs.TAG || 'an unknown version' }} has failed."
}
}
]
}
]
}
channel_id: ${{ env.CONTENT_BUILD_CHANNEL_ID }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

record-metrics:
name: Record metrics in Datadog
runs-on: [self-hosted, asg]
Expand Down Expand Up @@ -605,4 +644,3 @@ jobs:
-H "Content-Type: text/json" \
-H "DD-API-KEY: ${{ env.GHA_CONTENT_BUILD_DATADOG_API_KEY }}" \
-d @- < metrics.json
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,8 @@ jobs:
username: api
password: ${{ env.CALLBACK_TOKEN }}
timeout: 10000
# A failure here should not prevent the workflow from continuing.
continue-on-error: true

jenkins:
name: Run Jenkins CI
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/prune-self-hosted-runners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Prune Self-Hosted Runners

on:
workflow_dispatch:
schedule:
- cron: '27 * * * *' # Hourly at 27 minutes past the hour

jobs:

prune-self-hosted-runners:
name: Prune Old and Idle Self-Hosted Runners
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-gov-west-1

- name: Get va-vsp-bot token
uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest
with:
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN

- name: Install dependencies
uses: ./.github/workflows/install
with:
key: ${{ hashFiles('yarn.lock') }}
yarn_cache_folder: ~/.cache/yarn
path: |
~/.cache/yarn
node_modules
- name: Run the prune script
run: yarn prune-self-hosted-runners
env:
GITHUB_TOKEN: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-gov-west-1'
DEBUG: ${{ secrets.ACTIONS_RUNNER_DEBUG }}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ENV AWS_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
# Add VA Root CA to Docker Certificate Authority (CA) Store so that NODE can use it for requests.
ADD https://raw.githubusercontent.com/department-of-veterans-affairs/platform-va-ca-certificate/main/VA-Internal-S2-RCA1-v1.cer /usr/local/share/ca-certificates/
RUN openssl x509 -inform DER -in /usr/local/share/ca-certificates/VA-Internal-S2-RCA1-v1.cer -out /usr/local/share/ca-certificates/VA-Internal-S2-RCA1-v1.crt
ADD https://raw.githubusercontent.com/department-of-veterans-affairs/platform-va-ca-certificate/main/VA-Internal-S2-RCA2.cer /usr/local/share/ca-certificates/VA-Internal-S2-RCA2.cer.crt
RUN update-ca-certificates

RUN mkdir -p /application/content-build
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"watch:css-sourcemaps": "node --max-old-space-size=5000 --expose-gc script/build-content.js --watch --local-css-sourcemaps",
"watch:review": "node ./script/run-review-instance-api.js",
"list-heading-order-violations": "node script/heading-order-violations.js --dir ./build/vagovdev",
"prepare": "husky install"
"prepare": "husky install",
"prune-self-hosted-runners": "node script/prune-self-hosted-runners.js",
"prune-self-hosted-runners:dry-run": "export DRY_RUN=true; node script/prune-self-hosted-runners.js"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -205,6 +207,7 @@
"private": true,
"dependencies": {
"@department-of-veterans-affairs/vagov-platform": "^0.0.1",
"aws-sdk": "^2.1441.0",
"blob-polyfill": "^4.0.20200601",
"core-js": "^3.17.3",
"diff2html": "^3.4.11",
Expand Down
Loading

0 comments on commit 99c6b95

Please sign in to comment.