-
Notifications
You must be signed in to change notification settings - Fork 61
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
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
8c4bd4a
feat: add generate_repo.py
JoeWang1127 f4bccaa
refactor model
JoeWang1127 b2b3fe4
refactor
JoeWang1127 e804991
add private methods
JoeWang1127 737dbbd
change config file
JoeWang1127 362fc27
refactor to download repo only once
JoeWang1127 a8cd899
use absolute path
JoeWang1127 449f3d5
do not remove files as owlbot cli will take care of it
JoeWang1127 ae4726c
move pre generation to utilities
JoeWang1127 c134ebf
remove new-client scripts
JoeWang1127 23e4732
move api download function to utilities
JoeWang1127 f853130
add helper function
JoeWang1127 1478e4e
fix unit tests
JoeWang1127 cd90e04
add copyright
JoeWang1127 5b60d25
refactor
JoeWang1127 997cff5
regenerate root pom.xml
JoeWang1127 6894a55
generate gapic libraries bom using python
JoeWang1127 99afa38
Merge branch 'main' into feat/generate_repo
JoeWang1127 a7b210a
add unit tests
JoeWang1127 d3bc0f6
add unit tests
JoeWang1127 1edbb21
do not pull git repository
JoeWang1127 0d14629
add unit test
JoeWang1127 b7c6728
refactor
JoeWang1127 e76647c
remove irrelevant test data
JoeWang1127 ec8d51e
do not use enum
JoeWang1127 818e3a9
use apigeeconnect in yaml
JoeWang1127 42cc2ee
remove customized constructor
JoeWang1127 d9fe30c
add get_library_name
JoeWang1127 b047df7
separate cli and logic
JoeWang1127 21fa068
code format
JoeWang1127 f7613c1
add integration test
JoeWang1127 90385b1
remove shell integration test
JoeWang1127 3423183
code format
JoeWang1127 5338681
use git, rather than subprocess
JoeWang1127 63a7a48
remove pyenv
JoeWang1127 4ee961f
add unit tests
JoeWang1127 c2b7b21
change workflow
JoeWang1127 9c583cf
set git user
JoeWang1127 5bdd2c6
restore mvn command
JoeWang1127 4d0f70a
add issue_tracker to LibraryConfig
JoeWang1127 066af7f
add api_reference to LibraryConfig
JoeWang1127 e30f5c1
compare generation result in integration test
JoeWang1127 d1022fb
surpress mvn output
JoeWang1127 342df91
only generate .repo-metadat.json once
JoeWang1127 7cfd7c3
create library_path if it's not exist
JoeWang1127 047e250
remove destination path in GeneratationConfig
JoeWang1127 2d71f54
remove destination path in GeneratationConfig
JoeWang1127 9416899
add unit tests
JoeWang1127 f948f31
remove delete_if_exists
JoeWang1127 ab2d103
add log
JoeWang1127 ce12090
change assert
JoeWang1127 0610047
handle special cases in gapic-libraries-bom/pom.xml
JoeWang1127 984bc83
refactor compre_poms.py
JoeWang1127 2535b16
compare gapic-libraries-bom/pom.xml and pom.xml in integration test
JoeWang1127 14e1c92
Revert "compare gapic-libraries-bom/pom.xml and pom.xml in integratio…
JoeWang1127 1c2d9c1
compare pom.xml in integration test
JoeWang1127 2aad329
format config file
JoeWang1127 5adf0ee
covert transport
JoeWang1127 b9a717c
enable diff_files
JoeWang1127 2e0f3a9
refactor according to code review
JoeWang1127 2c0f9b2
code format
JoeWang1127 e592f71
code format
JoeWang1127 369ca21
add python linter
JoeWang1127 c17d321
change job name
JoeWang1127 a0dc4cb
Merge branch 'main' into feat/generate_repo
JoeWang1127 0e2f22b
Merge branch 'main' into feat/generate_repo
JoeWang1127 c1ef755
bring back config for java-bigtable
JoeWang1127 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,7 @@ jobs: | |
strategy: | ||
matrix: | ||
java: [ 11 ] | ||
os: [ ubuntu-22.04, macos-12 ] | ||
post_processing: [ 'true', 'false' ] | ||
runs-on: ${{ matrix.os }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
|
@@ -45,35 +43,13 @@ jobs: | |
pushd library_generation | ||
pip install -r requirements.in | ||
popd | ||
|
||
- name: install utils (macos) | ||
if: matrix.os == 'macos-12' | ||
shell: bash | ||
run: | | ||
brew update --preinstall | ||
# we need the `realpath` command to be available | ||
brew install coreutils | ||
- name: install docker (ubuntu) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to install docker because it's included in ubuntu-22.04 |
||
if: matrix.os == 'ubuntu-22.04' | ||
shell: bash | ||
run: | | ||
set -x | ||
# install docker | ||
sudo apt install containerd -y | ||
sudo apt install -y docker.io docker-compose | ||
|
||
# launch docker | ||
sudo systemctl start docker | ||
- name: Run integration tests | ||
# we don't run ITs with postprocessing on macos because one of its dependencies "synthtool" is designed to run on linux only | ||
if: matrix.os == 'ubuntu-22.04' || matrix.post_processing == 'false' | ||
shell: bash | ||
run: | | ||
set -x | ||
git config --global user.email "github-workflow@github.com" | ||
git config --global user.name "Github Workflow" | ||
library_generation/test/generate_library_integration_test.sh \ | ||
--googleapis_gen_url https://cloud-java-bot:${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}@github.com/googleapis/googleapis-gen.git \ | ||
--enable_postprocessing "${{ matrix.post_processing }}" | ||
python -m unittest library_generation/test/integration_tests.py | ||
unit_tests: | ||
strategy: | ||
matrix: | ||
|
@@ -106,7 +82,7 @@ jobs: | |
run: | | ||
set -x | ||
python -m unittest library_generation/test/unit_tests.py | ||
lint: | ||
lint-shell: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -116,3 +92,20 @@ jobs: | |
scandir: 'library_generation' | ||
format: tty | ||
severity: error | ||
lint-python: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: install python dependencies | ||
shell: bash | ||
run: | | ||
set -ex | ||
pushd library_generation | ||
pip install -r requirements.in | ||
popd | ||
- name: Lint | ||
shell: bash | ||
run: | | ||
# exclude generated golden files | ||
# exclude owlbot until further refaction | ||
black --check library_generation --exclude "(library_generation/owlbot)|(library_generation/test/resources/goldens)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use
black
to format python code and it also has a validate function.Sure, I'll add a lint step in CI.
This tool is included when I install all requirements.
There was a problem hiding this comment.
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.