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

chore(python): configure release-please on previous major versions #1369

Merged
merged 12 commits into from
Mar 23, 2022

Conversation

busunkim96
Copy link
Contributor

@busunkim96 busunkim96 commented Mar 16, 2022

Read the current Python library release version from the setup.py or version.py and add release-please branch configs for all previous major versions.

releaseType: python
handleGHRelease: true
# NOTE: this section is generated by synthtool.languages.python
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
branches:
- branch: v1
  handleGHRelease: true
  releaseType: python
- branch: v0
  handleGHRelease: true
  releaseType: python

Repos where I tested this:

@busunkim96 busunkim96 marked this pull request as ready for review March 21, 2022 16:33
@busunkim96 busunkim96 requested review from a team and parthea March 21, 2022 16:33
@parthea
Copy link
Contributor

parthea commented Mar 22, 2022

@busunkim96 , I applied the update on a repo that doesn't have a previous major version. There are no branches listed under branches: . Can release-please handle an empty branches section or should we remove branches: if it's empty?

releaseType: python
handleGHRelease: true
  # NOTE: this section is generated by synthtool.languages.python
  # See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
  branches:

Copy link
Contributor

@parthea parthea left a comment

Choose a reason for hiding this comment

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

Added one observation, otherwise LGTM

Comment on lines 155 to 163
# NOTE: this section is generated by synthtool.languages.python
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
branches:
- branch: v1
handleGHRelease: true
releaseType: python
- branch: v0
handleGHRelease: true
releaseType: python"""
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this indentation is wrong. branches should not have leading spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Comment on lines 198 to 200
Path(".github/release-please.yml").write_text(
release_please_yml + branch_release_config
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this idempotent? It looks like it will just keep appending to the file.

Also, it might be cleaner to build it as a dict and export to yaml.

@parthea parthea assigned busunkim96 and unassigned parthea Mar 22, 2022
@busunkim96 busunkim96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 23, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 23, 2022
@busunkim96 busunkim96 merged commit c1dd87e into master Mar 23, 2022
@busunkim96 busunkim96 deleted the py-release-from-branch branch March 23, 2022 16:28
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.

4 participants