Skip to content

Support for GitHub-style release notes#1904

Merged
dbanty merged 10 commits into
mainfrom
gh-release-notes
May 24, 2026
Merged

Support for GitHub-style release notes#1904
dbanty merged 10 commits into
mainfrom
gh-release-notes

Conversation

@dbanty

@dbanty dbanty commented May 3, 2026

Copy link
Copy Markdown
Member

Continuation/rebase of #1804

TODO:

  • Add integration test
  • Add backoff/retry for rate limits. Add logging when being limited
  • Set up a max parallel in-flight request Stay sequential since GitHub's docs ask us to
  • Allow for attempting lookup with no token in case repo is public. Add suggestion to configure token if being rate limited

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 3, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
knope-docs f37184d Commit Preview URL

Branch Preview URL
May 24 2026, 07:05 PM

@dbanty dbanty force-pushed the gh-release-notes branch 3 times, most recently from ae7deb3 to 661ac7f Compare May 3, 2026 20:03
@dbanty dbanty force-pushed the gh-release-notes branch from 661ac7f to dc8bc79 Compare May 3, 2026 20:16
@dbanty

dbanty commented May 3, 2026

Copy link
Copy Markdown
Member Author

Added an integration test and manually ran it, works great!

@dbanty dbanty had a problem deploying to integration-tests May 23, 2026 18:18 — with GitHub Actions Failure
@dbanty dbanty temporarily deployed to integration-tests May 23, 2026 18:18 — with GitHub Actions Inactive
@dbanty dbanty had a problem deploying to integration-tests May 23, 2026 18:18 — with GitHub Actions Failure
@dbanty dbanty had a problem deploying to integration-tests May 23, 2026 18:18 — with GitHub Actions Error
@dbanty dbanty had a problem deploying to integration-tests May 23, 2026 18:18 — with GitHub Actions Error
@dbanty dbanty temporarily deployed to integration-tests May 23, 2026 18:18 — with GitHub Actions Inactive
@dbanty

dbanty commented May 23, 2026

Copy link
Copy Markdown
Member Author

@copilot will you revert the last commit? Let's just stick with sequential calls.

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
Contributor

@copilot will you revert the last commit? Let's just stick with sequential calls.

Done — I reverted the last commit so PR info lookup is sequential again in commit a1f59b5.

Copilot finished work on behalf of dbanty May 23, 2026 22:53
@dbanty

dbanty commented May 23, 2026

Copy link
Copy Markdown
Member Author

@copilot now please add reessaie and reqwest-middleware to the client so it backoff/retrys with retry-after support. Make sure to log a warning when we're being rate limited which says how long until retry

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
Contributor

@copilot now please add reessaie and reqwest-middleware to the client so it backoff/retrys with retry-after support. Make sure to log a warning when we're being rate limited which says how long until ...

Implemented in 98e40a1: PR info lookups now use reqwest-middleware + reessaie with Retry-After-aware retries/backoff, and we emit a warning when rate limited that includes the retry delay in seconds.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.rs
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of dbanty May 23, 2026 23:07
@dbanty

dbanty commented May 23, 2026

Copy link
Copy Markdown
Member Author

@copilot this should be in the shared http client / reponse handler, also we already have time, don't add chrono

Copilot AI commented May 24, 2026

Copy link
Copy Markdown
Contributor

@copilot this should be in the shared http client / reponse handler, also we already have time, don't add chrono

Done in 10bf43f. I moved the retry/backoff + rate-limit warning into the shared HTTP integration (integrations/http.rs) and switched Retry-After date parsing to the existing time crate, removing the direct chrono dependency.

Copilot finished work on behalf of dbanty May 24, 2026 00:06
@dbanty

dbanty commented May 24, 2026

Copy link
Copy Markdown
Member Author

@copilot there's no reason to make a separate path, we can just retry all requests with those standard responses/headers. Also, move time back to where it was in Cargo.toml, alphabetical

Copilot AI commented May 24, 2026

Copy link
Copy Markdown
Contributor

@copilot there's no reason to make a separate path, we can just retry all requests with those standard responses/headers. Also, move time back to where it was in Cargo.toml, alphabetical

Done in 7827635. The shared http_client() now builds a retry-enabled middleware client used everywhere, so there’s no separate retry path anymore; handle_response is unified, and time was moved back to its prior spot in Cargo.toml (alphabetical in dev-dependencies). No UI changes in this update.

Copilot finished work on behalf of dbanty May 24, 2026 03:11
@dbanty dbanty force-pushed the gh-release-notes branch from 62f2843 to 0e4adc2 Compare May 24, 2026 17:27
@dbanty dbanty had a problem deploying to integration-tests May 24, 2026 17:27 — with GitHub Actions Error
@dbanty dbanty had a problem deploying to integration-tests May 24, 2026 17:27 — with GitHub Actions Error
@dbanty dbanty temporarily deployed to integration-tests May 24, 2026 17:27 — with GitHub Actions Inactive
@dbanty dbanty had a problem deploying to integration-tests May 24, 2026 17:27 — with GitHub Actions Failure
@dbanty dbanty had a problem deploying to integration-tests May 24, 2026 17:27 — with GitHub Actions Failure
@dbanty dbanty temporarily deployed to integration-tests May 24, 2026 17:27 — with GitHub Actions Inactive
@dbanty dbanty force-pushed the gh-release-notes branch from 0e4adc2 to 76cc826 Compare May 24, 2026 17:53

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

