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: add generate_repo.py #2431

Merged
merged 67 commits into from Feb 7, 2024
Merged

feat: add generate_repo.py #2431

merged 67 commits into from Feb 7, 2024

Conversation

JoeWang1127
Copy link
Collaborator

@JoeWang1127 JoeWang1127 commented Jan 30, 2024

In this PR:

  • Add generate_repo.py to generate libraries defined in a configuration file.
    • Regenerate .repo-metadata.json
    • Generate .OwlBot.yaml and owlbot.py for new clients
    • Invoke generate_composed_library.py to generate multiple versions of a GAPIC library.
    • Apply repo-level post processing using python
      • Regenerate root pom.xml
      • Regenerate gapic-libraries-bom/pom.xml
  • Format python script using black.
  • Add unit tests for utility functions.
  • Add an integration test using python, replacing shell integration tests.
  • Add a python lint check in CI.

This is step 2 of milestone 2 of hermetic build project.

@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Jan 30, 2024
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Jan 30, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

What tool did you format the python files with? It'd be nice if that tool had a linter mode that fails on non-compliant files so we can add it as part of our linter step

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What tool did you format the python files with?

I use black to format python code and it also has a validate function.

It'd be nice if that tool had a linter mode that fails on non-compliant files so we can add it as part of our linter step

Sure, I'll add a lint step in CI.

This tool is included when I install all requirements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a python lint job in CI.

if library.rpc_documentation:
repo_metadata["rpc_documentation"] = library.rpc_documentation

# generate .repo-meta.json
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add more comments here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added.

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed, we can either enable the IT for this split repo or leave it as a follow up, whichever is most convenient

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I'll remove the split repo integration test for now, since we mainly focus on generating google-cloud-java.

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 it should be fine with leaving the yaml file, although not touched by our scripts

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I'll modify the integration test to reflect this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Restored the config file for java-bigtable.

@JoeWang1127 JoeWang1127 marked this pull request as ready for review February 7, 2024 17:45
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner February 7, 2024 17:45
Copy link
Member

@suztomo suztomo left a comment

Choose a reason for hiding this comment

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

It would be nice if I can see how the real main entry point (library_generation/generate_repo.py?) is invoked in verify_library_generation.yaml. No need to replace the Python-based integraiton tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can leave a follow up after this PR to update the README to reflect that the main entrypoint is this one and not the now-lower-level generate_library.sh

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I'll follow up with this.

Copy link

sonarcloud bot commented Feb 7, 2024

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Feb 7, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@JoeWang1127 JoeWang1127 merged commit 47b632a into main Feb 7, 2024
44 checks passed
@JoeWang1127 JoeWang1127 deleted the feat/generate_repo branch February 7, 2024 22:51
alicejli pushed a commit that referenced this pull request Feb 13, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.35.0</summary>

##
[2.35.0](v2.34.0...v2.35.0)
(2024-02-13)


### Features

* add `generate_repo.py`
([#2431](#2431))
([47b632a](47b632a))
* move synthtool templates to `library_generation/owlbot`
([#2443](#2443))
([5c95472](5c95472))


### Bug Fixes

* Apiary Host returns user set host if set
([#2455](#2455))
([5f17e62](5f17e62))
* Cancel the Timeout Task for HttpJson
([#2360](#2360))
([b177d9e](b177d9e))


### Dependencies

* update dependency commons-codec:commons-codec to v1.16.1
([#2473](#2473))
([8c6e91d](8c6e91d))
* update google api dependencies
([#2469](#2469))
([ad4d4e6](ad4d4e6))
* update google auth library dependencies to v1.23.0
([#2466](#2466))
([349a5d3](349a5d3))
* update google auth library dependencies to v1.23.0
([#2476](#2476))
([6c9127c](6c9127c))
* update google http client dependencies to v1.44.1
([#2467](#2467))
([87d1435](87d1435))
* update googleapis/java-cloud-bom digest to ac9893c
([#2472](#2472))
([7fff34a](7fff34a))
* update grpc dependencies to v1.61.1
([#2463](#2463))
([9ec575b](9ec575b))
</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>
ddixit14 pushed a commit that referenced this pull request Feb 15, 2024
In this PR:
- Add `generate_repo.py` to generate libraries defined in a
configuration file.
  - Regenerate `.repo-metadata.json`
  - Generate `.OwlBot.yaml` and `owlbot.py` for new clients
- Invoke `generate_composed_library.py` to generate multiple versions of
a GAPIC library.
  - Apply repo-level post processing using python
    - Regenerate root `pom.xml`
    - Regenerate `gapic-libraries-bom/pom.xml`
- Format python script using `black`.
- Add unit tests for utility functions.
- Add an integration test using python, replacing shell integration
tests.
- Add a python lint check in CI.

This is [step
2](https://docs.google.com/document/d/1JiCcG3X7lnxaJErKe0ES_JkyU7ECb40nf2Xez3gWvuo/edit?pli=1&tab=t.0#bookmark=id.h3n0hcp3ch2m)
of milestone 2 of hermetic build project.
ddixit14 pushed a commit that referenced this pull request Feb 15, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.35.0</summary>

##
[2.35.0](v2.34.0...v2.35.0)
(2024-02-13)


### Features

* add `generate_repo.py`
([#2431](#2431))
([47b632a](47b632a))
* move synthtool templates to `library_generation/owlbot`
([#2443](#2443))
([5c95472](5c95472))


### Bug Fixes

* Apiary Host returns user set host if set
([#2455](#2455))
([5f17e62](5f17e62))
* Cancel the Timeout Task for HttpJson
([#2360](#2360))
([b177d9e](b177d9e))


### Dependencies

* update dependency commons-codec:commons-codec to v1.16.1
([#2473](#2473))
([8c6e91d](8c6e91d))
* update google api dependencies
([#2469](#2469))
([ad4d4e6](ad4d4e6))
* update google auth library dependencies to v1.23.0
([#2466](#2466))
([349a5d3](349a5d3))
* update google auth library dependencies to v1.23.0
([#2476](#2476))
([6c9127c](6c9127c))
* update google http client dependencies to v1.44.1
([#2467](#2467))
([87d1435](87d1435))
* update googleapis/java-cloud-bom digest to ac9893c
([#2472](#2472))
([7fff34a](7fff34a))
* update grpc dependencies to v1.61.1
([#2463](#2463))
([9ec575b](9ec575b))
</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>
lqiu96 pushed a commit that referenced this pull request Feb 28, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.35.0</summary>

##
[2.35.0](v2.34.0...v2.35.0)
(2024-02-13)


### Features

* add `generate_repo.py`
([#2431](#2431))
([47b632a](47b632a))
* move synthtool templates to `library_generation/owlbot`
([#2443](#2443))
([5c95472](5c95472))


### Bug Fixes

* Apiary Host returns user set host if set
([#2455](#2455))
([5f17e62](5f17e62))
* Cancel the Timeout Task for HttpJson
([#2360](#2360))
([b177d9e](b177d9e))


### Dependencies

* update dependency commons-codec:commons-codec to v1.16.1
([#2473](#2473))
([8c6e91d](8c6e91d))
* update google api dependencies
([#2469](#2469))
([ad4d4e6](ad4d4e6))
* update google auth library dependencies to v1.23.0
([#2466](#2466))
([349a5d3](349a5d3))
* update google auth library dependencies to v1.23.0
([#2476](#2476))
([6c9127c](6c9127c))
* update google http client dependencies to v1.44.1
([#2467](#2467))
([87d1435](87d1435))
* update googleapis/java-cloud-bom digest to ac9893c
([#2472](#2472))
([7fff34a](7fff34a))
* update grpc dependencies to v1.61.1
([#2463](#2463))
([9ec575b](9ec575b))
</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: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants