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 release tool #3974

Merged
merged 17 commits into from
Oct 29, 2023
Merged

Add release tool #3974

merged 17 commits into from
Oct 29, 2023

Conversation

cooperlees
Copy link
Collaborator

@cooperlees cooperlees commented Oct 24, 2023

  • Add tool for release managers to use to generate commits

    • I'm trying to only use stdlib so we have no depdencies ...
  • Default is to change date strings in hard coded documentation files + CHANGES.md

    • I write directly to files cause we have SCM to fix any screw ups ...
  • We hackily convert calver to ints to sort (all for better ideas here)

    • If we hit a ValueError we just set to 0 for sorting - This is alhpa + beta release we can safely ignore these days
  • Add new CI to only run release unittests in 3.12 only on all platforms

  • Update release docs

  • Checked with mypy --strict + ensure we are black --preview formatted :D

Tests:

  • Run it to generate template PR
    • python3.12 release.py --debug --add-changes-template
  • Run it to cleanup CHANGE.md + change version in specified doc files
crl-m1:black cooper$ python3.12 release.py -d
[2023-10-23 23:39:38,414] INFO: Current version detected to be 23.10.1 (release.py:221)
[2023-10-23 23:39:38,414] INFO: Next version will be 23.10.2 (release.py:222)
[2023-10-23 23:39:38,414] INFO: Cleaning up /Users/cooper/repos/black/CHANGES.md (release.py:127)
[2023-10-23 23:39:38,416] DEBUG: Finished Cleaning up /Users/cooper/repos/black/CHANGES.md (release.py:147)
[2023-10-23 23:39:38,416] INFO: Updating black version to 23.10.2 in /Users/cooper/repos/black/docs/integrations/source_version_control.md (release.py:173)
[2023-10-23 23:39:38,416] DEBUG: Finished updating black version to 23.10.2 in /Users/cooper/repos/black/docs/integrations/source_version_control.md (release.py:185)
[2023-10-23 23:39:38,416] INFO: Updating black version to 23.10.2 in /Users/cooper/repos/black/docs/usage_and_configuration/the_basics.md (release.py:173)
[2023-10-23 23:39:38,417] DEBUG: Finished updating black version to 23.10.2 in /Users/cooper/repos/black/docs/usage_and_configuration/the_basics.md (release.py:185)
  • Add tests around some key logic

Addresses most of #3970

- Add tool for release managers to use to generate commits
  - I'm trying to only use stdlib so we have no depdencies ...
- Default is to change date strings in hard coded documentation files + CHANGES.md
  - I write directly to files cause we have SCM to fix any screw ups ...
- We hackily convert calver to ints to sort (all for better ideas here)
  - If we hit a ValueError we just set to 0 for sorting - This is alhpa + beta release we can safely ignore these days
- Add new CI to only run release unittests in 3.12 only on all platforms
- Update release docs

- Checked with `mypy --strict` + ensure we are `black --preview` formatted :D

Tests:
- Run it to generate template PR
  - `python3.12 release.py --debug --add-changes-template`
- Run it to cleanup CHANGE.md + change version in specified doc files
```
crl-m1:black cooper$ python3.12 release.py -d
[2023-10-23 23:39:38,414] INFO: Current version detected to be 23.10.1 (release.py:221)
[2023-10-23 23:39:38,414] INFO: Next version will be 23.10.2 (release.py:222)
[2023-10-23 23:39:38,414] INFO: Cleaning up /Users/cooper/repos/black/CHANGES.md (release.py:127)
[2023-10-23 23:39:38,416] DEBUG: Finished Cleaning up /Users/cooper/repos/black/CHANGES.md (release.py:147)
[2023-10-23 23:39:38,416] INFO: Updating black version to 23.10.2 in /Users/cooper/repos/black/docs/integrations/source_version_control.md (release.py:173)
[2023-10-23 23:39:38,416] DEBUG: Finished updating black version to 23.10.2 in /Users/cooper/repos/black/docs/integrations/source_version_control.md (release.py:185)
[2023-10-23 23:39:38,416] INFO: Updating black version to 23.10.2 in /Users/cooper/repos/black/docs/usage_and_configuration/the_basics.md (release.py:173)
[2023-10-23 23:39:38,417] DEBUG: Finished updating black version to 23.10.2 in /Users/cooper/repos/black/docs/usage_and_configuration/the_basics.md (release.py:185)
```
- Add tests around some key logic
@cooperlees cooperlees added the skip news Pull requests that don't need a changelog entry. label Oct 24, 2023
@cooperlees
Copy link
Collaborator Author

Damn, I suck. I'll fix all CI in the morning ...

@github-actions
Copy link

github-actions bot commented Oct 24, 2023

diff-shades reports zero changes comparing this PR (be52fa9) to main (5515a5a).


What is this? | Workflow run | diff-shades documentation

@cooperlees
Copy link
Collaborator Author

Wow - this has been my worst CI experience with GitHub ever ...

Am I right assuming python runs from the root of a black repo checkout and that git binary should be in my PATH and subprocess.run() should be able to find it?

Anyone got tips here at what I'm doing wrong? I'm at a loss as I seem to be getting a retuirn 0, but no git tag output to split etc.

  • It's annoying cause the damn tool works ... just can't get tests to work in the Actions Environment ... 😭

…lan to but I can't get it working on GitHub actions
@keewis
Copy link

keewis commented Oct 25, 2023

not sure, but by default actions/checkout performs a shallow checkout, so no tags. If this is it, you might have to pass depth: 0 to do a full clone.

If not, you might be interested in act which can be used to run actions locally (hopefully reproducing the issue). Otherwise your only option appears to be debug printing, which doesn't have a great feedback loop.

@cooperlees
Copy link
Collaborator Author

not sure, but by default actions/checkout performs a shallow checkout, so no tags. If this is it, you might have to pass depth: 0 to do a full clone.

Many thanks for the shallow pointer - Trying it now!

If not, you might be interested in act which can be used to run actions locally (hopefully reproducing the issue). Otherwise your only option appears to be debug printing, which doesn't have a great feedback loop.

I tried using this but couldn't get it to run with python3.12 for some reason

Copy link
Collaborator

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks! A few comments

.github/workflows/release_tests.yml Outdated Show resolved Hide resolved
.github/workflows/release_tests.yml Show resolved Hide resolved
docs/contributing/release_process.md Outdated Show resolved Hide resolved
docs/contributing/release_process.md Outdated Show resolved Hide resolved
docs/contributing/release_process.md Outdated Show resolved Hide resolved
docs/contributing/release_process.md Outdated Show resolved Hide resolved
docs/contributing/release_process.md Outdated Show resolved Hide resolved
release.py Outdated Show resolved Hide resolved
release.py Outdated Show resolved Hide resolved
- Fix bug missing lines ending with --> in CHANGES.md to delete ...
- Update ci to run out of scripts dir too
- Update test_tuple_calver
@cooperlees cooperlees merged commit f7cbe4a into main Oct 29, 2023
49 checks passed
@cooperlees cooperlees deleted the release_tool branch October 29, 2023 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news Pull requests that don't need a changelog entry.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants