Skip to content

chore(kokoro): handle missing flakybot and codecov scripts gracefully - #14793

Closed
sakthivelmanii wants to merge 7 commits into
mainfrom
chore-kokoro-sharedinstallmissinggfile
Closed

sakthivelmanii wants to merge 7 commits into
mainfrom
chore-kokoro-sharedinstallmissinggfile

Conversation

@sakthivelmanii

Copy link
Copy Markdown
Contributor

Kokoro integration jobs often share common install configurations. When run in jobs that don't declare gfile_resources for flakybot and codecov.sh (like directpath or java8), the build.sh script fails when attempting to chmod or run these missing files. This adds existence checks before execution to gracefully skip them.

Kokoro integration jobs often share common install configurations. When run in jobs that don't declare gfile_resources for flakybot and codecov.sh (like directpath or java8), the build.sh script would fail when attempting to chmod or run these missing files. This adds existence checks before execution.
@sakthivelmanii
sakthivelmanii requested a review from a team as a code owner October 27, 2026 19:38
@sakthivelmanii
sakthivelmanii enabled auto-merge (squash) October 27, 2026 19:38
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates .kokoro/build.sh to check for the existence of codecov.sh and flakybot before execution. The review feedback suggests using double brackets [[ ... ]] for safer Bash evaluation and checking if KOKORO_GFILE_DIR is set and non-empty to prevent unbound variable errors.

Comment thread .kokoro/build.sh Outdated
Comment thread .kokoro/build.sh Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the .kokoro/build.sh script to ensure that codecov.sh and the flakybot binary exist before attempting to execute them. The review feedback suggests a robust improvement to handle cases where the KOKORO_GFILE_DIR environment variable is undefined, which would cause the script to crash under set -u (nounset) mode. It is recommended to check if KOKORO_GFILE_DIR is non-empty before checking for the files.

Comment thread .kokoro/build.sh Outdated
Comment thread .kokoro/build.sh Outdated
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates .kokoro/build.sh to add safety checks ensuring that KOKORO_GFILE_DIR is set and the target scripts/binaries (codecov.sh and flakybot) exist before attempting to execute them. The feedback suggests combining the chained [[ ... ]] conditions into single [[ ... ]] blocks using the && operator for better readability and idiomatic Bash style.

Comment thread .kokoro/build.sh Outdated
Comment thread .kokoro/build.sh Outdated
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates .kokoro/build.sh to ensure that KOKORO_GFILE_DIR is defined and the target files (codecov.sh and flakybot) exist before executing them. The review feedback suggests using the fallback syntax ${KOKORO_GFILE_DIR:-} in the file existence checks to avoid potential unbound variable errors under set -u.

Comment thread .kokoro/build.sh Outdated
Comment thread .kokoro/build.sh Outdated
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the build script to check for the existence of codecov.sh and flakybot before execution. The review comments suggest adding warning logs when these tools are enabled but their files are missing, which prevents silent failures and improves CI observability.

Comment thread .kokoro/build.sh Outdated
Comment thread .kokoro/build.sh Outdated
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the robustness of .kokoro/build.sh by checking for the existence of codecov.sh and the flakybot binary in KOKORO_GFILE_DIR before attempting to execute them, and by using double brackets [[ for conditional checks. The review feedback recommends double-quoting the ${KOKORO_GFILE_DIR} variable expansions to prevent potential word splitting or globbing issues.

Comment thread .kokoro/build.sh Outdated
Comment thread .kokoro/build.sh Outdated
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the robustness of the .kokoro/build.sh script by adding checks to verify the existence of codecov.sh and the flakybot binary before executing them, along with proper variable quoting. Feedback suggests appending || true to the chmod +x command for flakybot to prevent potential build failures in environments where the filesystem is mounted as read-only.

Comment thread .kokoro/build.sh Outdated
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the .kokoro/build.sh script to add safety checks verifying that KOKORO_GFILE_DIR is defined and that the codecov.sh and flakybot files exist before attempting to run them. It also adds warning messages if these files are missing and improves shell syntax and variable quoting. There are no review comments, and I have no additional feedback to provide.

auto-merge was automatically disabled October 28, 2026 02:18

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant