Repository navigation
ci: gate deploy on tests, and stop deploying into a torn-down environment - #1
Merged
Merged
Conversation
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.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two CI/CD defects, both of which fail silently rather than loudly.
1. Deploy was not gated on tests
run-tests.ymlanddeploy.ymlboth triggered on push tomainasindependent workflows with nothing linking them, and
deploy.ymlranmvn -B package -DskipTests. A commit that broke every test in the projectdeployed 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.ymlcalls it on push/PR for fast feedbackdeploy.ymlcalls it as acijob, withdeploy-backenddeclaringneeds: ciAny job added to
_ci.ymlbecomes deploy-gating with no further edits.-DskipTestson the deploy build is now correct rather than unsafe, sincecihas 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
mainwould failat the ECR push step and leave a permanent red mark on the default branch for
an entirely expected reason.
Switched to
workflow_dispatchonly, with the restore procedure documentedinline. The pipeline is otherwise unchanged and still gated on
needs: ci, soit stays reviewable rather than being deleted.
Note on required status checks
Reusable workflows change how checks are named —
Unit Testsbecomesci / Unit Tests. If branch protection onmainpins the old names, theyneed updating or the branch will look permanently unsatisfied.