Skip to content

draft-release: handle first-release repos and fail fast on required files#179

Open
Copilot wants to merge 8 commits into
mainfrom
copilot/ccbr-37-allow-draft-release-handle-first-release
Open

draft-release: handle first-release repos and fail fast on required files#179
Copilot wants to merge 8 commits into
mainfrom
copilot/ccbr-37-allow-draft-release-handle-first-release

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

fixes #37

draft-release failed 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 blank current_version as a valid first-release case.
    • If no next version can be derived, it raises a clear error instructing maintainers to provide version-tag.
  • Fail-fast required file validation

    • prepare_draft_release() now explicitly validates required files (CHANGELOG, VERSION, CITATION) up front.
    • Missing files now produce a FileNotFoundError with file-specific guidance instead of failing later in the flow.
  • No-release-history workflow behavior

    • draft-release/action.yml now marks the semver step with continue-on-error: true so first-release repos can proceed when no prior release metadata exists.
  • Docs and release tests alignment

    • Draft-release docs now call out first-release version-tag usage and required file expectations.
    • Release tests were updated/added for blank current version, missing manual version, missing required files, and first-release changelog extraction behavior.
- name: Get current and next versions
  id: semver
  uses: ietf-tools/semver-action@v1
  continue-on-error: true

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.19%. Comparing base (57be4d2) to head (5415d76).

Files with missing lines Patch % Lines
src/ccbr_actions/release.py 92.85% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI changed the title [WIP] Add support for draft-release to handle first release cases draft-release: handle first-release repos and fail fast on required files Jun 16, 2026
Copilot AI requested a review from kelly-sovacool June 16, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 manual version-tag when 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

Comment thread src/ccbr_actions/release.py Outdated
Comment on lines 580 to 583
for version in [latest_version_strict, next_version_strict]:
if not version:
continue
if not match_semver(version):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@kelly-sovacool kelly-sovacool marked this pull request as ready for review June 29, 2026 15: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.

allow draft-release to handle first release from a repo

3 participants