ci: add script to open pr to update bazel builder version#92348
ci: add script to open pr to update bazel builder version#92348craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
d5d08c5 to
c7a7417
Compare
|
Corresponding build config: Open New Bazel Builder Image PR |
rail
left a comment
There was a problem hiding this comment.
In overall it looks great! Just a teeny fix.
There was a problem hiding this comment.
Can you use a temp directory (mktemp -d) instead of hardcoded /tmp/cocroach for a few reasons:
- harder to predict (and attack)
- no need to rely on absence of the directory - you would need to make sure it doesn't exist or empty before cloning - otherwise git fails.
Also, can you rm -rf that directory, so we clean after it's done. Maybe add all needed cleanup command to a function and trap it? But we should be careful using trap - IIRC there is one already sourced, and only one can be used.
There was a problem hiding this comment.
Moved the clone and key to a temp dir which gets cleaned at the end
build/teamcity/internal/cockroach/build/ci/open-new-bazel-builder-image-pr.sh
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Or you use the absolute path when you call gh.
There was a problem hiding this comment.
One more nit. Can you move the gh setup part up, so we fail early if we cannot install it for some reason.
There was a problem hiding this comment.
Why do you need to move the key under /tmp? I don't think it'll be cleaned up in this case.
There was a problem hiding this comment.
Moved it to the temp dir along with the clone
rail
left a comment
There was a problem hiding this comment.
Sorry for missing some pieces in the first review. This is almost ready. :)
build/teamcity/internal/cockroach/build/ci/open-new-bazel-builder-image-pr.sh
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
One more nit. Can you move the gh setup part up, so we fail early if we cannot install it for some reason.
build/teamcity/internal/cockroach/build/ci/open-new-bazel-builder-image-pr.sh
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I don't think this command is going to work, because the key lives in a different spot now.
I have a suggestion. How about using GIT_SSH_COMMAND="ssh -i $dir/.cockroach-teamcity-key" git "$@" instead. This way you don't need to move the key anywhere.
There was a problem hiding this comment.
If the suggestions above make sense, you can get rid of the mv line.
Release note: None Part of: CRDB-11061
|
TFTR! bors r=rail |
|
Build succeeded: |
Release note: None
Part of: CRDB-11061