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

[WIP] Create GitHub Actions Release workflow, refactor steps using GitHub Actions composite steps #1423

Closed
wants to merge 22 commits into from

Conversation

rodrigc
Copy link
Contributor

@rodrigc rodrigc commented Oct 3, 2020

Contributor Checklist:

Notes

I looked at the following pages to get ideas for how to do this:

@rodrigc rodrigc force-pushed the 9993-rodrigc-github-actions-release branch 18 times, most recently from 982b79c to c80f0ff Compare October 3, 2020 23:04
@adiroiban
Copy link
Member

awesome :)

@rodrigc rodrigc changed the title [WIP] Refactor GitHub Actions into composite run steps Create GitHub Actions Release workflow, refactor steps using GitHub Actions composite steps Oct 4, 2020
.github/workflows/mypy.yaml Outdated Show resolved Hide resolved
@rodrigc rodrigc force-pushed the 9993-rodrigc-github-actions-release branch from 3fcbec3 to db4f54e Compare October 4, 2020 00:36
name: Release Twisted

on:
release:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't actually test this, because I would need to trigger a Release event via
GitHub. But we can play with this and tune this when we do the next Twisted release.

Copy link
Member

Choose a reason for hiding this comment

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

You can create a test release and then delete it.

When creating the release, you can use an existing tag, to prevent creating a new tag inside the repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What tag can I use? Can I use a tag that does not have this release.yaml file?

Copy link
Member

Choose a reason for hiding this comment

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

Another idea, is to have this workflow triggered by each PR.
In this way we have Continuous Integration and we make sure that a PR is not breaking the release script.

The workflow can have a precondition for the final publish step, to skip the publish if a new tag was not created.

Copy link
Member

Choose a reason for hiding this comment

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

I see that the workflow already has this condition for the publish...so is best to enable it on any PR and not only on release.

Copy link
Member

Choose a reason for hiding this comment

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

What tag can I use? Can I use a tag that does not have this release.yaml file?

Good question. I think the answer is now.

So I think that you can create a 20.4.0.dev0 tag.

I am not sure what is the best way to mark a version as DEV. that is non-production and not even pre-release.

I would say that you can try with .dev0 as this is PEP440... it this doesn't work, try 20.4.0-dev0 based on semver schema.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://twisted.readthedocs.io/en/latest/core/development/policy/release-process.html#version-numbers says that the release numbers need to be time based, so wouldn't that mean 20.10.0.dev0 ?

According to https://twisted.readthedocs.io/en/latest/core/development/policy/release-process.html#announce , the dev0 postfix is added by incremental.

@adiroiban
Copy link
Member

the 'mypi / test_run' can be removed.

The release secret PyPI token is not yet in the repo. You can trigger the pre-release and we should see that it fails.

But as part of this PR we can list the files which are planned to be pushed to PyPI and debug then.

@twm
Copy link
Contributor

twm commented Oct 4, 2020

FYI, I had to disable the MyPy branch protection check in order to merge #1269. Please re-enable it when you're done here, or let me know what it's now called so that I can do so.

@rodrigc rodrigc force-pushed the 9993-rodrigc-github-actions-release branch from db4f54e to f6fa486 Compare October 4, 2020 01:20
@rodrigc
Copy link
Contributor Author

rodrigc commented Oct 4, 2020

the 'mypi / test_run' can be removed.

It's gone.

@adiroiban
Copy link
Member

The publish step should be executed only once.

I feel that the current GitHub Action implementation is over-engineered.

For example the linter and documentation can continue to stay in their own separate worflows without having the linter or docs steps shared in other workflows.

The release can be it its own workflow and have the following:

  • Job to create the wheels on all supported platforms and push the wheels as artifact
  • A final job executed only once on linux, to download all the wheel the artifacts and publish them.

I know that for 100% correctnes you can automatically block a release is a test is failing.
But with twisted tests running on so many python versions, on so many OSes and with so many reactors this can turn into a PITA as you will end up with 1 test failing which will blow the release.

So I think that we should have separate tests for each environment.
Before the release, you can manually review that all are green and ask another person to review the state and the tests and then trigger the release without triggering a new set of tests.


