Skip to content

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

Open
kelly-sovacool with Copilot wants to merge 13 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
kelly-sovacool with Copilot wants to merge 13 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 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.52%. Comparing base (51aec38) to head (ee2d5b7).

Files with missing lines Patch % Lines
src/ccbr_actions/release.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #179      +/-   ##
==========================================
- Coverage   97.81%   97.52%   -0.29%     
==========================================
  Files          11       11              
  Lines         595      607      +12     
==========================================
+ Hits          582      592      +10     
- Misses         13       15       +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
@kelly-sovacool kelly-sovacool marked this pull request as ready for review June 29, 2026 15:40
@kelly-sovacool

Copy link
Copy Markdown
Member

@copilot ensure that these changes will also work for R package repos, which use NEWS.md instead of CHANGELOG.md and have the version in DESCRIPTION instead of VERSION.

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot ensure that these changes will also work for R package repos, which use NEWS.md instead of CHANGELOG.md and have the version in DESCRIPTION instead of VERSION.

Added in the latest commit. Two new tests cover the R package paths introduced by this PR:

  • test_prepare_draft_release_r_package_missing_news – verifies that a missing NEWS.md raises FileNotFoundError with a clear message naming the file.
  • test_prepare_draft_release_r_package_first_release – verifies the first-release path (current_version="") works end-to-end for R packages using NEWS.md and DESCRIPTION.

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