Fix draft release lookup#5000
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub release workflow to detect live publication state via release IDs (instead of the tag endpoint), and adds a regression test to ensure the workflow uses the new ID-based lookup and validates tag consistency.
Changes:
- Switch “Detect live publication state” to fetch
repos/.../releases/$RELEASE_IDselected from workflow outputs, and verifytag_namematches the requested version. - Fail closed when the workflow lacks a release ID for the current state or when the fetched release tag mismatches the requested version.
- Add a regression test to ensure the workflow uses release IDs and includes expected guardrails/messages.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/release.yml |
Selects a release ID (draft vs published) and queries releases/{id}; validates tag_name before checking draft/immutable state. |
tests/scripts/test_release_workflow.py |
Adds a workflow-structure regression test and a YAML helper to extract a step’s run script. |
Comment on lines
+398
to
+402
| assert 'gh api "repos/$GITHUB_REPOSITORY/releases/tags/$VERSION"' not in publication_step | ||
| assert 'gh api "repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID"' in publication_step | ||
| assert 'case "$RELEASE_STATE" in' in publication_step | ||
| assert "Missing release id for $RELEASE_STATE release $VERSION" in publication_step | ||
| assert "tag_name" in publication_step |
Member
Author
There was a problem hiding this comment.
Added the new case assertion as well, so the regression test covers the first-time release path.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
What does this implement/fix?
Use release IDs for live publication detection so draft releases do not hit the tag endpoint.
Related issue (if applicable):
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.