Skip to content

feat(contributor): add pr_numbers field to RemoteContributor#1546

Open
arieleli01212 wants to merge 5 commits into
orhun:mainfrom
arieleli01212:support-pr-numbers-for-contributors
Open

feat(contributor): add pr_numbers field to RemoteContributor#1546
arieleli01212 wants to merge 5 commits into
orhun:mainfrom
arieleli01212:support-pr-numbers-for-contributors

Conversation

@arieleli01212

Copy link
Copy Markdown

Closes #1326

Adds a pr_numbers: Vec<i64> field to RemoteContributor that 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:

{% for contributor in contributors %}
- {{ contributor.username }} ({% for n in contributor.pr_numbers %}#{{ n }}{% if not loop.last %}, {% endif %}{% endfor %})
{% endfor %}

Changes:

  • RemoteContributor: new pr_numbers: Vec<i64> field
  • remote/mod.rs: accumulate PR numbers per contributor instead of skipping duplicates; sort ascending after collecting
  • Tests updated with correct expected pr_numbers values for all five remote providers

…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.
@arieleli01212 arieleli01212 requested a review from orhun as a code owner May 28, 2026 03:42
@welcome

welcome Bot commented May 28, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️

@codecov-commenter

codecov-commenter commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.76%. Comparing base (772e01d) to head (4717578).

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     
Flag Coverage Δ
unit-tests 48.76% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Support multiple PR numbers for first-time contributors

3 participants