Skip to content

Fix links to PR & author not being added into the automatic Changelog#4908

Closed
waiting-for-dev wants to merge 2 commits intosolidusio:masterfrom
nebulab:waiting-for-dev/changelog_links
Closed

Fix links to PR & author not being added into the automatic Changelog#4908
waiting-for-dev wants to merge 2 commits intosolidusio:masterfrom
nebulab:waiting-for-dev/changelog_links

Conversation

@waiting-for-dev
Copy link
Copy Markdown
Contributor

@waiting-for-dev waiting-for-dev commented Feb 6, 2023

Summary

Although GitHub automatically autolinks references to PR and author in the release notes, it doesn't create them for the files in a repository. From theirs docs:

Note: Autolinked references are not created in wikis or files in a repository.

As we're copying the automatically generated release notes into the Changelog file, that resulted in the missing links. We fix it from the source to be safe from future changes.

Fixes #4904

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

Although GitHub automatically autolinks references to PR and author in
the release notes, it doesn't create them for the files in a repository.
From theirs docs [1]:

> Note: Autolinked references are not created in wikis or files in a repository.

As we're copying the automatically generated release notes into the
Changelog file, that resulted in the missing links. We fix it from the
source to be safe from future changes.

[1] - https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-url

Closes solidusio#4904
@waiting-for-dev waiting-for-dev requested a review from a team as a code owner February 6, 2023 16:00
@github-actions github-actions Bot added the changelog:repository Changes to the repository not within any gem label Feb 6, 2023
Copy link
Copy Markdown
Member

@elia elia left a comment

Choose a reason for hiding this comment

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

Looks good!

I left one comment, more a consideration, surely not blocking given the number of places which would need to be updated.

Comment thread dev_tools/spec/lib/solidus/release_drafter/builder_spec.rb
@kennyadsl
Copy link
Copy Markdown
Member

A question before reviewing: did we evaluated at some point for this entries to have the same format of the one autogenerated by GitHub Releases?

Their format is something like

* Point the Solidus Installer to the right Starter Frontend version by @kennyadsl in 
https://github.com/solidusio/solidus/pull/4898

And having something similar will make copy/paste super easy in case something won't work in our workflow.

@waiting-for-dev
Copy link
Copy Markdown
Contributor Author

A question before reviewing: did we evaluated at some point for this entries to have the same format of the one autogenerated by GitHub Releases?

Their format is something like

* Point the Solidus Installer to the right Starter Frontend version by @kennyadsl in 
https://github.com/solidusio/solidus/pull/4898

And having something similar will make copy/paste super easy in case something won't work in our workflow.

The only thing that we'd lose is the link to the author name, but I agree that would make the process simpler. Is it a tradeoff we can assume?

@kennyadsl
Copy link
Copy Markdown
Member

My vote is for having the same format GitHub proposes. The link to the author is not something that is really needed and you can find it in the linked PR.

waiting-for-dev added a commit to nebulab/solidus that referenced this pull request Feb 9, 2023
We're changing the format for the auto-generated release notes from:

- This is the PR title #1 (@author)

to:

* This is the PR title by @author in solidusio#1

By mimicking the default GitHub format, we make it easier to generate
them manually through GitHub's "Generate release notes" [1] button or
through the API [2].

At the same time, we're fixing the missing links to the PR when we copy
the draft content to the Changelog file, as GitHub doesn't autolink
references in files. From their documentation [3]:

> Note: Autolinked references are not created in wikis or files in a repository.

We'll still miss the link to the contributor, but it's a tradeoff we pay
to make our lives easier if the automation fails. Anyway, it can be
accessed once landed on the pull request URL.

[1] - https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
[2] - https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#generate-release-notes-content-for-a-release
[3] - https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-url

Closes solidusio#4904 & solidusio#4908
@waiting-for-dev
Copy link
Copy Markdown
Contributor Author

Closing in favor of #4926

@waiting-for-dev waiting-for-dev deleted the waiting-for-dev/changelog_links branch February 9, 2023 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:repository Changes to the repository not within any gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add links to PR & author in the auto-generated release notes

3 participants