For the automated release, rather than triggering the workflow on a release, I think is best to trigger it when a new tag is created.
Filter it based on tags starting with twisted-.
It looks like this is the twisted convension for tagging a release tag.

The reason for that is that if the release process is triggered by a new twisted-VER tag, we can trigger it ouside of the GItHub UI or GitHub release API. You can just use standard git tag tools to trigger a new release.


I think that it might help to start with a description of the release process.
Here is how I see it.

  • Create a Trac ticket to announce the intention of create a release.
  • Create a new branch + PR in which the version is updated to a release candidate (-rc1 or .rc1) and the release note is created and all the news fragments removed.
  • Push the changes and wait for all the tests to be green and the PR to be approved. This will approve the release notes text.
  • Once the release PR is approved and all PR tests are green use GitHub Release UI to create a pre-release for a new TAG and publish it on Pypi. The Release is created manually. The Pypi is uploaded automatically.
  • Announce the re-release over the mailinglist.
  • After 1 week (or 2 weeks), if no errors are found during the pre-release, go back to the release PR/branch and commit the final version.
  • Get a new approval for the final version. This just to have some peer-review.
  • Once the PR is approved just merged and use GitHub UI to create a new final release. In the GitHub UI you can copy/paste the release notes and use GitHub UI to create a new tag.

@rodrigc
Copy link
Contributor Author

rodrigc commented Oct 4, 2020

Your review is annoying. Originally, I had release as a separate workflow, which did what you said, but then you said you didn't want to duplicate the logic. Now I changed it to what you said, and now you changed your mind, and want me to go back to what I had before

Can you hold off any further reviews of this workflow for a while?

I'm trying to focus on getting the release UI in GitHub working, and pushes to PyPI working.

While I appreciate your previous help on reviews, in this case you are not being helpful.

I also don't appreciate your comment about this workflow being overengineered. While being helpful on reviews, you have done none of the work to make this happen.

@rodrigc rodrigc changed the title Create GitHub Actions Release workflow, refactor steps using GitHub Actions composite steps [WIP] Create GitHub Actions Release workflow, refactor steps using GitHub Actions composite steps Oct 4, 2020
@rodrigc
Copy link
Contributor Author

rodrigc commented Oct 5, 2020

I changed things back to what I had before with having the release.yaml as a workflow which is separate from the main test.yaml workflow which runs all the tests. Trying to incorporate feedback from this comment: #1423 (comment) caused me to go down a wrong path.

@rodrigc
Copy link
Contributor Author

rodrigc commented Oct 5, 2020

@glyph In order to move forward with this PR, I need help to push out a new version of Incremental, and I need to have a Pypi token stored in GitHub Secrets. I mentioned this on the mailing list: https://twistedmatrix.com/pipermail/twisted-python/2020-October/065274.html

@rodrigc rodrigc mentioned this pull request Oct 9, 2020
6 tasks
@graingert graingert self-requested a review October 12, 2020 19:14
Copy link
Member

@graingert graingert left a comment

Choose a reason for hiding this comment

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

I think this will be greatly simplified by moving C builds for manylinux and macos into a separate project

#1433

The c builds for manylinux and macos are only useful in Twisted self tests, and there's no point in shipping them to pypi

@rodrigc
Copy link
Contributor Author

rodrigc commented Oct 12, 2020

@graingert Thanks for the feedback, but for this initial go-around of trying to do the release, I'm not going to incorporate your suggestion.

Copy link
Member

@glyph glyph left a comment

Choose a reason for hiding this comment

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

I feel pretty strongly that we should not be executing both the release and all of the automation that facilitates it at once.

It's a shame that we need to run so many random YAML files that have nothing to do with Twisted's own functionality through our own code review process, rather than having a common tool that can do this without so much human oversight. Thanks for pushing through this, craig.

I think that @graingert is working on landing this in smaller chunks so perhaps this WIP will be fine without much in the way of changes besides being broken up…

@adiroiban
Copy link
Member

adiroiban commented Oct 23, 2020

The work from Thomas was move here into a twisted/twisted branch and is ready for review #1464

I think that this can be closed.

@rodrigc rodrigc closed this Feb 14, 2021
@rodrigc rodrigc deleted the 9993-rodrigc-github-actions-release branch February 14, 2021 23:56
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.

None yet

5 participants