Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Show new contributors in the changelog #893

Merged
merged 2 commits into from
Mar 26, 2024
Merged

Conversation

aborgna-q
Copy link
Collaborator

Imports part of the github template from git-cliff, so the changelog mentions the new contributors to the repo.
See https://git-cliff.org/docs/integration/github.

E.g.:

## Unreleased (XXXX-XX-XX)

New Contributors:

* @Cobord made their first contribution in [#889](https://github.com/CQCL/hugr/pull/889)
* @qartik made their first contribution in [#843](https://github.com/CQCL/hugr/pull/843)

…

@aborgna-q aborgna-q requested a review from croyzor March 25, 2024 17:05
cliff.toml Outdated
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/CQCL/portgraph/issues/${2}))"}, # replace issue numbers
]
commit_preprocessors = [{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }]
Copy link
Contributor

@croyzor croyzor Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this trying to achieve? It looks like it's trying to delete things of the form "fixes #123"? The thing it's replacing looks more sensible, but pointing to the wrong repo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is to strip all the prefixes which show the PR number from the commit title.I removed the replacement part since the cliff+github writes that link reading the metadata, which seems more robust than the hardcoded link.

As for how we where generating correct links in the changelog even though here it linked to portgraph, I'm not quite sure.
We don't call git-cliff directly, but use release-plz which does a lot of pre-processing and collects each relevant commit individually before generating the changelog delta programatically. It may be ignoring the commit_preprocessors section since it's not using git-cliff's CLI.

This config I submit here produces the correct result locally, but I'll have to review what gets generated by release-plz and submit a fix PR if needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at our commit log, it seems that \(#([0-9])+\) would do the job - we don't have any other text before the PR number

@aborgna-q aborgna-q added this pull request to the merge queue Mar 26, 2024
Merged via the queue into main with commit 25b1013 Mar 26, 2024
13 checks passed
@aborgna-q aborgna-q deleted the chore/better-changelog branch March 26, 2024 10:36
aborgna-q added a commit that referenced this pull request Mar 26, 2024
github-merge-queue bot pushed a commit that referenced this pull request Mar 26, 2024
Reverts #893 

It seems git-cliff's github extension is not yet supported by
release-plz >.<
See this PR: https://www.github.com/MarcoIeni/release-plz/pull/1305

I'll reopen the PR once this release-plz is updated.

This reverts commit 25b1013.
github-merge-queue bot pushed a commit that referenced this pull request Apr 4, 2024
With the rename of the crate from `hugr_quantinuum` to `hugr` (#914) we
broke `release-plz`' automatic changelog generation (since it cannot
find the crate anymore), and all links to crate-related urls.

This alpha release should fix those issues, in addition to letting us
claim the new crate name.

I added the partial changelog bits from #898, #893, and #840 since they
won't be included in the new package's PRs.

drive-by: Move CHANGELOG and README from the root to the `hugr` dir to
be more consistent with other packages in the workspace, and symlink
them instead.
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.

2 participants