Skip to content

ci: add script to open pr to update bazel builder version#92348

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
healthy-pod:open-pr
Nov 29, 2022
Merged

ci: add script to open pr to update bazel builder version#92348
craig[bot] merged 1 commit intocockroachdb:masterfrom
healthy-pod:open-pr

Conversation

@healthy-pod
Copy link
Copy Markdown
Contributor

Release note: None
Part of: CRDB-11061

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@healthy-pod healthy-pod force-pushed the open-pr branch 24 times, most recently from d5d08c5 to c7a7417 Compare November 24, 2022 01:42
@healthy-pod healthy-pod marked this pull request as ready for review November 24, 2022 01:48
@healthy-pod healthy-pod requested a review from a team as a code owner November 24, 2022 01:48
@healthy-pod
Copy link
Copy Markdown
Contributor Author

Corresponding build config: Open New Bazel Builder Image PR

Copy link
Copy Markdown
Member

@rail rail left a comment

Choose a reason for hiding this comment

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

In overall it looks great! Just a teeny fix.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved the clone and key to a temp dir which gets cleaned at the end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or you use the absolute path when you call gh.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One more nit. Can you move the gh setup part up, so we fail early if we cannot install it for some reason.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you need to move the key under /tmp? I don't think it'll be cleaned up in this case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved it to the temp dir along with the clone

Copy link
Copy Markdown
Member

@rail rail left a comment

Choose a reason for hiding this comment

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

Sorry for missing some pieces in the first review. This is almost ready. :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One more nit. Can you move the gh setup part up, so we fail early if we cannot install it for some reason.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the suggestions above make sense, you can get rid of the mv line.

Release note: None
Part of: CRDB-11061
Copy link
Copy Markdown
Member

@rail rail left a comment

Choose a reason for hiding this comment

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

LGTM, :shipit:

@healthy-pod
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r=rail

@craig craig bot merged commit edc6fda into cockroachdb:master Nov 29, 2022
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 29, 2022

Build succeeded:

@healthy-pod healthy-pod deleted the open-pr branch December 1, 2022 23:48
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.

3 participants