Skip to content
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

Optimize the permissions check script to only fix the current pipeline’s build dir #340

Merged
merged 1 commit into from Sep 8, 2017

Conversation

toolmantim
Copy link
Contributor

Currently the fix-buildkite-agent-builds-permissions script, that's run by our environment hook, chown's the agent’s entire builds directory on every job run. This means the chown operation gets slower every time a different pipeline is checked out onto disk.

This PR changes the permissions fixing script to chown only the running pipeline’s checkout dir (if it exists), rather than the entire builds dir. The permissions tests have also been moved from the comment in the bottom of the file into their own executable .bats tests.

@toolmantim toolmantim requested a review from lox September 8, 2017 07:17
@toolmantim toolmantim force-pushed the only-fix-permissions-on-the-build-dir branch from 57c26d6 to 7992501 Compare September 8, 2017 07:19
@lox
Copy link
Contributor

lox commented Sep 8, 2017

Looks legit to me! I wish I could remember why we didn't do this in the first place.

@toolmantim toolmantim force-pushed the only-fix-permissions-on-the-build-dir branch 2 times, most recently from 5428dc8 to 9c21039 Compare September 8, 2017 07:21
Currently the fix-buildkite-agent-builds-permissions script, that's run by our
environment hook, chown's the agent’s entire builds directory on every job run.
This means the chown operation gets slower every time a different pipeline is
checked out onto disk.

This changes the permissions fixing script to chown only the running
pipeline’s checkout dir (if it exists), rather than the entire builds dir. The
permissions tests have also been moved from the comment in the bottom of the
file into their own executable .bats tests.
@toolmantim toolmantim force-pushed the only-fix-permissions-on-the-build-dir branch from 9c21039 to 03c6d98 Compare September 8, 2017 09:09
@toolmantim toolmantim merged commit 8e1b2ca into master Sep 8, 2017
@toolmantim toolmantim deleted the only-fix-permissions-on-the-build-dir branch September 8, 2017 10:34
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.

None yet

2 participants