feat(contributor): add pr_numbers field to RemoteContributor#1546
Open
arieleli01212 wants to merge 5 commits into
Open
feat(contributor): add pr_numbers field to RemoteContributor#1546arieleli01212 wants to merge 5 commits into
arieleli01212 wants to merge 5 commits into
Conversation
…ching feature When a user's template references variables like `github.contributors` or `commit.gitlab` but the binary was compiled without the corresponding feature flag (`github`, `gitlab`, etc.), the rendering silently produces empty output with no indication of why. Add a `warn_if_remote_template_variables_without_feature` check in `Changelog::build` that emits a `tracing::warn` for each remote whose template variables are present but whose Cargo feature is absent. Fixes orhun#659
…abled The warn_if_remote_template_variables_without_feature function declared a `templates` Vec that was only accessed inside cfg-gated blocks. When all remote features are compiled in (the default build), every `#[cfg(not(feature = "..."))]` condition is false, so `templates` is never read — triggering an unused-variable error under `-D warnings`. Restructure: move the templates array construction inline inside each macro expansion. Each branch is self-contained and only compiled when the corresponding feature is absent, so there is no unused variable in any build configuration.
Track all PR numbers for a contributor within a single release in a new `pr_numbers: Vec<i64>` field, sorted in ascending order. The existing `pr_number` field is preserved for backward compatibility.
|
Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1546 +/- ##
==========================================
+ Coverage 48.65% 48.76% +0.11%
==========================================
Files 26 26
Lines 2288 2289 +1
==========================================
+ Hits 1113 1116 +3
+ Misses 1175 1173 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Closes #1326
Adds a
pr_numbers: Vec<i64>field toRemoteContributorthat collects all PR numbers for a given contributor across an entire release, sorted in ascending order (lowest PR number first).Previously, only the first PR a contributor appeared with was tracked. This change accumulates every PR number encountered for that contributor within the release window, so templates can reference the full list.
The existing
pr_number: Option<i64>field is kept as-is for backward compatibility.Example template usage:
Changes:
RemoteContributor: newpr_numbers: Vec<i64>fieldremote/mod.rs: accumulate PR numbers per contributor instead of skipping duplicates; sort ascending after collectingpr_numbersvalues for all five remote providers