-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update "meta" job to skip "Sources" if sources.json
is already up-to-date
#8
Conversation
For reference, merging docker-library/meta#10 took our "Sources" stage from ~2m30s up to ~3m20s and this change would bring it back down to milliseconds for any run that can prove that it doesn't have to actually update |
Ok, this is implemented now too. |
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.
LGTM, just one question.
Jenkinsfile.update
Outdated
# only commit submodule updates if our JSON has changed (see https://github.com/docker-library/meta-scripts/pull/8) | ||
if ! git diff --exit-code sources.json builds.json; then | ||
git add -A . | ||
git commit -m 'Update and regenerate' || : |
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 is it okay if the commit fails?
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.
git commit
fails if there's nothing to commit, which is fair (and git push
will automatically be a no-op in that case)
Now that I'm gating this on JSON files having changes, we should probably let git commit
failing fail the build instead, so that's a good call-out 👍
There's another edge case here that means we no-op regenerated this file all night long. If there are changes to I thought about this one while writing it, and my conclusion was that it's probably OK to ignore this for now because it will improve over time as we add more images and it becomes more likely that changes to That being said, we could try harder here to resolve this, if we wanted to. We could get more specific about which things changing in A simpler option would be record in another file which commit of While typing this, that compromise seems pretty reasonable, so I'll probably work on that later today. 😅 |
The contents of
sources.json
should be really static unless something in the scripts or the upstream sources has changed, so we only need to pay that multi-minute cost in cases where the scripts or source data has actually changed.There are possibly edge cases here where these upstream things have changed and
sources.json
hasn't/won't. 🤔However, this is strictly better than the current state where we just run it all the time.
I think we could probably avoid some of the other edge cases by having this whole script only commit updates to our
.doi
and.scripts
submodules ifsources.json
orbuilds.json
actually have changes. 🤔