-
Notifications
You must be signed in to change notification settings - Fork 68
chore(hermetic-build): include .github template updates as part of generation #3723
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 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1bb6936
chore(hermetic-build): include .kokoro and .github templates
diegomarquezp 4a59a65
update graal configs
diegomarquezp c25a14a
include universe domain changes
diegomarquezp 56c6f1c
Revert "include universe domain changes"
diegomarquezp a2effdc
remove single line unwanted templates
diegomarquezp 364b79f
adapt to linter
diegomarquezp df9a033
use xtrace on local setups
diegomarquezp c908f7b
use abstract path to jar in instructions
diegomarquezp 755c0de
restore .kokoro folder
diegomarquezp cb5a1ca
do not update .kokoro templates for now
diegomarquezp b66af92
remove CODEOWNERS template
diegomarquezp 88e6edb
chore: include cloud-java-bot in ignored authors of generated files
diegomarquezp b136655
format setup.py
diegomarquezp b9a7d01
Merge branch 'main' into fix-template-updates
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
12 changes: 12 additions & 0 deletions
12
...ic_build/library_generation/owlbot/templates/java_library/.github/generated-files-bot.yml
suztomo marked this conversation as resolved.
Show resolved
Hide resolved
|
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,12 @@ | ||
| externalManifests: | ||
| - type: json | ||
| file: 'synth.metadata' | ||
| jsonpath: '$.generatedFiles[*]' | ||
| - type: json | ||
| file: '.github/readme/synth.metadata/synth.metadata' | ||
| jsonpath: '$.generatedFiles[*]' | ||
| ignoreAuthors: | ||
| - 'renovate-bot' | ||
| - 'yoshi-automation' | ||
| - 'release-please[bot]' | ||
| - 'gcf-owl-bot[bot]' |
18 changes: 18 additions & 0 deletions
18
hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/build.bat
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,18 @@ | ||
| :: Copyright 2022 Google LLC | ||
| :: | ||
| :: Licensed under the Apache License, Version 2.0 (the "License"); | ||
| :: you may not use this file except in compliance with the License. | ||
| :: You may obtain a copy of the License at | ||
| :: | ||
| :: http://www.apache.org/licenses/LICENSE-2.0 | ||
| :: | ||
| :: Unless required by applicable law or agreed to in writing, software | ||
| :: distributed under the License is distributed on an "AS IS" BASIS, | ||
| :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| :: See the License for the specific language governing permissions and | ||
| :: limitations under the License. | ||
| :: Github action job to test core java library features on | ||
| :: downstream client libraries before they are released. | ||
| :: See documentation in type-shell-output.bat | ||
|
|
||
| "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh |
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
37 changes: 37 additions & 0 deletions
37
hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/coerce_logs.sh
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,37 @@ | ||
| #!/bin/bash | ||
| # Copyright 2019 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # This script finds and moves sponge logs so that they can be found by placer | ||
| # and are not flagged as flaky by sponge. | ||
|
|
||
| set -eo pipefail | ||
|
|
||
| ## Get the directory of the build script | ||
| scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) | ||
| ## cd to the parent directory, i.e. the root of the git repo | ||
| cd ${scriptDir}/.. | ||
|
|
||
| job=$(basename ${KOKORO_JOB_NAME}) | ||
|
|
||
| echo "coercing sponge logs..." | ||
| for xml in `find . -name *-sponge_log.xml` | ||
| do | ||
| class=$(basename ${xml} | cut -d- -f2) | ||
| dir=$(dirname ${xml})/${job}/${class} | ||
| text=$(dirname ${xml})/${class}-sponge_log.txt | ||
| mkdir -p ${dir} | ||
| mv ${xml} ${dir}/sponge_log.xml | ||
| mv ${text} ${dir}/sponge_log.txt | ||
| done |
16 changes: 5 additions & 11 deletions
16
hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/common.cfg
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 |
|---|---|---|
| @@ -1,19 +1,13 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Download trampoline resources. | ||
| # Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
|
||
| # Use the trampoline script to run in docker. | ||
| build_file: "synthtool/.kokoro/trampoline.sh" | ||
|
|
||
| # Configure the docker image for kokoro-trampoline. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_IMAGE" | ||
| value: "gcr.io/cloud-devrel-kokoro-resources/python" | ||
| } | ||
| # All builds use the trampoline script to run in docker. | ||
| build_file: "{{ metadata['repo']['repo_short'] }}/.kokoro/trampoline.sh" | ||
|
|
||
| # Tell the trampoline which build file to use. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_BUILD_FILE" | ||
| value: "github/synthtool/.kokoro/build.sh" | ||
| key: "TRAMPOLINE_BUILD_FILE" | ||
| value: "github/{{ metadata['repo']['repo_short'] }}/.kokoro/build.sh" | ||
| } |
60 changes: 60 additions & 0 deletions
60
hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/common.sh
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,60 @@ | ||
| #!/bin/bash | ||
| # Copyright 2020 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| function retry_with_backoff { | ||
| attempts_left=$1 | ||
| sleep_seconds=$2 | ||
| shift 2 | ||
| command=$@ | ||
|
|
||
|
|
||
| # store current flag state | ||
| flags=$- | ||
|
|
||
| # allow a failures to continue | ||
| set +e | ||
| ${command} | ||
| exit_code=$? | ||
|
|
||
| # restore "e" flag | ||
| if [[ ${flags} =~ e ]] | ||
| then set -e | ||
| else set +e | ||
| fi | ||
|
|
||
| if [[ $exit_code == 0 ]] | ||
| then | ||
| return 0 | ||
| fi | ||
|
|
||
| # failure | ||
| if [[ ${attempts_left} -gt 0 ]] | ||
| then | ||
| echo "failure (${exit_code}), sleeping ${sleep_seconds}..." | ||
| sleep ${sleep_seconds} | ||
| new_attempts=$((${attempts_left} - 1)) | ||
| new_sleep=$((${sleep_seconds} * 2)) | ||
| retry_with_backoff ${new_attempts} ${new_sleep} ${command} | ||
| fi | ||
|
|
||
| return $exit_code | ||
| } | ||
|
|
||
| ## Helper functionss | ||
| function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } | ||
| function msg() { println "$*" >&2; } | ||
| function println() { printf '%s\n' "$(now) $*"; } | ||
|
|
||
| ## Helper comment to trigger updated repo dependency release |
1 change: 0 additions & 1 deletion
1
hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/continuous.cfg
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
...etic_build/library_generation/owlbot/templates/java_library/.kokoro/continuous/common.cfg
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,25 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Build logs will be here | ||
| action { | ||
| define_artifacts { | ||
| regex: "**/*sponge_log.xml" | ||
| regex: "**/*sponge_log.txt" | ||
| } | ||
| } | ||
|
|
||
| # Download trampoline resources. | ||
| gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
|
||
| # Use the trampoline script to run in docker. | ||
| build_file: "{{ metadata['repo']['repo_short'] }}/.kokoro/trampoline.sh" | ||
|
|
||
| env_vars: { | ||
| key: "TRAMPOLINE_BUILD_FILE" | ||
| value: "github/{{ metadata['repo']['repo_short'] }}/.kokoro/build.sh" | ||
| } | ||
|
|
||
| env_vars: { | ||
| key: "JOB_TYPE" | ||
| value: "test" | ||
| } |
12 changes: 12 additions & 0 deletions
12
hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/continuous/java8.cfg
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,12 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Configure the docker image for kokoro-trampoline. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_IMAGE" | ||
| value: "gcr.io/cloud-devrel-kokoro-resources/java8" | ||
| } | ||
|
|
||
| env_vars: { | ||
| key: "REPORT_COVERAGE" | ||
| value: "true" | ||
| } |
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.
Why would rerun the same command can solve the permission issue?
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.
npm linkhas effect in the current shell session. My guess is that what's in an old session may get its permissions overriden.