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

feat: Move release note generation to a sub module #3299

Merged
merged 73 commits into from
Oct 23, 2024

Conversation

JoeWang1127
Copy link
Collaborator

@JoeWang1127 JoeWang1127 commented Oct 17, 2024

In this PR:

  • Separate projects to three modules: common, library_generation and release_note_generation
  • Add generate_release_note.py to separate PR description generation from entrypoint.py.
  • Only install common and library_generation module in image.
  • Remove PR description comparison in integration test.

Example generation workflow in downstream library: https://github.com/googleapis/java-bigtable/actions/runs/11442581326/job/31833887512

Note that release_note_generation module still depends on library_generation module because we didn't separate config change functions into common module. This will be in a follow up PR.

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Oct 17, 2024
@JoeWang1127 JoeWang1127 marked this pull request as ready for review October 17, 2024 17:03
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Oct 17, 2024
@JoeWang1127 JoeWang1127 changed the title feat: separate pr description generation from entry point feat: Move release note generation to a sub module Oct 17, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels Oct 18, 2024
@JoeWang1127 JoeWang1127 marked this pull request as ready for review October 21, 2024 16:05
pip install --upgrade pip
pip install hermetic_build/common
pip install hermetic_build/library_generation
pip install hermetic_build/release_note_generation
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about we keep the dependencies together.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created requirements.in and requirements.txt in each module.

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Oct 22, 2024
shell: bash
run: |
cd "${GITHUB_WORKSPACE}"
pip install --upgrade pip
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have to upgrade pip? Can this be done in previous steps like setup-python?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

According to this comment, pip is not updated in this action.

As for pip, we don't need it to be updated. I'll remove this line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

pip install --require-hashes -r hermetic_build/common/requirements.txt
pip install hermetic_build/common
pip install --require-hashes -r hermetic_build/library_generation/requirements.txt
pip install hermetic_build/library_generation
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we need to install library_generation anymore once we move ConfigChange out of this module?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. We need to install library_generation because config change is still part of it. Once it moves to common, we don't need to install it.

Copy link
Contributor

@diegomarquezp diegomarquezp left a comment

Choose a reason for hiding this comment

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

Thanks for this PR. LGTM so far - just some minor comments.

echo "PATH=${PATH}" >> $GITHUB_ENV

set +ex
python-version: 3.12
- name: install python dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- name: install python dependencies
- name: install python modules and dependencies

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -80,23 +69,26 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
- name: install python dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- name: install python dependencies
- name: install python modules and dependencies

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,109 @@
#
# This file is autogenerated by pip-compile with Python 3.11
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the implications of generating a reqs file with a different python version? Maybe we can create one with 3.12 instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pip-tools (which contains pip-compile) is built with python 3.11.

You can confirm this by running which pip-compile.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, looks like pip-compile is available only for 3.11, but it's installable via pip install pip-tools from 3.12 onwards. I managed to locally generate the hashes with python 3.12. Can you confirm this works?

pyenv install 3.12
pyenv local 3.12
python --version
pip install pip-tools
pip-compile --generate-hashes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks.

I changed the requirements.txt using python 3.12.

@@ -21,9 +21,9 @@ code declared in a "golden branch" of the repo.
It requires docker and python 3.x to be installed.

```
python -m pip install --require-hashes -r requirements.txt
python -m pip install .
Copy link
Contributor

Choose a reason for hiding this comment

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

The development guide shows commands to be run from the sdk-platform-java/library_generation folder. However this command now must be run from sdk-platform-java/hermetic_build/library_generation (or change pip install . to pip install library_generation and run it from //hermetic_build. We can modify this note to point to hermetic_build.

With this, then we could correct this to

Suggested change
python -m pip install .
python -m pip install library_generation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -89,14 +89,6 @@ will be created/modified:
| pom.xml (repo root dir) | Always generated from inputs |
| versions.txt | New entries will be added if they don’t exist |

### Change history
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC this feature is not being actually removed. Should we keep it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change history is not generated by entry_point.py so I think we don't need to include this part.

I plan to raise another PR to consolidate library generation and release note generation into a README in hermetic_build directory.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah gotcha, I was missing the fact that this readme is in the library_generation folder.

@@ -0,0 +1,417 @@
#
# This file is autogenerated by pip-compile with Python 3.11
Copy link
Contributor

Choose a reason for hiding this comment

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

same concern about python versions

Copy link

sonarcloud bot commented Oct 23, 2024

Copy link

sonarcloud bot commented Oct 23, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@JoeWang1127 JoeWang1127 merged commit 7d6d66a into main Oct 23, 2024
50 of 52 checks passed
@JoeWang1127 JoeWang1127 deleted the feat/separate-pr-des-gen branch October 23, 2024 23:18
mpeddada1 pushed a commit that referenced this pull request Oct 25, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.49.0</summary>

##
[2.49.0](v2.48.0...v2.49.0)
(2024-10-25)


### Features

* Move release note generation to a sub module
([#3299](#3299))
([7d6d66a](7d6d66a))


### Bug Fixes

* add additional potential exceptions when retrieving protobuf manifest
file to get version
([#3315](#3315))
([ef9e518](ef9e518))


### Dependencies

* update dependency com.google.errorprone:error_prone_annotations to
v2.35.1
([#3316](#3316))
([d7c290f](d7c290f))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants