Skip to content

Conversation

@soham30rane
Copy link
Contributor

Associated with #480 on website repo

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 and the changelog is generated in .txt format if the current release was a stable release.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • 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.

This workflow in turn triggeres changelog generator workflow on website repo
@github-actions
Copy link

github-actions bot commented Nov 28, 2024

Documentation preview for this PR (built with commit 72d1e6d; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 6, 2024
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
@kwankyu
Copy link
Collaborator

kwankyu commented Dec 6, 2024

This PR is complemented by #39083.

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 8, 2024
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
@vbraun vbraun merged commit 9ff4ae5 into sagemath:develop Dec 8, 2024
28 checks passed
@kwankyu
Copy link
Collaborator

kwankyu commented Dec 23, 2024

It seems that the workflow is not triggered by a release.

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 23, 2024

I expected that the workflow itself runs but the steps are skipped for pre-releases.

Of course, it is okay that the workflow does not run for pre-releases. Let's wait and see what happens for a stable release.

@soham30rane
Copy link
Contributor Author

Yes, ideally the workflow should have run and the steps should have been skipped

@kwankyu
Copy link
Collaborator

kwankyu commented Apr 7, 2025

The workflow https://github.com/sagemath/sage/actions/workflows/changelog_trigger.yml does not run even for a stable release...

@kwankyu
Copy link
Collaborator

kwankyu commented Apr 7, 2025

Perhaps

on:
  release:
    types: [created]

would work?

@soham30rane
Copy link
Contributor Author

My LLM also suggested something similar.
Interestingly though, when I tested the same logic in my test repo, it did trigger correctly with types: [published], even though the release was created in the same way (via the curl API with draft=false) as in this repo.

GitHub’s behavior around this seems a bit flaky, so I’m all for trying types: [created].
If that still doesn’t fire, we can use workflow_run and trigger it after dist.yml finishes.

@kwankyu
Copy link
Collaborator

kwankyu commented Apr 18, 2025

My LLM also suggested something similar. Interestingly though, when I tested the same logic in my test repo, it did trigger correctly with types: [published], even though the release was created in the same way (via the curl API with draft=false) as in this repo.

Yes. Though I don't remember clearly, I must have also tested it successfully on my own repo. Strange..

GitHub’s behavior around this seems a bit flaky, so I’m all for trying types: [created]. If that still doesn’t fire, we can use workflow_run and trigger it after dist.yml finishes.

Thanks for the tips. Let's pass one more release with types: [published].

If that fails, we pass the next release with types: [created].

If that still fails, we use workflow_run.

Let's see. Thanks.

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 21, 2025

I just found why the workflow does not run on a new release.

https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow

To summarize: because the release (event) is made by a workflow with GITHUB_TOKEN, the release event does not trigger another workflow (to prevent accidental infinite loop).

The article also tells a solution. I will prepare a PR soon.

vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 25, 2025
sagemathgh-40654: Fix release workflow to trigger changelog 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
sagemath#39024 (comment). For
why, see
sagemath#39024 (comment)

To see if this works well, after merged, we can just watch

https://github.com/sagemath/website/actions/workflows/generate_changelog
.yml

after the next 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#40654
Reported by: Kwankyu Lee
Reviewer(s): Kwankyu Lee, Tobias Diez, user202729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants