diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml index 7d5bffbc5..b41918a7d 100644 --- a/.github/workflows/archive.yml +++ b/.github/workflows/archive.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} @@ -142,7 +142,7 @@ jobs: run: tar -c main/out/ -cf ${{ env.BUILD_TYPE }}.tar.bz2 . - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} diff --git a/.github/workflows/content-release-dev.yml b/.github/workflows/content-release-dev.yml new file mode 100644 index 000000000..d1aff63a4 --- /dev/null +++ b/.github/workflows/content-release-dev.yml @@ -0,0 +1,26 @@ +name: "Content release: Dev" +on: + # Can be manually triggered + workflow_dispatch: + # Runs 5:05 am EDT Monday to Friday. + # This currently UTC -> EDT. + schedule: + - cron: "05 9 * * 1-5" + # Runs each time there is a new Production Tag created. + workflow_run: + workflows: ['Create Production Tag'] + types: [completed] + branches: [main] + +concurrency: next-build-content-release-dev + +jobs: + content-release-dev: + # This job should run for any valid event besides workflow_run, or workflow_run if the conclusion was successful. + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} + uses: department-of-veterans-affairs/next-build/.github/workflows/content-release.yml@main + with: + build_type: "dev" + secrets: inherit + + diff --git a/.github/workflows/content-release-prod.yml b/.github/workflows/content-release-prod.yml new file mode 100644 index 000000000..02bb86865 --- /dev/null +++ b/.github/workflows/content-release-prod.yml @@ -0,0 +1,23 @@ +name: "Content release: Prod" +on: + # Can be manually triggered + workflow_dispatch: + # Runs automatically every 30 minutes from 8am to 8pm Monday to Friday. + # This currently UTC -> EDT. + schedule: + - cron: "*/30 0,12-23 * * 1-5" + # Runs on API call. Used for CMS-driven build triggers. + repository_dispatch: + types: [content-release] + +concurrency: next-build-content-release-prod + +jobs: + content-release: + uses: department-of-veterans-affairs/next-build/.github/workflows/content-release.yml@main + with: + build_type: "prod" + secrets: inherit + + + diff --git a/.github/workflows/content-release-staging.yml b/.github/workflows/content-release-staging.yml new file mode 100644 index 000000000..ba9c435c6 --- /dev/null +++ b/.github/workflows/content-release-staging.yml @@ -0,0 +1,26 @@ +name: "Content release: Staging" +on: + # Can be manually triggered + workflow_dispatch: + # Runs 5:35 am EDT Monday to Friday. + # This currently UTC -> EDT. + schedule: + - cron: "35 9 * * 1-5" + # Runs each time there is a new Production Tag created. + workflow_run: + workflows: ['Create Production Tag'] + types: [completed] + branches: [main] + +concurrency: next-build-content-release-staging + +jobs: + content-release-staging: + # This job should run for any valid event besides workflow_run, or workflow_run if the conclusion was successful. + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} + uses: department-of-veterans-affairs/next-build/.github/workflows/content-release.yml@main + with: + build_type: "staging" + secrets: inherit + + diff --git a/.github/workflows/content-release.yml b/.github/workflows/content-release.yml index da6db5ac1..89eddbe4b 100644 --- a/.github/workflows/content-release.yml +++ b/.github/workflows/content-release.yml @@ -5,12 +5,7 @@ permissions: contents: read # This is required for actions/checkout on: - repository_dispatch: - types: [content-release] - workflow_run: - workflows: ['Create Production Tag'] - types: [completed] - branches: [main] + # Runs when called from other workflows. Used for ongoing releases for dev/staging/prod. workflow_call: inputs: build_type: @@ -18,6 +13,7 @@ on: description: "Environment this workflow runs against" required: true default: 'PROD' + # Manual release. workflow_dispatch: inputs: build_type: @@ -31,7 +27,7 @@ on: - prod concurrency: - group: ${{ inputs.build_type || 'prod' }} + group: ${{ inputs.build_type || 'prod' }} env: SLACK_CHANNEL: C06DSBT7CBW #status-next-build @@ -42,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} @@ -107,7 +103,7 @@ jobs: continue-on-error: true with: payload: '{"attachments": [{"color": "#2EB67D","blocks": [{"type": "section","text": {"type": "mrkdwn","text": "Stand by, content release for next-build coming up (using ${{ needs.validate-build-status.outputs.TAG }}). "}}]}]}' - channel_id: ${{ env.SLACK_CHANNEL }} + channel_id: ${{ env.SLACK_CHANNEL }} aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -133,14 +129,14 @@ jobs: env: NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt APP_ENV: ${{ inputs.build_type || 'prod' }} - + ports: - 80 volumes: - /etc/ssl/certs:/etc/ssl/certs steps: - + - name: Export setup start time id: export-setup-start-time run: echo SETUP_START_TIME=$(date +"%s") >> $GITHUB_OUTPUT @@ -208,12 +204,12 @@ jobs: cd out ls -l fi - + - name: Build sitemap run: cd main && yarn build:sitemap - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} @@ -237,7 +233,7 @@ jobs: DEST: s3://next-content.dev.va.gov - if: inputs.build_type == 'staging' name: Deploy to S3 - run: | + run: | cd main && ./scripts/github-actions/deploy.sh -s $SRC -d $DEST -v ls cd out @@ -251,8 +247,8 @@ jobs: env: SRC: ./out/ DEST: s3://next-content.www.va.gov - - - if: inputs.build_type == '' + + - if: inputs.build_type == '' name: Deploy to S3 run: cd main && ./scripts/github-actions/deploy.sh -s $SRC -d $DEST -v env: @@ -262,7 +258,7 @@ jobs: - name: Export deploy end time id: export-deploy-end-time run: echo DEPLOY_END_TIME=$(date +"%s") >> $GITHUB_OUTPUT - + notify-success: name: Notify Success needs: [validate-build-status, build] @@ -282,7 +278,7 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} @@ -336,7 +332,7 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} @@ -380,7 +376,7 @@ jobs: METRIC_NAMESPACE: dsva_vagov.next_build steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v4 #uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Get current timestamp diff --git a/.github/workflows/gha-metrics-datadog.yml b/.github/workflows/gha-metrics-datadog.yml index 5d7f48377..3ae87d056 100644 --- a/.github/workflows/gha-metrics-datadog.yml +++ b/.github/workflows/gha-metrics-datadog.yml @@ -11,7 +11,7 @@ jobs: timeout-minutes: 10 steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -25,7 +25,7 @@ jobs: env_variable_name: GHA_CONTENT_BUILD_DATADOG_API_KEY - name: Send GitHub Actions metrics to DataDog - uses: int128/datadog-actions-metrics@5dbc8b81eb6d1b3cbd24099ff83373df472e0e36 # v1.95.0 + uses: int128/datadog-actions-metrics@b55864e8d4ccab2d30f33e9eabc6e02031894555 # v1.97.0 with: datadog-api-key: ${{ env.GHA_CONTENT_BUILD_DATADOG_API_KEY }} collect-job-metrics: true diff --git a/.github/workflows/mirror-images.yml b/.github/workflows/mirror-images.yml index efd296eb3..a962d1604 100644 --- a/.github/workflows/mirror-images.yml +++ b/.github/workflows/mirror-images.yml @@ -67,7 +67,7 @@ jobs: echo "IMAGE_TAG=$(cat tag.txt)" >> $GITHUB_ENV - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index e097a8180..b10e7d461 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -13,7 +13,7 @@ jobs: if: github.event.deployment_status.state == 'success' steps: - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index a23b52052..25e9d125c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} diff --git a/.github/workflows/recurring-release.yml b/.github/workflows/recurring-release.yml deleted file mode 100644 index 32031df82..000000000 --- a/.github/workflows/recurring-release.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: recurring release -on: - workflow_dispatch: - - schedule: - - cron: "*/30 8-20 * * 1-5" # run a build to prod every 30 minutes from 8am to 8pm monday to friday - -jobs: - content-release: - uses: department-of-veterans-affairs/next-build/.github/workflows/content-release.yml@main - with: - build_type: "prod" - secrets: inherit - - content-release-dev: - uses: department-of-veterans-affairs/next-build/.github/workflows/content-release.yml@main - with: - build_type: "dev" - secrets: inherit - - content-release-staging: - uses: department-of-veterans-affairs/next-build/.github/workflows/content-release.yml@main - with: - build_type: "staging" - secrets: inherit - - diff --git a/.github/workflows/update-manifest.yml b/.github/workflows/update-manifest.yml index 1c2d5729e..cd39b7e53 100644 --- a/.github/workflows/update-manifest.yml +++ b/.github/workflows/update-manifest.yml @@ -66,7 +66,7 @@ jobs: echo "IMAGE_TAG=$(cat tag.txt)" >> $GITHUB_ENV - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-region: us-gov-west-1 role-to-assume: ${{ vars.AWS_ASSUME_ROLE }} diff --git a/.yarn/cache/@mswjs-interceptors-npm-0.35.0-965cf913d0-5bba94b027.zip b/.yarn/cache/@mswjs-interceptors-npm-0.35.0-965cf913d0-5bba94b027.zip deleted file mode 100644 index f64854488..000000000 Binary files a/.yarn/cache/@mswjs-interceptors-npm-0.35.0-965cf913d0-5bba94b027.zip and /dev/null differ diff --git a/.yarn/cache/@mswjs-interceptors-npm-0.35.8-8fc56ce517-1ba90a4974.zip b/.yarn/cache/@mswjs-interceptors-npm-0.35.8-8fc56ce517-1ba90a4974.zip new file mode 100644 index 000000000..a28c8c0e3 Binary files /dev/null and b/.yarn/cache/@mswjs-interceptors-npm-0.35.8-8fc56ce517-1ba90a4974.zip differ diff --git a/.yarn/cache/@testing-library-react-npm-14.3.1-08c822f7c7-b057d4c9db.zip b/.yarn/cache/@testing-library-react-npm-14.3.1-08c822f7c7-b057d4c9db.zip deleted file mode 100644 index e85418ce2..000000000 Binary files a/.yarn/cache/@testing-library-react-npm-14.3.1-08c822f7c7-b057d4c9db.zip and /dev/null differ diff --git a/.yarn/cache/@testing-library-react-npm-16.0.1-3939518263-1837db473e.zip b/.yarn/cache/@testing-library-react-npm-16.0.1-3939518263-1837db473e.zip new file mode 100644 index 000000000..35776bbd3 Binary files /dev/null and b/.yarn/cache/@testing-library-react-npm-16.0.1-3939518263-1837db473e.zip differ diff --git a/.yarn/cache/@typescript-eslint-parser-npm-8.5.0-bb2fdd364d-e53f0a05d8.zip b/.yarn/cache/@typescript-eslint-parser-npm-8.7.0-e69f44d770-fdfd7cf676.zip similarity index 87% rename from .yarn/cache/@typescript-eslint-parser-npm-8.5.0-bb2fdd364d-e53f0a05d8.zip rename to .yarn/cache/@typescript-eslint-parser-npm-8.7.0-e69f44d770-fdfd7cf676.zip index abb2ca248..5ded70021 100644 Binary files a/.yarn/cache/@typescript-eslint-parser-npm-8.5.0-bb2fdd364d-e53f0a05d8.zip and b/.yarn/cache/@typescript-eslint-parser-npm-8.7.0-e69f44d770-fdfd7cf676.zip differ diff --git a/.yarn/cache/@typescript-eslint-scope-manager-npm-8.7.0-a1b9294a4a-30ef3bf4fa.zip b/.yarn/cache/@typescript-eslint-scope-manager-npm-8.7.0-a1b9294a4a-30ef3bf4fa.zip new file mode 100644 index 000000000..7dc88c207 Binary files /dev/null and b/.yarn/cache/@typescript-eslint-scope-manager-npm-8.7.0-a1b9294a4a-30ef3bf4fa.zip differ diff --git a/.yarn/cache/@typescript-eslint-types-npm-8.7.0-e1676d8571-4f1a625c14.zip b/.yarn/cache/@typescript-eslint-types-npm-8.7.0-e1676d8571-4f1a625c14.zip new file mode 100644 index 000000000..0af5fd096 Binary files /dev/null and b/.yarn/cache/@typescript-eslint-types-npm-8.7.0-e1676d8571-4f1a625c14.zip differ diff --git a/.yarn/cache/@typescript-eslint-typescript-estree-npm-8.7.0-73a6c7a8c3-f1a2d53640.zip b/.yarn/cache/@typescript-eslint-typescript-estree-npm-8.7.0-73a6c7a8c3-f1a2d53640.zip new file mode 100644 index 000000000..97835c9ab Binary files /dev/null and b/.yarn/cache/@typescript-eslint-typescript-estree-npm-8.7.0-73a6c7a8c3-f1a2d53640.zip differ diff --git a/.yarn/cache/@typescript-eslint-visitor-keys-npm-8.7.0-3d25c10cdc-072d3d4e7f.zip b/.yarn/cache/@typescript-eslint-visitor-keys-npm-8.7.0-3d25c10cdc-072d3d4e7f.zip new file mode 100644 index 000000000..68e68b0b1 Binary files /dev/null and b/.yarn/cache/@typescript-eslint-visitor-keys-npm-8.7.0-3d25c10cdc-072d3d4e7f.zip differ diff --git a/.yarn/cache/msw-npm-2.4.4-701fcac5a9-9942c90ffe.zip b/.yarn/cache/msw-npm-2.4.4-701fcac5a9-9942c90ffe.zip deleted file mode 100644 index e5079c097..000000000 Binary files a/.yarn/cache/msw-npm-2.4.4-701fcac5a9-9942c90ffe.zip and /dev/null differ diff --git a/.yarn/cache/msw-npm-2.4.9-254c98033d-add5a614ce.zip b/.yarn/cache/msw-npm-2.4.9-254c98033d-add5a614ce.zip new file mode 100644 index 000000000..544e5b114 Binary files /dev/null and b/.yarn/cache/msw-npm-2.4.9-254c98033d-add5a614ce.zip differ diff --git a/.yarn/cache/path-to-regexp-npm-6.2.2-0bf7f6805c-b7b0005c36.zip b/.yarn/cache/path-to-regexp-npm-6.2.2-0bf7f6805c-b7b0005c36.zip deleted file mode 100644 index 9ba9990fc..000000000 Binary files a/.yarn/cache/path-to-regexp-npm-6.2.2-0bf7f6805c-b7b0005c36.zip and /dev/null differ diff --git a/.yarn/cache/path-to-regexp-npm-6.3.0-ee2cdde576-eca78602e6.zip b/.yarn/cache/path-to-regexp-npm-6.3.0-ee2cdde576-eca78602e6.zip new file mode 100644 index 000000000..a48cf19d9 Binary files /dev/null and b/.yarn/cache/path-to-regexp-npm-6.3.0-ee2cdde576-eca78602e6.zip differ diff --git a/READMEs/devops/content-release.md b/READMEs/devops/content-release.md index 68001e28f..36bb22f46 100644 --- a/READMEs/devops/content-release.md +++ b/READMEs/devops/content-release.md @@ -4,11 +4,27 @@ Content Release is what VA teams call the process of moving new published conten See [CMS Content Release](https://github.com/department-of-veterans-affairs/va.gov-cms/blob/main/READMES/cms-content-release.md) for more information on how content release is currently triggered via CMS for `content-build` and BRD. -In the short term, next-build will operate in very much the same way. When content is published in Drupal, a dispatch to our [content-release workflow](/.github/workflows/content-release.yml) will be triggered. This workflow builds all the static pages and assets currently known to next-build (as discovered by `RESOURCE_TYPES_TO_BUILD` in the catchall [slug file](/READMEs/slug.md)). It also generates a sitemap for these pages. Once the build process is completed, all of these items are pushed to the appropriate [S3 bucket](/READMEs/devops/infrastructure.md). Once the files are uploaded to S3, they are available for public traffic. +In the short term, next-build will operate in very much the same way. All content that is managed by Next Build will be built with each content release, regardless of whether it is new/changed or unchanged. -This workflow also happens whenever new code is merged to the main branch, to ensure the S3 bucket has the most up-to-date changes. +## Production content release -Right now, the workflow always runs using prod.cms.va.gov as it's data source and pushes output to the production next-content.www S3 bucket. If/when the workflow is parameterized to run against multiple targets (similar to how content-build builds `vagovdev`, `vagovstaging` and `vagovprod`), the sources and output buckets should also be adjusted. +Production content release currently is triggered by the following events: + +- On a schedule, every 30 minutes between 8 am and 8 pm ET +- Manually through the Github Actions interface +- When specific content is published in the CMS + +Production content releases use https://prod.cms.va.gov/ as their content source. + +## Dev and Staging content release + +Dev and Staging content releases are triggered by the following events: + +- On a schedule, nightly at 5:05 am ET or 5:35 am ET for Dev arnd Staging respectively. This keeps content relatively fresh even when there are no code changes to trigger a Dev or Staging content release. +- When any code is merged to the `main` branch of Next Build and has a successfull CI run on main - this is to keep Dev and Staging up-to-date with code changes they come in. +- Manually through the Github Actions interface + +Dev and Staging content releases use https://main-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov/ as their content source. # Archiving diff --git a/READMEs/env-loader.md b/READMEs/env-loader.md index de14357ba..ceeac5062 100644 --- a/READMEs/env-loader.md +++ b/READMEs/env-loader.md @@ -4,17 +4,17 @@ The env-loader package is our custom solution for ingesting environment variable It collects variables from: -1. appropriate `.env` file in `envs/` based on the `APP_ENV` env var +1. the CMS environment's defined feature flags -- (defaults to `.env.local`) +- which CMS enviroment determined via `NEXT_PUBLIC_BASE_DRUPAL_URL` env var -2. the CMS environment's defined feature flags +2. appropriate `.env` file in `envs/` based on the `APP_ENV` env var -- which CMS enviroment determined via `NEXT_PUBLIC_BASE_DRUPAL_URL` env var +- (defaults to `.env.local`) 3. CLI options included with the command -After collecting (and overwriting values as needed based on the order above), all env vars are set and the command runs. +After collecting (and overwriting values as needed based on the order above), all env vars are set and the command runs. Keep in mind the ordering. If the same environment variable is set in both the CMS feature flags and in the .env file, the value in the .env file will be chosen. For a full list of CLI options available, see [cli-options.tsx](packages/env-loader/src/cli-options.ts) diff --git a/READMEs/images/feature-toggle-admin.png b/READMEs/images/feature-toggle-admin.png new file mode 100644 index 000000000..cf7951381 Binary files /dev/null and b/READMEs/images/feature-toggle-admin.png differ diff --git a/READMEs/layout-rollout.md b/READMEs/layout-rollout.md new file mode 100644 index 000000000..27b9f5d72 --- /dev/null +++ b/READMEs/layout-rollout.md @@ -0,0 +1,191 @@ +# Feature Flags + +Creating a template for CMS content in Next Build requires coordination between Next Build and the CMS. Migrating an existing template in Content Build into Next Build additionally requires coordination in that repo. + +We want to be able to work on a layout without fear that Next Build will attempt to build and deploy the template before it is ready. We also want to be able to control whether the template is built from one system or the other, without needing to coordinate deploys. + +## CMS feature flags + +The CMS has a feature flag system which it calls 'Feature Toggles'. These are strings with a corresponding boolean value, which can be controlled through the CMS admin UI. + +### Admin + +In the CMS, the Feature Toggle admin can be found at [https://prod.cms.va.gov/admin/config/system/feature_toggle](https://prod.cms.va.gov/admin/config/system/feature_toggle) for Prod, or the equivalent URL on the CMS environment you're working with (admin required). + +![The VA CMS Feature Toggle admin page](images/feature-toggle-admin.png) + +A checked value corresponds to 'on' or 'true' for the string in question. + +### Adding a new feature flag + +Adding a new feature flag is a CMS code change. The list of feature flags is maintained in the repo at [config/sync/feature_toggle.features.yml](https://github.com/department-of-veterans-affairs/va.gov-cms/blob/main/config/sync/feature_toggle.features.yml). Adding a new flag is as simple as adding a new item under `features:`. + +### Using feature flags in code + +In order to help understand how the feature flags work, there is [a set of testing steps that shows how feature flags should function in code](#local-testing-of-feature-flags) at the end of this readme. + +#### Next Build + +In Next Build, the feature flag values for the connected CMS instance are made available as environment variables. So for example, if there is a feature flag `FEATURE_NEXT_BUILD_CONTENT_LANDING_PAGE` in the CMS, in Next Build it can be referenced at any time via `process.env.FEATURE_NEXT_BUILD_CONTENT_LANDING_PAGE`. + +An enabled feature flag environment variable has a **string** value of `'true'`. Any other value is false. + +#### Content Build + +In Content Build, CMS feature flags are loaded as a global. They can be referenced with this code line: + +``` + const { cmsFeatureFlags } = global; +``` + +This global variable becomes available after options have loaded, and cannot be referenced until then. + +In Content Build, feature flag values are 'truthy' or 'falsy'. For example, `cmsFeatureFlags.FEATURE_ALL_HUB_SIDE_NAVS` will evaluate to `true` or `false` and can be used as such. + +#### CMS + +In the CMS, the class that allows code to retrieve flag values is `Drupal\feature_toggle\FeatureStatus`. Typically, this class is loaded into another class via dependency injection. Values can be retrieved via the method `FeatureStatus->getStatus($flag_name)`. + +## CMS requirements for rollout + +In order for rollout to proceed, a few things need to be done on the CMS side. + +1. **The content type must exist in the CMS.** This should be obvious, but you cannot retrieve data for a content type if it doesn't exist. + +1. **A Next Drupal content entity must exist for the content type.** The primary function of this content entity is to control how the CMS manages content preview for the content type. The procedure for creating a content entity is described in the [Preview documentation under "Content Configuration"](./preview.md#content-configuration). + +1. **A feature flag must exist for the content type.** Feature flags for content types are of the form `FEATURE_NEXT_BUILD_CONTENT_`, where the machine name is the machine name of that content type in Drupal, in all caps. The machine name should match the machine name in Drupal, even if that machine name is truncated or misspelled. So for example: + + - `FEATURE_NEXT_BUILD_CONTENT_VBA_FACILITY` + - `FEATURE_NEXT_BUILD_CONTENT_HEALTH_CARE_REGION_DETAIL_PAGE` + - `FEATURE_NEXT_BUILD_CONTENT_VAMC_SYSTEM_MEDICAL_RECORDS_OFFI` + +## Next Build use of feature flags + +When Next Build connects to a CMS instance, it will load the feature flag state of that CMS instance. In [[[...slug]].tsx](./[[...slug]].md), this feature flag state is used to determine whether a content type should be allowed to build or not. This is in addition to the addition of a given content type to `PAGE_RESOURCE_TYPES` in [resourceTypes.ts](../src/lib/constants/resourceTypes.ts). + +If the feature flag for a given content type is not active, or an equivalent environment variable is not set for that content type, [[[...slug]].tsx](./[[...slug]].md) will not build the page. + +### Development + +During local development, you will need to activate the content type's feature flag or environment variable, so that you can build pages that are otherwise not active. This can be done one of two ways: + +1. **Turn the flag on in your local CMS.** If you are developing against a local CMS, you are free to enable the appropriate flag in that CMS. This will be located at https://va-gov-cms.ddev.site/admin/config/system/feature_toggle. + +2. **Set the environment variable in your .env.local file.** You can enable a specific content type by adding its environment variable with a value of `true`. This will override the flag value you are receiving from the CMS instance. + + For example, if you want to enable the Vet Center content type (machine name `vet_center`), you would add the following to your .env.local file: + + ``` + FEATURE_NEXT_BUILD_CONTENT_VET_CENTER=true + ``` + + Alternately, setting the following special environment variable will bypass the flag system and enable all content types that Next Build is aware of: + + ``` + FEATURE_NEXT_BUILD_CONTENT_ALL=true + ``` + + It is best to only use this environment variable locally. + +### Review & Tests + +In order to effectively review and test the use of these flags, they will need to be enabled for the Tugboat and Test environments. This is because those environments make use of databases that derive from the Production database, and the feature flags must not be set on the Production CMS. + +When you are submitting a PR, add your feature flag variable to .env.test and .env.tugboat, so that the content type is enabled for those environments. + +### Feature Flag variables on Dev, Staging, Prod + +When you are merging a new layout template and need to test it on Dev and Staging, you will need to add the feature flag variable to those environments. This is because the database for those environments is derived from the Production database, and the feature flag should not be enabled on Production until launch. These will need to be added to .env.dev and .env.staging, if testing on those environments is desired. + +Feature flag variables should _never_ be added to the .env.prod file. Feature flags on Prod must _always_ be controlled from the Prod CMS itself. + +## Content Build use of feature flags + +Feature flag usage in Content Build will primarily consist of disabling certain GraphQL queries. This should only be done if you feel very confident that you can roll out the content type in Next Build and simultaneously disable it in Content Build without issues. + +Work will most likely be done in [GetAllPages.graphql.js](https://github.com/department-of-veterans-affairs/content-build/blob/main/src/site/stages/build/drupal/graphql/GetAllPages.graphql.js), as this is where full retrieving of content types takes place. Let's say we want to allow Event Listing queries to be controlled by flags. The [Event Listing query fragment](https://github.com/department-of-veterans-affairs/content-build/blob/main/src/site/stages/build/drupal/graphql/GetAllPages.graphql.js#L118) is included in a larger GraphQL query which is structured as a string literal: + +```Javascript +// Surrounding context removed; see link above +` + ... bioPage + ... benefitListingPage + ... nodeEventListing + ... nodeEvent + ... storyListingPage +` +``` + +Using the flag can be done by using `${}` within that string literal to include JavaScript that can be interpolated: + +```Javascript +` + ... bioPage + ... benefitListingPage + ${ + // If the flag is not present and set, query and build event listings. + !cmsFeatureFlags.FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING + ? `... nodeEventListing` + : '' + } + ... nodeEvent + ... storyListingPage +` +``` + +Note the negation in front of the feature flag value. In most cases we want this code to be active when the feature flag is _inactive_. Activating the feature flag should deactivate the code. + +## Layout Rollout to Production + +In order to roll out a content type on production, the procedure is simple: + +1. **Ensure the flag for that content type is not checked in the Prod CMS.** This should be true from the beginning of the development process, but it is important to check this before deployment. + +1. **Deploy all code for Next Build and Content Build (if using flags in Content Build).** Provided the flag is inactive, code handling the templating of a given content type will not become active in production. Code deployments do not need to be coordinated. + +1. **Enable the flag in the Prod CMS.** This will activate the content type. When the flag becomes active, the following thing happen: + + a. Next Build production will become able to build the content type. + + b. If flags are used in Content Build, the change will also become active there. Typically this would turn off that content type in Content Build. + + c. CMS will begin using Next Build Preview Server links for that content type. Without the flag active, a content type will use Content Build Preview for its preview. Turning the flag on tells the CMS to use the Next Build link. + +## Local testing of feature flags + +To get a handle on how feature flags work, the following testing steps may help demonstrate how it is intended to work. + +### Setup + +1. In your local CMS instance, check out main, pull the latest DB (`ddev pull va --skip-files`), and then ensure it is running correctly. +2. Check this branch out for Next Build. +3. Make sure that your .env.local file is pointed towards your local CMS in .env.local. Make sure this is `http://va-gov-cms.ddev.site` rather than `https` +4. Start Next Build locally: `yarn dev` + +### First tests - enabling content types from the CMS. + +1. Visit an events listing page: http://localhost:3999/pittsburgh-health-care/events/. This should return a 404/page not found. +2. Visit the system feature toggle page, https://va-gov-cms.ddev.site/admin/config/system/feature_toggle. Find the Event Listing flag, check it, and save (`FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING`). +3. Stop and restart local Next Build. +4. Reload http://localhost:3999/pittsburgh-health-care/events/ (it may reload on its own). This should now load. +5. Visit any event page, i.e. http://localhost:3999/pittsburgh-health-care/events/72337/. It should return a 404. +6. Visit the system feature toggle page, https://va-gov-cms.ddev.site/admin/config/system/feature_toggle. Find the Event flag, check it, and save (`FEATURE_NEXT_BUILD_CONTENT_EVENT`). +7. Stop and restart local Next Build. +8. Reload http://localhost:3999/pittsburgh-health-care/events/72337/ (it may reload on its own). This page should now load. + +### Enabling content types from the environment file. + +1. Start your local Next Build if it is not running. +2. Visit a Vet Center page: http://localhost:3999/oklahoma-city-vet-center/. It should return a 404. +3. In your envs/.env.local file, add the following variable: `FEATURE_NEXT_BUILD_CONTENT_VET_CENTER=true` +4. Stop and restart local Next Build. +5. Reload http://localhost:3999/oklahoma-city-vet-center/ (it may reload on its own). The page should now load. + +### Testing the special all content variable. + +1. Start your local Next Build if it is not running. +2. Visit a Story page: http://localhost:3999/portland-health-care/stories/portland-veteran-receives-first-place-award-for-poetry-entry/. It should return a 404. +3. In your envs/.env.local file, add the following variable: `FEATURE_NEXT_BUILD_CONTENT_ALL=true` +4. Stop and restart local Next Build. +5. Reload http://localhost:3999/portland-health-care/stories/portland-veteran-receives-first-place-award-for-poetry-entry/ (it may reload on its own). The page should now load. diff --git a/docker-run.sh b/docker-run.sh index b0ffe6b08..1e12f44bc 100644 --- a/docker-run.sh +++ b/docker-run.sh @@ -1,3 +1,3 @@ #!/bin/sh - +ls -al envs APP_ENV=$APP_ENV yarn build:preview && yarn start diff --git a/envs/.env.dev b/envs/.env.dev index f65e47b86..928e70742 100644 --- a/envs/.env.dev +++ b/envs/.env.dev @@ -19,3 +19,7 @@ DRUPAL_PREVIEW_SECRET=secret NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=GTM-WFJWBD NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=N9BisSDKAwJENFQtQIEvXQ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-423 + +# Feature flags for enabling content types. These should only be added when you are preparing to go to prod and are testing on dev. +FEATURE_NEXT_BUILD_CONTENT_EVENT=true +FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true diff --git a/envs/.env.example b/envs/.env.example index bb3c91e8b..00f3f12cb 100644 --- a/envs/.env.example +++ b/envs/.env.example @@ -27,3 +27,13 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-423 # Configure the localhost port for the Next.js dev server PORT=3999 + +# Set CMS feature flag values here in order to override values provided by the CMS. +# See /flags_list in your target CMS for these values, +# and /admin/config/system/feature_toggle to modify those values at the source. +# For example, enabling the following var tells Next Build to build Vet Center content. +# FEATURE_NEXT_BUILD_CONTENT_VET_CENTER=true + +# Enabling the following var tells Next Build to build all content types it knows about. +# Only use this locally or in testing. +# FEATURE_NEXT_BUILD_CONTENT_ALL=true diff --git a/envs/.env.prod b/envs/.env.prod index 25fe20ada..a3d830ad8 100644 --- a/envs/.env.prod +++ b/envs/.env.prod @@ -19,3 +19,13 @@ DRUPAL_PREVIEW_SECRET=secret NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=GTM-WFJWBD NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=XWK-rHkcb1wp4DCOCzhPiQ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-1 + +# FEATURE FLAG VARIABLES FOR CONTENT TYPES SHOULD NEVER BE ADDED TO THE PRODUCTION ENVIRONMENT HERE. +# Prod's values for these feature flags should always be controlled from the Prod CMS. +# For example, never add and enable a variable like the following to this file: +# FEATURE_NEXT_BUILD_CONTENT_EVENT=true +# Again, do NOT add these here. + +# ... Except, prior to initial launch, we will need these here for prod testing. +FEATURE_NEXT_BUILD_CONTENT_EVENT=true +FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true diff --git a/envs/.env.staging b/envs/.env.staging index ba84acf53..7c6d796bd 100644 --- a/envs/.env.staging +++ b/envs/.env.staging @@ -16,3 +16,7 @@ NEXT_PUBLIC_SITE_URL=https://staging.va.gov NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=GTM-WFJWBD NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=inC4EKQce9vlWpRVcowiyQ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-661 + +# Feature flags for enabling content types. These should only be added when you are preparing to go to prod and are testing on staging. +FEATURE_NEXT_BUILD_CONTENT_EVENT=true +FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true diff --git a/envs/.env.test b/envs/.env.test index d8b95a2c9..578a40c1f 100644 --- a/envs/.env.test +++ b/envs/.env.test @@ -14,3 +14,14 @@ NEXT_PUBLIC_SITE_URL=http://127.0.0.1:8001 # Configure the localhost port for the next.js dev server PORT=3999 + +# The Testing environment file list of flags should always match .env.tugboat's list. +# Tugboat is used for Playwright testing, and this environment is use for unit testing. +# Please keep these in sync. +FEATURE_NEXT_BUILD_CONTENT_EVENT=true +FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true +FEATURE_NEXT_BUILD_CONTENT_NEWS_STORY=true +FEATURE_NEXT_BUILD_CONTENT_STORY_LISTING=true +FEATURE_NEXT_BUILD_CONTENT_PRESS_RELEASE=true +FEATURE_NEXT_BUILD_CONTENT_PRESS_RELEASES_LISTING=true +FEATURE_NEXT_BUILD_CONTENT_VET_CENTER=true diff --git a/envs/.env.tugboat b/envs/.env.tugboat index b67352afe..95f17100a 100644 --- a/envs/.env.tugboat +++ b/envs/.env.tugboat @@ -22,3 +22,16 @@ DRUPAL_PREVIEW_SECRET=secret # Configure the localhost port for the Next.js server. This is used for Preview Servers on CMS Tugboats. https://tugboat.vfs.va.gov/5fd3b8ee7b4657022b5722d6 # Tugboat PR environments for next-build https://tugboat.vfs.va.gov/64d5537c2d3036648da7c7ff do not use this, as they build static files served via nginx. PORT=3999 + +# These flags are required to enable testing for specific content types that are not yet enabled on Prod. +# Add a flag here for a given content type layout if you are in the process of testing it. +# If you add a new content type flag variable here, you must also add it to .env.test. +# Please keep these in sync. +FEATURE_NEXT_BUILD_CONTENT_EVENT=true +FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true +FEATURE_NEXT_BUILD_CONTENT_NEWS_STORY=true +FEATURE_NEXT_BUILD_CONTENT_STORY_LISTING=true +FEATURE_NEXT_BUILD_CONTENT_PRESS_RELEASE=true +FEATURE_NEXT_BUILD_CONTENT_PRESS_RELEASES_LISTING=true +FEATURE_NEXT_BUILD_CONTENT_VET_CENTER=true + diff --git a/package.json b/package.json index 03bb2fc00..69f975280 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "@storybook/testing-library": "^0.2.2", "@testing-library/dom": "^10.0.0", "@testing-library/jest-dom": "^6.4.8", - "@testing-library/react": "^14.1.2", + "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.1", "@types/jest": "^29.5.12", "@types/lodash": "^4.17.7", @@ -109,7 +109,7 @@ "@types/react-dom": "^18.2.18", "@types/uuid": "^9.0.7", "@typescript-eslint/eslint-plugin": "^7.16.1", - "@typescript-eslint/parser": "^8.2.0", + "@typescript-eslint/parser": "^8.7.0", "axe-core": "^4.10.0", "debug": "^4.3.4", "eslint": "8.57.0", @@ -128,7 +128,7 @@ "jest-environment-jsdom": "^29.7.0", "jest-watch-typeahead": "^2.2.2", "lint-staged": "^15.2.2", - "msw": "^2.3.1", + "msw": "^2.4.9", "nock": "^13.5.4", "node_extra_ca_certs_mozilla_bundle": "^1.0.6", "npm": "^10.8.2", diff --git a/packages/env-loader/src/env-file.ts b/packages/env-loader/src/env-file.ts index 9a80ddea3..50e5f6689 100644 --- a/packages/env-loader/src/env-file.ts +++ b/packages/env-loader/src/env-file.ts @@ -5,17 +5,21 @@ import { EnvVars } from '.' const loadEnvVarsFromPath = (path: string): EnvVars => { const envVars = {} + // eslint-disable-next-line no-console + console.log(`trying to load vars from ${path}`) dotenvExpand.expand( dotenv.config({ - path, + path: path, override: true, processEnv: envVars, + debug: true, }) ) // eslint-disable-next-line no-console console.log(`Using environment variables from: ${path}`) - + // eslint-disable-next-line no-console + console.log(envVars) return envVars } diff --git a/packages/env-loader/src/index.ts b/packages/env-loader/src/index.ts index a6778341a..acf553f6f 100644 --- a/packages/env-loader/src/index.ts +++ b/packages/env-loader/src/index.ts @@ -33,8 +33,8 @@ export const processEnv = async (command: string): Promise => { process.env = { ...process.env, ...{ - ...envVars, ...cmsFeatureFlags, + ...envVars, ...cliOptions, }, } diff --git a/src/pages/[[...slug]].tsx b/src/pages/[[...slug]].tsx index a6f4ee22f..860f14e00 100644 --- a/src/pages/[[...slug]].tsx +++ b/src/pages/[[...slug]].tsx @@ -23,7 +23,10 @@ import { shouldHideHomeBreadcrumb } from '@/lib/utils/breadcrumbs' import { Event } from '@/templates/layouts/event' import { EventListing } from '@/templates/layouts/eventListing' import { getStaticPathsByResourceType } from '@/lib/drupal/staticPaths' -import { RESOURCE_TYPES } from '@/lib/constants/resourceTypes' +import { + RESOURCE_TYPES, + PAGE_RESOURCE_TYPES, +} from '@/lib/constants/resourceTypes' import { getExpandedStaticPropsContext, getStaticPropsResource, @@ -44,17 +47,31 @@ import { ResourcesSupport } from '@/templates/layouts/resourcesSupport' import { VetCenter as FormattedVetCenter } from '@/types/formatted/vetCenter' import { VetCenter } from '@/templates/layouts/vetCenter' -// We define this here because, theoretically, another file could build other types. -export const RESOURCE_TYPES_TO_BUILD = [ - RESOURCE_TYPES.STORY_LISTING, - RESOURCE_TYPES.STORY, - RESOURCE_TYPES.EVENT, - RESOURCE_TYPES.EVENT_LISTING, - RESOURCE_TYPES.PRESS_RELEASE, - RESOURCE_TYPES.PRESS_RELEASE_LISTING, - RESOURCE_TYPES.RESOURCES_SUPPORT, - RESOURCE_TYPES.VET_CENTER, -] as const +// IMPORTANT: in order for a content type to build in Next Build, it must have an appropriate +// environment variable set in one of two places: +// 1. The CMS feature flags for the target environment +// 2. The .env file for the given environment (i.e. .env.local) +// +// Please see READMEs/layout-rollout.md for more detailed information. + +// RESOURCE_TYPES_TO_BUILD technically is not guaranteed to be reassigned. +// eslint-disable-next-line prefer-const +let RESOURCE_TYPES_TO_BUILD = [] +// FEATURE_NEXT_BUILD_CONTENT_ALL is checked to allow local developers to bypass flag checks. +if (process.env.FEATURE_NEXT_BUILD_CONTENT_ALL === 'true') { + RESOURCE_TYPES_TO_BUILD = PAGE_RESOURCE_TYPES +} else { + // Check the env variables loaded from the CMS feature flags and env files to determine what + // content types to build. + for (let x = 0; x < PAGE_RESOURCE_TYPES.length; x++) { + const typeName = PAGE_RESOURCE_TYPES[x].replace(/^node--/, '').toUpperCase() + const flagName = `FEATURE_NEXT_BUILD_CONTENT_${typeName}` + // Note 'true' as a string is correct here. Env variables are always strings. + if (process.env[flagName] === 'true') { + RESOURCE_TYPES_TO_BUILD.push(PAGE_RESOURCE_TYPES[x]) + } + } +} export const DynamicBreadcrumbs = dynamic( () => import('@/templates/common/breadcrumbs'), diff --git a/yarn.lock b/yarn.lock index 5611dd0e9..d4354ba44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2606,9 +2606,9 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:^0.35.0": - version: 0.35.0 - resolution: "@mswjs/interceptors@npm:0.35.0" +"@mswjs/interceptors@npm:^0.35.8": + version: 0.35.8 + resolution: "@mswjs/interceptors@npm:0.35.8" dependencies: "@open-draft/deferred-promise": ^2.2.0 "@open-draft/logger": ^0.3.0 @@ -2616,7 +2616,7 @@ __metadata: is-node-process: ^1.2.0 outvariant: ^1.4.3 strict-event-emitter: ^0.5.1 - checksum: 5bba94b027f4e83e6f3c64f09962893799d31da7c36fbe5c2d2a6319b913bbd1e3bc47fb590e720f3a562d1c5d37b52d6eb9166dd6442ca5a8d22df8cf3ec9c9 + checksum: 1ba90a4974cd52d02d54f9d6c6c23c060b2ddbd25ab46ae10d3b5fc64ef5a9d3b72588730e3d246937c843953cbd85f249f5bed0329a399941c7ff547247d4a9 languageName: node linkType: hard @@ -4293,17 +4293,23 @@ __metadata: languageName: node linkType: hard -"@testing-library/react@npm:^14.1.2": - version: 14.3.1 - resolution: "@testing-library/react@npm:14.3.1" +"@testing-library/react@npm:^16.0.1": + version: 16.0.1 + resolution: "@testing-library/react@npm:16.0.1" dependencies: "@babel/runtime": ^7.12.5 - "@testing-library/dom": ^9.0.0 - "@types/react-dom": ^18.0.0 peerDependencies: + "@testing-library/dom": ^10.0.0 + "@types/react": ^18.0.0 + "@types/react-dom": ^18.0.0 react: ^18.0.0 react-dom: ^18.0.0 - checksum: b057d4c9db5a523acfc24d7bc4665a924ab8d6f252c7f51eecf7dd30f1239413e1134925fd5cc9cbdef80496af64c04e6719b2081f89fe05ba87e8c6305bcc16 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 1837db473ea018cf2b5d0cbfffb7a30d0d759e5a7f23aad431441c77bcc3d2533250cd003a61878fd908267df47404cedcb5914f12d79e413002c659652b37fd languageName: node linkType: hard @@ -4712,7 +4718,7 @@ __metadata: languageName: node linkType: hard -"@types/react-dom@npm:^18.0.0, @types/react-dom@npm:^18.2.18": +"@types/react-dom@npm:^18.2.18": version: 18.3.0 resolution: "@types/react-dom@npm:18.3.0" dependencies: @@ -4940,21 +4946,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^8.2.0": - version: 8.5.0 - resolution: "@typescript-eslint/parser@npm:8.5.0" +"@typescript-eslint/parser@npm:^8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/parser@npm:8.7.0" dependencies: - "@typescript-eslint/scope-manager": 8.5.0 - "@typescript-eslint/types": 8.5.0 - "@typescript-eslint/typescript-estree": 8.5.0 - "@typescript-eslint/visitor-keys": 8.5.0 + "@typescript-eslint/scope-manager": 8.7.0 + "@typescript-eslint/types": 8.7.0 + "@typescript-eslint/typescript-estree": 8.7.0 + "@typescript-eslint/visitor-keys": 8.7.0 debug: ^4.3.4 peerDependencies: eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: e53f0a05d8167673d8c9ce7ca22fbd673bb4910e69a96a084cf1dac22555e04d00774533de5bdb3a6bf72f8706fa5f414ee5b398646b6651ba0fd2e875ba3c8a + checksum: fdfd7cf67662fd03442ae7e14f461ee7da14a5d27e692535167f50dfc965f9249692a6b004ac1f16d9d932364ccb8ce2c123a254d4d380d9ccd649205694d875 languageName: node linkType: hard @@ -5008,6 +5014,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/scope-manager@npm:8.7.0" + dependencies: + "@typescript-eslint/types": 8.7.0 + "@typescript-eslint/visitor-keys": 8.7.0 + checksum: 30ef3bf4fa9c6c614cda7a2765e5163b8e07dc80619ffd70882d7d4db957b939167ef6efd418db993bad9435517e826ce86fae2329dd8202b262a712f7bc724e + languageName: node + linkType: hard + "@typescript-eslint/type-utils@npm:7.18.0": version: 7.18.0 resolution: "@typescript-eslint/type-utils@npm:7.18.0" @@ -5077,6 +5093,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/types@npm:8.7.0" + checksum: 4f1a625c1460649fc21a330fc9dde81d47a20b46bca3de60d50653a1d6c082bd419af1c7c7dde6be800416116f3d63734f9faa6629bdd9f3a8e6bba3a92a4e82 + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:5.62.0": version: 5.62.0 resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" @@ -5171,6 +5194,25 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/typescript-estree@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.7.0" + dependencies: + "@typescript-eslint/types": 8.7.0 + "@typescript-eslint/visitor-keys": 8.7.0 + debug: ^4.3.4 + fast-glob: ^3.3.2 + is-glob: ^4.0.3 + minimatch: ^9.0.4 + semver: ^7.6.0 + ts-api-utils: ^1.3.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: f1a2d53640bb47a293ef6fa2102e2d9a53f52e3c88682d65fd17133ae90cae327aeacdc582a8a23e576a48b104151021b50b4e4f8fe4c14d1fec49d52a823bd1 + languageName: node + linkType: hard + "@typescript-eslint/utils@npm:7.18.0": version: 7.18.0 resolution: "@typescript-eslint/utils@npm:7.18.0" @@ -5284,6 +5326,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.7.0" + dependencies: + "@typescript-eslint/types": 8.7.0 + eslint-visitor-keys: ^3.4.3 + checksum: 072d3d4e7ff8da51a0a37d057d6ca0895c163d480e77329de50e2a7a057acc8d6552f7d18f1fd87cb326d709fe4b667b2ed5cb968d307f92a3e12825cf65b9cd + languageName: node + linkType: hard + "@ungap/structured-clone@npm:^1.0.0, @ungap/structured-clone@npm:^1.2.0": version: 1.2.0 resolution: "@ungap/structured-clone@npm:1.2.0" @@ -13475,15 +13527,15 @@ __metadata: languageName: node linkType: hard -"msw@npm:^2.3.1": - version: 2.4.4 - resolution: "msw@npm:2.4.4" +"msw@npm:^2.4.9": + version: 2.4.9 + resolution: "msw@npm:2.4.9" dependencies: "@bundled-es-modules/cookie": ^2.0.0 "@bundled-es-modules/statuses": ^1.0.1 "@bundled-es-modules/tough-cookie": ^0.1.6 "@inquirer/confirm": ^3.0.0 - "@mswjs/interceptors": ^0.35.0 + "@mswjs/interceptors": ^0.35.8 "@open-draft/until": ^2.1.0 "@types/cookie": ^0.6.0 "@types/statuses": ^2.0.4 @@ -13492,7 +13544,7 @@ __metadata: headers-polyfill: ^4.0.2 is-node-process: ^1.2.0 outvariant: ^1.4.2 - path-to-regexp: ^6.2.0 + path-to-regexp: ^6.3.0 strict-event-emitter: ^0.5.1 type-fest: ^4.9.0 yargs: ^17.7.2 @@ -13503,7 +13555,7 @@ __metadata: optional: true bin: msw: cli/index.js - checksum: 9942c90ffe16bab04d7833f714726b84f4be8f7b1f92814a377bc973c153f303aaef6d30f824d6da8f034904b3abd3174655b4eea817dc86a6c8cebd058d15e5 + checksum: add5a614ce58f5e75c65afcb59b76d0d807b9103b7fb3aaf23efd6ebd82d79415ecd9bc55dd48bcc4c31ec7ce196a75ace46d94224f0a80567c89a190e367ba8 languageName: node linkType: hard @@ -13577,7 +13629,7 @@ __metadata: "@storybook/testing-library": ^0.2.2 "@testing-library/dom": ^10.0.0 "@testing-library/jest-dom": ^6.4.8 - "@testing-library/react": ^14.1.2 + "@testing-library/react": ^16.0.1 "@testing-library/user-event": ^14.5.1 "@types/jest": ^29.5.12 "@types/lodash": ^4.17.7 @@ -13587,7 +13639,7 @@ __metadata: "@types/react-gtm-module": ^2.0.3 "@types/uuid": ^9.0.7 "@typescript-eslint/eslint-plugin": ^7.16.1 - "@typescript-eslint/parser": ^8.2.0 + "@typescript-eslint/parser": ^8.7.0 axe-core: ^4.10.0 axios: ^1.6.3 chalk: ^5.3.0 @@ -13621,7 +13673,7 @@ __metadata: lint-staged: ^15.2.2 lodash: ^4.17.21 mq-polyfill: ^1.1.8 - msw: ^2.3.1 + msw: ^2.4.9 next: ^14.2.5 next-drupal: ^1.6.0 next-drupal-query: ^0.4.0 @@ -14870,10 +14922,10 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:^6.2.0": - version: 6.2.2 - resolution: "path-to-regexp@npm:6.2.2" - checksum: b7b0005c36f5099f9ed1fb20a820d2e4ed1297ffe683ea1d678f5e976eb9544f01debb281369dabdc26da82e6453901bf71acf2c7ed14b9243536c2a45286c33 +"path-to-regexp@npm:^6.3.0": + version: 6.3.0 + resolution: "path-to-regexp@npm:6.3.0" + checksum: eca78602e6434a1b6799d511d375ec044e8d7e28f5a48aa5c28d57d8152fb52f3fc62fb1cfc5dfa2198e1f041c2a82ed14043d75740a2fe60e91b5089a153250 languageName: node linkType: hard