Context
Three sibling plugins want to implement contributor-recognition features that are otherwise identical in spirit:
- generator-changelog-html#26
- generator-changelog-md#34
- generator-release-notes#27
All three need per-commit author identity and whether that author is a first-time contributor to the repo, plus enough data to compute a 'Release MVP' (author with the most commits/PRs in the release window).
Problem
Today SEMREL_COMMITS only carries an array of raw commit message strings (see internal/cli/root.go). There is no author name/email/contribution-history data available to any plugin, so each generator would have to invent its own (inconsistent, likely wrong) heuristic — or shell out to git itself, which most plugins can't do since they only receive env vars.
Goal
Add a core contract, e.g. a new SEMREL_CONTRIBUTORS env var (JSON), populated by semrel core before invoking generator/hook plugins:
[
{"name": "Jane Doe", "email": "jane@example.com", "commits": 3, "firstContribution": true}
]
firstContribution computed from full repo history (first commit by that email/author ever, not just in this release window)
- Sorted or annotated so plugins can trivially derive 'Release MVP' (most commits/PRs this release)
- Documented in the plugin protocol docs (semrel-docs) and schema (
schema/v1.json)
Why core, not per-plugin
Doing this per-plugin means 3+ different heuristics and env var names. A single, well-defined contract lets every generator/hook plugin (changelog-md, changelog-html, release-notes, slack, teams, matrix, email hooks) opt into consistent 'first-time contributor' and 'Release MVP' recognition with a single implementation investment.
Related
Blocks: generator-changelog-html#26, generator-changelog-md#34, generator-release-notes#27
Context
Three sibling plugins want to implement contributor-recognition features that are otherwise identical in spirit:
All three need per-commit author identity and whether that author is a first-time contributor to the repo, plus enough data to compute a 'Release MVP' (author with the most commits/PRs in the release window).
Problem
Today
SEMREL_COMMITSonly carries an array of raw commit message strings (seeinternal/cli/root.go). There is no author name/email/contribution-history data available to any plugin, so each generator would have to invent its own (inconsistent, likely wrong) heuristic — or shell out to git itself, which most plugins can't do since they only receive env vars.Goal
Add a core contract, e.g. a new
SEMREL_CONTRIBUTORSenv var (JSON), populated by semrel core before invoking generator/hook plugins:[ {"name": "Jane Doe", "email": "jane@example.com", "commits": 3, "firstContribution": true} ]firstContributioncomputed from full repo history (first commit by that email/author ever, not just in this release window)schema/v1.json)Why core, not per-plugin
Doing this per-plugin means 3+ different heuristics and env var names. A single, well-defined contract lets every generator/hook plugin (changelog-md, changelog-html, release-notes, slack, teams, matrix, email hooks) opt into consistent 'first-time contributor' and 'Release MVP' recognition with a single implementation investment.
Related
Blocks: generator-changelog-html#26, generator-changelog-md#34, generator-release-notes#27