Skip to content

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

Merged
busunkim96 merged 12 commits intomasterfrom
py-release-from-branch
Mar 23, 2022
Merged

chore(python): configure release-please on previous major versions#1369
busunkim96 merged 12 commits intomasterfrom
py-release-from-branch

Conversation

@busunkim96
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 thread tests/test_python_library.py Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Comment thread synthtool/languages/python.py Outdated
@busunkim96 busunkim96 requested a review from chingor13 March 22, 2022 20:20
Comment thread synthtool/languages/python.py Outdated
Comment on lines +198 to +200
Path(".github/release-please.yml").write_text(
release_please_yml + branch_release_config
)
Copy link
Copy Markdown
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