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

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

Closed
waiting-for-dev opened this issue Feb 6, 2023 · 3 comments · Fixed by #4926
Closed

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

waiting-for-dev opened this issue Feb 6, 2023 · 3 comments · Fixed by #4926
Assignees
Labels
confirmed Validated report type:bug Error, flaw or fault

Comments

@waiting-for-dev
Copy link
Contributor

waiting-for-dev commented Feb 6, 2023

Not adding them is not a problem in the release notes, as they're automatically generated when rendered. However, we later copy the content to the Changelog, and Github doesn't generate the links there. See https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls:

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

@waiting-for-dev waiting-for-dev self-assigned this Feb 6, 2023
@waiting-for-dev waiting-for-dev added type:bug Error, flaw or fault confirmed Validated report labels Feb 6, 2023
waiting-for-dev added a commit to nebulab/solidus that referenced this issue Feb 6, 2023
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 added a commit to nebulab/solidus that referenced this issue 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 & 4908
waiting-for-dev added a commit to nebulab/solidus that referenced this issue 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 & 4908
waiting-for-dev added a commit to nebulab/solidus that referenced this issue 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 & 4908
waiting-for-dev added a commit to nebulab/solidus that referenced this issue 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
Contributor Author

As per @kennyadsl 's comment, we've decided to follow GitHub's default format for the generated release notes. That way we'll have a better experience manually updating the notes when something goes wrong with our automation. That means the PR link will be rendered, but we'll still miss the author's link, which is an acceptable tradeoff.

@kennyadsl
Copy link
Member

kennyadsl commented Feb 10, 2023

Reopening, I think we also need to update the existing draft releases entries manually, right?

@kennyadsl kennyadsl reopened this Feb 10, 2023
@waiting-for-dev
Copy link
Contributor Author

Done. The only draft was for v3.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Validated report type:bug Error, flaw or fault
Projects
None yet
2 participants