This PR adds opt-in support for generating GitHub-style release note entries (e.g. * Add dark mode by @user in #42) by enriching collected changes with GitHub PR metadata during PrepareRelease, with retry/backoff for rate limits and accompanying documentation + tests.

Changes:

  • Add $pr_number and $commit_author_login template variables and detect when templates require forge/API enrichment.
  • Implement GitHub API enrichment for changes (plus centralized HTTP client retry/backoff & rate-limit logging).
  • Update docs/recipes and add/extend integration tests and changesets.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
docs/src/content/docs/reference/Config File/release-notes.mdx Document new GitHub-backed template variables and token/rate-limit behavior.
docs/src/content/docs/recipes/customizing-release-notes.mdx Add “GitHub-style release notes” recipe and minor wording tweak.
deny.toml Update cargo-deny skip-tree entries for getrandom versions with reasons.
crates/knope/tests/integration_helpers.rs Simplify git push helper used by integration tests.
crates/knope/tests/integration_github/mod.rs Add ignored integration test covering PR creation + enrichment path; add gh presence check.
crates/knope/src/step/releases/package.rs Refactor to split “gather changes” vs “apply release” so enrichment can happen between.
crates/knope/src/step/releases/mod.rs Make prepare_release async and call GitHub enrichment when templates require forge data.
crates/knope/src/step/mod.rs Await async PrepareRelease step execution.
crates/knope/src/step/issues/jira.rs Switch Jira HTTP errors to shared middleware error type; improve JSON-deserialize error reporting.
crates/knope/src/step/issues/github.rs Rework GitHub issue listing to use new GitHub state authentication helper.
crates/knope/src/state.rs Expand GitHub state to authenticated/unauthenticated and add auth helper methods; move to shared HTTP client type.
crates/knope/src/integrations/http.rs Introduce reqwest-middleware + Retry-After/backoff with rate-limit logging; update shared response handling.
crates/knope/src/integrations/github/pr_info.rs New GitHub enrichment implementation to populate PR number and login per commit.
crates/knope/src/integrations/github/mod.rs Re-export enrichment helper; remove old GitHub state initializer.
crates/knope/src/integrations/github/create_release.rs Migrate to new GitHub state/auth + shared HTTP middleware client.
crates/knope/src/integrations/github/create_pull_request.rs Migrate to new GitHub state/auth + shared HTTP middleware client.
crates/knope/src/integrations/gitea/mod.rs Update to new shared http_client(None) signature.
crates/knope/src/integrations/git.rs Initialize new GitInfo enrichment fields to None.
crates/knope/src/app_config.rs Add non-prompt GitHub token lookup; refactor config dir/value loading helpers.
crates/knope/Cargo.toml Add reqwest-middleware and reessaie dependencies for retry/backoff support.
crates/knope-versioning/src/release_notes/mod.rs Add forge-data detection and render new template variables; add unit tests.
crates/knope-versioning/src/changes/mod.rs Extend GitInfo with pr_number and author_login enrichment fields.
Cargo.lock Lockfile updates for new dependencies and transitive changes.
.changeset/retry_rate_limited_requests_to_github.md Changeset for retrying rate-limited GitHub requests.
.changeset/commit_author_login_and_pr_number_are_now_reserved_strings_in_change_templates.md Changeset for reserved template variables (contains a typo).
.changeset/add_commit_author_login_and_pr_number_change_template_variables.md Changeset announcing new template variables and GitHub-only support.

Comment thread crates/knope/src/step/releases/mod.rs Outdated
Comment thread crates/knope/src/step/releases/mod.rs Outdated
Comment thread crates/knope/src/integrations/github/pr_info.rs Outdated
Comment thread crates/knope/src/integrations/github/pr_info.rs
Comment thread crates/knope/src/integrations/github/pr_info.rs
Comment thread crates/knope/src/state.rs Outdated
Comment thread crates/knope/src/app_config.rs
Comment thread crates/knope/tests/integration_helpers.rs
@dbanty dbanty force-pushed the gh-release-notes branch from 6dcf65e to ffc54aa Compare May 24, 2026 18:57
@dbanty dbanty merged commit 9670f32 into main May 24, 2026
6 checks passed
@dbanty dbanty deleted the gh-release-notes branch May 24, 2026 19:09
@dbanty

dbanty commented May 24, 2026

Copy link
Copy Markdown
Member Author

Merged! FYI @DaleSeo I renamed $commit_author_login to $pr_author_login since the PR author we get from the API might not have been the author of the specific commit.

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.

4 participants