-
Notifications
You must be signed in to change notification settings - Fork 86
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
chore(java): add a note in README for migrated split repos #1687
chore(java): add a note in README for migrated split repos #1687
Conversation
Disable renovate bot and flaky bot for split repositories that have moved to the Java monorepo.
Kokoro failed |
|
Why is yoshi-java not sufficient approvers? It's because this pull request touches synthtool/languages/java.py and this file is not covered by yoshi-java team https://github.com/googleapis/synthtool/blob/master/.github/CODEOWNERS |
synthtool/gcp/templates/java_library/.github/ISSUE_TEMPLATE/bug_report.md
Outdated
Show resolved
Hide resolved
synthtool/languages/java.py
Outdated
kwargs["monorepo"] = os.environ.get("MONOREPO") == "true" | ||
kwargs["split_repo"] = os.environ.get("MONOREPO") != "true" |
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.
Reading environment variables in the logic feels error prone. It feels like this should value should be explicitly provided to this function
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.
The challenge is that this java.common_templates()
method is called owlbot.py in individual repositories, not the shell script.
To address your concern, I think of providing a keyword argument to java.common_templates()
method in owlbot.py:
suztomo@suztomo:~/java-aiplatform$ git diff
diff --git a/owlbot.py b/owlbot.py
index cac43dbb..0dc60a13 100644
--- a/owlbot.py
+++ b/owlbot.py
@@ -27,5 +27,6 @@ java.common_templates(
".kokoro/nightly/samples.cfg",
".kokoro/presubmit/samples.cfg",
".github/CODEOWNERS"
- ]
+ ],
+ migrated_split_repo=True
)
This requires me to edit all owlbot.py in ~120 repositories. (feasible but time-consuming)
Do you think of a better way to detect whether the postprocessor is processing monorepo in this Python script?
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.
Rather than modifying owlbot.py in ~120 split repositories, passing a special value for 1 monorepo is easy. I'll go for this path.
{ | ||
"extends": [ | ||
{% if metadata['repo']['library_type'] == 'GAPIC_AUTO' | ||
or (metadata['repo']['repo_short'] and metadata['repo']['repo_short'] in ['java-translate', 'java-dns', 'java-notification', 'java-resourcemanager']) |
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.
Consider moving this logic to the template variable collector
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.
Moved to migrated_split_repo
variable in java.py.
@SurferJeffAtGoogle PTAL |
The requested part has been addressed
It also disables renovate bot and flaky bot for split repositories that have moved to the Java monorepo.
The changes I tested with java-aiplatform (README change) and java-storage (no op) repositories: https://gist.github.com/suztomo/dcea792f5ad2aca03d5b315c46b602a8
Diff as a pull request : googleapis/java-aiplatform#1115