-
Notifications
You must be signed in to change notification settings - Fork 64
feat: move synthtool templates to library_generation/owlbot
#2443
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
ba38e9c
transfer templates from synthtool to owlbot
diegomarquezp 37af910
use locally hosted templates
diegomarquezp 9e9e743
fix regex parsing
diegomarquezp d2a8ca4
update protobuf and generator versions in IT
diegomarquezp 2cb0a31
minor fixes
diegomarquezp e1c262d
install synthtool for unit tests
diegomarquezp 79b41bc
use repo level googleapis commitish for kms
diegomarquezp 7d6dabc
comment fixes
diegomarquezp 7c503c9
Update library_generation/owlbot/bin/entrypoint.sh
diegomarquezp 5587d0f
use config yaml to compute exclusions
diegomarquezp 65d8ef9
remove unused __init__.py files
diegomarquezp a0b0cfd
Merge remote-tracking branch 'origin/move-synthtool-templates' into m…
diegomarquezp b980b88
remove owlbot.py check in template rendering postprocessing step
diegomarquezp f2cd5bf
add comment for setup.py
diegomarquezp f416b4c
remove unit test
diegomarquezp 8d348a4
simplify module processing script
diegomarquezp 9c778f6
update googleapis commitish
diegomarquezp dbecc0e
update googleapis commitish ii
diegomarquezp a17d36a
Merge remote-tracking branch 'origin/main' into move-synthtool-templates
diegomarquezp 07bc35f
Merge remote-tracking branch 'origin/main' into move-synthtool-templates
diegomarquezp 2539e1e
post-merge fixes
diegomarquezp 560644c
fix unit tests
diegomarquezp e0aade6
delete generated goldens
diegomarquezp 1663a0f
restore necessary golden files
diegomarquezp 0fb4b7e
snippet bot to ignore templates
diegomarquezp ccfee71
fix snippet bot ii
diegomarquezp 07ea2a6
fix snippet bot iii
diegomarquezp b38f755
use full path to conflicting pomxml
diegomarquezp 0e8b19e
use full path to actual conflicting pomxml
diegomarquezp f4e7867
lint
diegomarquezp f86635d
install lirbary_generation python package via setup.py
diegomarquezp 02bac22
include owlbot python sources in python lint check
diegomarquezp e540631
lint owlbot
diegomarquezp 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
This script parses an owlbot.py file, specifically the call to `java.common_templates` in | ||
order to extract the excluded files so it can be called with a custom template path | ||
pointing to the templates hosted in `sdk-platform-java/library_generation/owlbot/templates`. | ||
Briefly, this wraps the call to synthtool's common templates using a custom template folder. | ||
""" | ||
|
||
import os | ||
import sys | ||
from collections.abc import Sequence | ||
from synthtool.languages.java import common_templates | ||
from pathlib import Path | ||
from library_generation.model.generation_config import from_yaml | ||
|
||
script_dir = os.path.dirname(os.path.realpath(__file__)) | ||
repo_templates_path = os.path.join(script_dir, "..", "templates", "java_library") | ||
|
||
|
||
def apply_repo_templates(configuration_yaml_path: str, monorepo: bool) -> None: | ||
config = from_yaml(configuration_yaml_path) | ||
print(f"repo_templates_path: {repo_templates_path}") | ||
print(f"excludes: {config.template_excludes}") | ||
common_templates( | ||
excludes=config.template_excludes, | ||
template_path=Path(repo_templates_path), | ||
monorepo=monorepo, | ||
) | ||
|
||
|
||
def main(argv: Sequence[str]) -> None: | ||
if len(argv) != 3: | ||
raise ValueError( | ||
"Usage: python apply-repo-templates.py configuration_yaml_path monorepo" | ||
) | ||
|
||
configuration_yaml_path = argv[1] | ||
monorepo = argv[2] | ||
apply_repo_templates(configuration_yaml_path, monorepo.lower() == "true") | ||
|
||
|
||
if __name__ == "__main__": | ||
main(sys.argv) |
This file contains hidden or 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.
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.
Why do we need this line?
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.
#2443 (comment) has the context. Basically the region tag check thinks that template has a region tag (wrong). I'm yet to get a response from the automation team