Skip to content

ci: Restrict release workflow to master branch builds and fix broken tests#325

Open
dividedmind wants to merge 6 commits intomasterfrom
ci/dont-dispatch-release-on-feature-branches
Open

ci: Restrict release workflow to master branch builds and fix broken tests#325
dividedmind wants to merge 6 commits intomasterfrom
ci/dont-dispatch-release-on-feature-branches

Conversation

@dividedmind
Copy link
Copy Markdown
Contributor

@dividedmind dividedmind commented Apr 2, 2026

Previously, the release workflow triggered on every "Build and test" run regardless of branch. Although a job-level condition prevented actual releases, the workflow still ran and prompted admin approval due to its access to signing and publishing secrets.

Added a branches filter to the workflow_run trigger so the workflow is never queued for feature branch builds, and removed the now-redundant head_branch check from the job condition.

In addition, I noticed that release always ran against current master, instead of the revision that actually passed tests; this is fixed now.

Also, I discovered a few issues with our integration tests that failed due to upstream project changes. These have now been fixed.

Previously, the release workflow triggered on every "Build and test" run
regardless of branch. Although a job-level condition prevented actual
releases, the workflow still ran and prompted admin approval due to its
access to signing and publishing secrets.

Added a branches filter to the workflow_run trigger so the workflow is
never queued for feature branch builds, and removed the now-redundant
head_branch check from the job condition.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the release GitHub Actions workflow so it only triggers from successful “Build and test” runs on the master branch, preventing the release workflow from being queued (and requesting elevated approvals/secrets) for feature-branch builds.

Changes:

  • Added a branches: [master] filter to the workflow_run trigger.
  • Simplified the release job condition by removing the redundant head_branch == 'master' check.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When triggered by workflow_run, actions/checkout defaults to the HEAD
of the default branch at the time the workflow starts, not the commit
that triggered the parent workflow. This creates a race window where a
commit that hasn't been tested could be released if new commits land on
master between CI completing and the release workflow starting.

Pin the checkout to github.event.workflow_run.head_sha when triggered
by workflow_run so the release always runs against the tested commit.
The ref is left empty for workflow_dispatch, preserving the default
behavior of checking out the dispatched ref.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dividedmind dividedmind changed the title ci: Restrict release workflow to master branch builds ci: Restrict release workflow to master branch builds and fix a broken test Apr 2, 2026
@dividedmind dividedmind force-pushed the ci/dont-dispatch-release-on-feature-branches branch from 5f9410d to 6b4e2be Compare April 2, 2026 17:18
@dividedmind dividedmind changed the title ci: Restrict release workflow to master branch builds and fix a broken test ci: Restrict release workflow to master branch builds and fix broken tests Apr 2, 2026
Updated GitHub Actions to their latest major versions across
all workflows to keep the CI environment up-to-date and secure:
- actions/checkout to v6
- actions/setup-java to v5
- actions/upload-artifact to v6
- actions/download-artifact to v8
- gradle/actions/setup-gradle to v5

Configuration parameters remain compatible with the new versions.
The upstream spring-framework-petclinic project changed Jackson
coordinates from com.fasterxml.jackson to tools.jackson.core,
breaking our custom ShowAvailable controller in petclinic-fw tests.

Replaced ObjectMapper with manual JSON formatting and removed the
now-unused Result inner class, making the test fixture resilient
to upstream dependency changes.
Upstream now requires Java 21.
The upstream spring-petclinic project renamed the `testOwnerDetails`
test method to `ownerDetails` and changed the log level of some
statements from INFO to DEBUG.

- Updated `petclinic-tests.bats` to support both test method names
  by using wildcards/regex.
- Expanded the log label assertion to match both `info` and `debug`
  functions.
- Wrapped the jq log label extraction in `first()` to prevent multiple
  matches from causing the `assert_json_eq` to fail with multiple lines.
@dividedmind dividedmind force-pushed the ci/dont-dispatch-release-on-feature-branches branch from 6b4e2be to 6dd4744 Compare April 2, 2026 17:40
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.

2 participants