chore(java): add a note in README for migrated split repos#1687
chore(java): add a note in README for migrated split repos#1687suztomo merged 34 commits intogoogleapis:masterfrom
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 |
| kwargs["monorepo"] = os.environ.get("MONOREPO") == "true" | ||
| kwargs["split_repo"] = os.environ.get("MONOREPO") != "true" |
There was a problem hiding this comment.
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.
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.
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.
Consider moving this logic to the template variable collector
There was a problem hiding this comment.
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