Skip to content

ci: gate deploy on tests, and stop deploying into a torn-down environment - #1

Merged
konradkelly merged 2 commits into
mainfrom
ci/gate-deploy-on-tests
Aug 13, 2026
Merged

konradkelly merged 2 commits into
mainfrom
ci/gate-deploy-on-tests

Conversation

@konradkelly

Copy link
Copy Markdown
Owner

Two CI/CD defects, both of which fail silently rather than loudly.

1. Deploy was not gated on tests

run-tests.yml and deploy.yml both triggered on push to main as
independent workflows with nothing linking them, and deploy.yml ran
mvn -B package -DskipTests. A commit that broke every test in the project
deployed to production anyway.

Extracts the unit and integration jobs into a reusable _ci.yml
(on: workflow_call) and has both callers depend on it:

  • run-tests.yml calls it on push/PR for fast feedback
  • deploy.yml calls it as a ci job, with deploy-backend declaring needs: ci

Any job added to _ci.yml becomes deploy-gating with no further edits.
-DskipTests on the deploy build is now correct rather than unsafe, since
ci has already run the full suite against the same commit.

2. Deploy targeted infrastructure that no longer exists

The ECS cluster, service, ECR repository and RDS instance are all gone —
checked across us-east-1, us-east-2 and us-west-2: no clusters, no
repositories, no ACTIVE task definition families. Last successful deploy was
2026-06-18.

With no path filter on the trigger, every future commit to main would fail
at the ECR push step and leave a permanent red mark on the default branch for
an entirely expected reason.

Switched to workflow_dispatch only, with the restore procedure documented
inline. The pipeline is otherwise unchanged and still gated on needs: ci, so
it stays reviewable rather than being deleted.

Note on required status checks

Reusable workflows change how checks are named — Unit Tests becomes
ci / Unit Tests. If branch protection on main pins the old names, they
need updating or the branch will look permanently unsatisfied.

run-tests.yml and deploy.yml both triggered on push to main as independent
workflows with nothing linking them, and deploy.yml ran `mvn package
-DskipTests`. A commit that broke every test in the project deployed to
production anyway.

Extract the unit and integration jobs into a reusable _ci.yml
(on: workflow_call), mirroring the pattern already used in PugetScope, and
have both callers depend on it:

- run-tests.yml calls it on push/PR for fast feedback
- deploy.yml calls it as a `ci` job, with deploy-backend declaring `needs: ci`

Any job added to _ci.yml becomes deploy-gating with no further edits to
deploy.yml. -DskipTests on the deploy build is now correct rather than unsafe,
since ci has already run the full suite against the same commit. Also adds
job timeouts.

Note: reusable workflows change status check names (`Unit Tests` becomes
`ci / Unit Tests`), so required checks in branch protection need updating.

Also adds docs/IMPROVEMENT_SPEC.md covering the remaining polish work:
repository presentation, package structure, container image size, and
supply-chain scanning.
The ECS cluster, service, ECR repository and RDS instance this workflow
deploys into no longer exist — verified with the AWS CLI across us-east-1,
us-east-2 and us-west-2: no clusters, no repositories, no ACTIVE task
definition families. The last successful deploy was 2026-06-18.

Left triggering on push to main, every subsequent commit would fail at the
ECR push step and leave a permanent red mark on the default branch for a
completely expected reason.

Switches the trigger to workflow_dispatch only and documents what to do to
bring it back: terraform apply, set the repo variables from its outputs, run
it from the Actions tab. The pipeline itself is unchanged and still gated on
`needs: ci`, so it stays reviewable as a working example rather than being
deleted.
@konradkelly
konradkelly merged commit 0f87fcc into main Aug 13, 2026
2 checks passed
@konradkelly
konradkelly deleted the ci/gate-deploy-on-tests branch August 13, 2026 06:48
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