draft-release: handle first-release repos and fail fast on required files#179
draft-release: handle first-release repos and fail fast on required files#179Copilot wants to merge 8 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #179 +/- ##
==========================================
- Coverage 94.43% 94.19% -0.25%
==========================================
Files 11 11
Lines 557 568 +11
==========================================
+ Hits 526 535 +9
- Misses 31 33 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the draft-release composite action and supporting Python helpers/tests to support repositories with no prior release history and to fail early with actionable errors when required release artifacts are missing.
Changes:
- Add fail-fast validation for required release files (CHANGELOG, VERSION/DESCRIPTION, CITATION) in
prepare_draft_release(). - Support “first release” scenarios where the semver step returns blank
current_version, and require an explicit manualversion-tagwhen no next version can be derived. - Update the composite action, docs, and tests to align with first-release behavior and required-file expectations.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/ccbr_actions/release.py |
Adds required-file validation and first-release version/changelog handling changes |
tests/test_release.py |
Adds/updates tests for first-release version resolution, required-file failures, and changelog extraction |
draft-release/action.yml |
Allows the semver discovery step to fail without stopping the workflow (first-release support) |
draft-release/README.md / draft-release/README.qmd |
Documents first-release version-tag usage and required input files |
| for version in [latest_version_strict, next_version_strict]: | ||
| if not version: | ||
| continue | ||
| if not match_semver(version): |
There was a problem hiding this comment.
Fixed in the latest commits. get_changelog_lines() now raises ValueError immediately when next_version_strict is blank, while a blank latest_version_strict is still allowed. I also restructured the semver checks to avoid the now-redundant loop/skip pattern.
fixes #37
draft-releasefailed on repositories with no prior releases because version discovery could return blank values, and required file checks were not explicit. This update adds a first-release path and immediate, actionable failures for missing release artifacts.Version resolution for first release
get_release_version()now handles blankcurrent_versionas a valid first-release case.version-tag.Fail-fast required file validation
prepare_draft_release()now explicitly validates required files (CHANGELOG,VERSION,CITATION) up front.FileNotFoundErrorwith file-specific guidance instead of failing later in the flow.No-release-history workflow behavior
draft-release/action.ymlnow marks the semver step withcontinue-on-error: trueso first-release repos can proceed when no prior release metadata exists.Docs and release tests alignment
version-tagusage and required file expectations.