-
-
Notifications
You must be signed in to change notification settings - Fork 181
Automate the generation changelogs in text format #480
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
Conversation
|
Can I see an example run of the workflow? |
|
I wonder about the need for PAT here. Can it be explained? |
This commit is result of an example run of the workflow. Actually the workflow in this repo is expected to be triggered by this workflow to be located in main sage repo |
PAT is required for using Github REST API Need for Github REST API: Everytime a release occurs on main sage repo, it triggers the generation of changelog in this repo. To generate changelog, the script uses info from the release notes (which is fetched via Github API). |
|
But isn't PAT only needed for the user running this particular Actions workflow? This action can be run by someone who has rights to approve the PR changing contributor's info. Other users don't seem to need a PAT, right? |
Yes, you are right, only a single PAT needs to be created (by a maintainer) and stored in repository secrets.
Yes! And I just realized that we don't need |
|
I admit don't have a complete understanding of Actions permissions model - please proceed as you see fit. |
It seems that the sagemath organization owner (not the admin of sagemath/sage repo) can create a PAT that allows (read)-access to sagemath/sage repo, and then the admin of sagemath/website should store the PAT as a secret of sagemath/sage repo. Do you confirm this? |
|
Yes, I confirm that the sagemath organization owner can create a PAT, that allows read-access to sagemath/sage (since sagemath/sage is a public repo, giving 'read access to public repos' is also enough). BUT the PAT needs to be stored as a secret for both repos sagemath/website and sagemath/sage. I will try to elaborate on the use of PAT here: (Its used in two parts)
So for the 1st use case any valid PAT with 'read-access to public repos' will work. (And it should be stored in sagemath/website) This is the reason we need to store PAT in secrets of both repos sagemath/website and sagemath/sage. So we can store the PAT created by org owner (that allows read access to public repos) in secrets of both repos. |
|
For public repos, no PAT may be necessary (or so my AI says :-) We could experiment soon. |
|
I tried running the workflow without a PAT, and it worked perfectly! Sorry for the confusion earlier, also thank you for your patience. |
|
Okay, so the last time I triggered the workflow on my testing repo I had put a limit on the number of PRs fetched (just for the sake of saving time) and it seemed to work perfectly fine. |
|
So with a PAT, the rate limit is 5000 PRs? This would be big enough. |
|
Yeah, 5000 would be more than enough. |
|
I'm not sure what's going on and how this is supposed to work, but I just opened the settings and saw there are also "Organization secrets" (and there is one for PYPI). When I open the management form for that secret, I can add one there and tell it exactly which repositories should have access. So, I'm only guessing, but maybe you want the same secret (with the same value) to appear in two repositories? Then we could make this such an org secret for two repositories. |
|
We can proceed in this way: Harald, as you are one of the organization owners, you can designate me as an admin of sagemath/website. Then I can work with the author to put his code in the repo, and then we can test how it works. And then if we need a PAT (perhaps but I am not sure yet), then you, as an organization owner, could make one for us. Then I can put that PAT as a secret to either repo sagemath/website or sagemath/sage as necessary. |
|
I think it's better to have different PATs for different repos, just as with the usual passwords |
|
I was wondering, how do we identify the release manager for a specific release? Is it mentioned explicitly somewhere, or is there a standard way to fetch this information? Or there isn't any? |
|
Fortunately our release manager does not change :-) or it is a once or no event in a decade that we change the release manager. Volker Braun has been the release manager since 18 December 2013, when Sage 6.0 was released. I got this info from the changelogs! Hence I think you may hard-code that info into your changelog template. Or if you want to be more systematic, you may create a small json, yaml or txt file that contains the info. I have no better idea. |
|
I hoped that the commit of a release tag contains the name of the release manager, but it is not the case. |
|
I’m done with the final touches and ready to proceed. Thank you! |
kwankyu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
@kwankyu I see the workflow failed because of branch protection (changes can only be made via pull requests). We might need to update the workflow to create a PR instead of directly pushing. The manual step of merging the PR seems unavoidable but aligns well with the current protection rules of this repo. What do you think? |
|
Yes, the branch protection rule was an obstacle. It could be overcome by making the workflow to use the PAT created by me (admin). I found that Dima is also an admin since he is in the Core group. It seems that the PAT stored as a secret is secure enough. The workflow is now working well. I manually ran the workflow for 10.1, 10.2, 10.3, 10.4 (pending). I made some other small fixes and manual edits for 10.0 changelog. You can check them in the last commits. |
|
There is some obscurity about the release date. The workflow gets the release date from "published at" value of the release data. However the release data is created by a workflow in sagemath/sage, which could run at worst after a few days after the release manager makes a release (= push a release tag). I think there is nothing that the workflow here could do about that. |
|
The response returned by Githup API has following two dates This example is for tag 10.4 |
|
Thanks. Yes, it seems better. I did it in 854c9c3 |
|
@kwankyu - I've created a PAT, as requested. Where should it go? Can I upload/store it myself? Else, I can email it to you, encrypted. Do you have a pgp/gnu-pg/gpg key? |
|
Dima, sorry for lately informing you about what's going on. As explained in #480 (comment), I realized that since you are in the Core group, the PATs created by you are as (perhaps more) powerful than mine. Thus and also to overcome the branch protection rule obstacle, I created SAGE_ACCESS_TOKEN, and saved it in sagemath/website as a secret. For WEBSITE_ACCESS_TOKEN, I think it is also simpler and safer for me to create a PAT and directly save it to sagemath/sage as a secret. |
|
Just now I ran the workflow manually for the release 10.5. What should be the solution: (1) Fix the list of merged PRs included in the stable release (include only newly merged PRs for the release) or (2) Fix the workflow here to work only with the stable release (ignore prereleases) ? |
|
We could update the workflow to fetch any pr only once (by keeping track of pr ids). This way even if any pr is mentioned twice (Once in pre-release and once in stable release), it will only be fetched once overall (first all prs in pre-releases will be fetched). We can make following changes in Should I open another pr for it ? |
|
The simplest fix seems to be (1) Fix the list of merged PRs included in the stable release (include only newly merged PRs for the release) For now I modified https://github.com/sagemath/sage/releases/tag/10.5 and regenerated the changelog for release 10.5 by running the workflow again. Now we have the correct changelog. |
No. Let's keep the workflow as it is. Thanks. |
|
By the way, @haraldschilly updated the website. See the updated page: https://www.sagemath.org/development-map.html Thank @haraldschilly and @soham30rane! |
sagemathgh-39024: Automated the generation of changelogs in text format <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Associated with [sagemath#480 on website repo](sagemath/website#480) This pull request defines a workflow which is executed when any release is published. It in turn triggers the execution of `Generate Changelog` workflow in [website repo](https://github.com/sagemath/website) and the changelog is generated in .txt format if the current release was a stable release. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. <!-- ### ⌛ Dependencies --> <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39024 Reported by: Soham Rane Reviewer(s): Kwankyu Lee, Soham Rane
sagemathgh-39024: Automated the generation of changelogs in text format <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Associated with [sagemath#480 on website repo](sagemath/website#480) This pull request defines a workflow which is executed when any release is published. It in turn triggers the execution of `Generate Changelog` workflow in [website repo](https://github.com/sagemath/website) and the changelog is generated in .txt format if the current release was a stable release. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. <!-- ### ⌛ Dependencies --> <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39024 Reported by: Soham Rane Reviewer(s): Kwankyu Lee, Soham Rane
sagemathgh-39024: Automated the generation of changelogs in text format <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Associated with [sagemath#480 on website repo](sagemath/website#480) This pull request defines a workflow which is executed when any release is published. It in turn triggers the execution of `Generate Changelog` workflow in [website repo](https://github.com/sagemath/website) and the changelog is generated in .txt format if the current release was a stable release. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. <!-- ### ⌛ Dependencies --> <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39024 Reported by: Soham Rane Reviewer(s): Kwankyu Lee, Soham Rane
sagemathgh-39194: Reimplement release creation workflow <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes the issue raised in sagemath/website#480 (comment) I manually edited the release https://github.com/sagemath/sage/releases/tag/10.5 generated by an workflow implemented in sagemath/website#480 to correct the changelog https://github.com/sagemath/website/blob/master/sr c/changelogs/sage-10.5.txt, which is now in good shape. But see, for example, https://github.com/sagemath/sage/releases/tag/10.4 that contains all changes in betas and rcs. This PR is for automatic generation of a release that contains only changes from the last release. test: https://github.com/kwankyu/sage/releases https://github.com/kwankyu/sage/actions/runs/12485317339/job/34844199681 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39194 Reported by: Kwankyu Lee Reviewer(s): Soham Rane
sagemathgh-39194: Reimplement release creation workflow <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes the issue raised in sagemath/website#480 (comment) I manually edited the release https://github.com/sagemath/sage/releases/tag/10.5 generated by an workflow implemented in sagemath/website#480 to correct the changelog https://github.com/sagemath/website/blob/master/sr c/changelogs/sage-10.5.txt, which is now in good shape. But see, for example, https://github.com/sagemath/sage/releases/tag/10.4 that contains all changes in betas and rcs. This PR is for automatic generation of a release that contains only changes from the last release. test: https://github.com/kwankyu/sage/releases https://github.com/kwankyu/sage/actions/runs/12485317339/job/34844199681 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39194 Reported by: Kwankyu Lee Reviewer(s): Soham Rane
|
(1) is highly non-standard, and I think nothing is lost by doing (2) instead. Besides, (2) can be done by a standard GitHub action. |
Fixes #471 as discussed on sage-devel 2024-11-13
Necessary steps to take before achieving proper functionality:
with name
PERSONAL_ACCESS_TOKENCHANGELOG_TRIGGER_SECRET.I am also making a pr to sage repo to define a workflow which will in turn trigger
generate_changelog.ymlon every release.Sample results of the script. (Executed it for release tag 10.5, which considered all pre-releases uptil now)
sage-10.5.txt