Skip to content

feat: migrate backend CI, docs deploy, release-please, composites from appdev - #135

Draft
sdh100shaun wants to merge 1 commit into
mainfrom
feat/migrate-from-appdev-github-actions
Draft

sdh100shaun wants to merge 1 commit into
mainfrom
feat/migrate-from-appdev-github-actions

Conversation

@sdh100shaun

Copy link
Copy Markdown
Contributor

Summary

Workstream A of the RFC-001 consolidation (dvsa/dvsa-software-development#3). Makes dvsa/.github the single canonical source for DVSA reusable workflows by migrating what was duplicated in dvsa/appdev-github-actions, plus adds a central template for the 4-environment × 2-account deploy pattern.

Additive only — no existing workflow in this repo changes callers' behaviour.

What's added

Reusable workflows (.github/workflows/)

File Purpose
ci-backend.yaml Bundled TS-compile + build + lint + test:coverage + artifact upload. Uses the central install-deps composite. 15-min timeout. Emits a coverage table to GITHUB_STEP_SUMMARY. Biome's --reporter=github surfaces lint findings as inline PR annotations. New artifact-name input/output lets callers pin a stable artifact name for cross-run deploys.
deploy-docs.yaml Docusaurus GH Pages build + deploy, with configurable working-directory and build-command.
release-please-call.yaml workflow_call variant of release-please so downstream ci.yml/cd.yml can orchestrate releases from any branch. The existing push-triggered release-please.yaml is untouched.
deploy-serverless.yaml The canonical 4-env (dev/int/prep/prod) deploy template. Uses GitHub Environment protection + env-scoped vars (AWS_ACCOUNT_ID, AWS_DEPLOY_ROLE, AWS_REGION) + OIDC via the existing aws-auth composite. Accepts a deploy-command input so services can use Serverless Framework, CDK, Terraform, or the raw AWS CLI without a bespoke workflow. Supports cross-run artifact download via the new artifact-run-id input + actions: read permission so a CD workflow triggered by workflow_run can fetch the zip produced in the preceding CI run.

Composite actions (.github/actions/)

Dir Purpose
notify-teams/ Microsoft Teams webhook notifier. Adaptive Card payload is now built entirely via jq --arg so every input is JSON-escaped at the string boundary — no interpolation into the template body, no injection via newlines/quotes in inputs. Conditional branches for optional information / qr-link / ipa-link inputs.
check-s3/ S3 existence check (renamed from `check_s3` for consistency). JMESPath filter is built via `jq --arg

Hardening of existing content

  • `nodejs-security.yaml`: Snyk pin bumped from `@master` to `@v1`; added `timeout-minutes: 10`; fixed "Synk" → "Snyk" typo.
  • `conventional-commits.yaml`: added `timeout-minutes: 5`.
  • `aws-cli/`: deprecated — see `.github/actions/aws-cli/DEPRECATED.md`. Removed the embedded `actions/checkout@v7` step. Input moved to `env: AWS_CLI_ARGS`, which closes the YAML-expansion injection class. Known grace-period regression: quoted arguments (`--bucket "my bucket"`) now word-split into literal quote characters; callers relying on quoted args should migrate to the recommended `aws-auth` + plain `run: aws …` replacement now rather than wait for the 180-day removal. The replacement for `aws-cli` + `assume-and-run-aws` is not another composite — it's `aws-auth` followed by an explicit `run:` step, which avoids the arbitrary-command-runner shape entirely.

Release / adoption

After merging, cut `v7.2.0` (release-please auto-moves the floating `v7` and `v7.2` tags). Then:

  • Workstream B (`dvsa/dvsa-serverless-starter`) adopts `@v7` references and ships the 4-env deploy guide.
  • Workstream C (`dvsa/appdev-github-actions`) adds deprecation warnings pointing here.

Test plan

  • Review each new workflow definition
  • Review each composite action for input handling (env-based, not expression-interpolated)
  • Verify the `jq` payload builder in `notify-teams` produces valid JSON for all input combinations (validated locally across empty/populated `information`, `qr-link`, `ipa-link`)
  • Verify the `jq | tojson` builder in `check-s3` produces a valid JMESPath query (validated locally: `Contents[?contains(Key, `"releases/v1.2.3/"`) && ends_with(Key, `".zip"`)].{Key:Key,LastModified:LastModified}`)
  • Open a sanity-check PR in a downstream service referencing `uses: dvsa/.github/.github/workflows/ci-backend.yaml@feat/migrate-from-appdev-github-actions` to confirm the end-to-end run succeeds before cutting `v7.2.0`
  • Cut the `v7.2.0` release so downstream `@v7` pins resolve to the new content

🤖 Generated with Claude Code

…m appdev

Workstream A of RFC-001 consolidation. Adds reusable workflows previously
hosted in dvsa/appdev-github-actions so dvsa/.github becomes the single
central source:

  - ci-backend.yaml   type-check, build, lint, test:coverage, artifact upload
                       Uses the central install-deps composite. 15-min timeout.
                       Emits a coverage table to the job summary and uses
                       Biome's --reporter=github for inline PR annotations.
  - deploy-docs.yaml  Docusaurus GH Pages build/deploy with configurable
                       working-directory and build command.
  - release-please-call.yaml
                       workflow_call variant of release-please so downstream
                       ci.yml/cd.yml can orchestrate it from any branch. The
                       existing push-triggered release-please.yaml is unchanged.
  - deploy-serverless.yaml
                       Canonical 4-env (dev/int/prep/prod) deploy template.
                       Uses GitHub Environment protection + env-scoped vars
                       (AWS_ACCOUNT_ID, AWS_DEPLOY_ROLE, AWS_REGION) + OIDC
                       via the existing aws-auth composite. Accepts any
                       deploy-command so services can use Serverless Framework,
                       CDK, or the AWS CLI.
  - actions/notify-teams
                       Migrated from appdev-github-actions (Teams webhook).
  - actions/check-s3   Migrated from appdev-github-actions (was check_s3;
                       renamed to kebab-case to match sibling composites).

Backs the consolidation outlined in dvsa/dvsa-software-development#3 (RFC-001).
appdev-github-actions workflows will be marked deprecated in a follow-up PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant