Implement step-wise caching for batch spec execution#540
Merged
Conversation
bc5d5e5 to
e54bfd6
Compare
LawnGnome
reviewed
May 26, 2021
| +++ new-file.txt | ||
| @@ -0,0 +1,2 @@ | ||
| +check this out. this is a new file. | ||
| +written on a computer. what a blast. |
LawnGnome
approved these changes
May 26, 2021
LawnGnome
left a comment
Contributor
There was a problem hiding this comment.
(I swear I hit approved.)
courier-new
reviewed
May 26, 2021
courier-new
left a comment
Contributor
There was a problem hiding this comment.
This is SO COOL to see coming together!! Most of my comments here are just learning questions. 🙂
mrnugget
added a commit
that referenced
this pull request
May 26, 2021
This is a tiny follow-up to #540 and removes the TODO that Adam confirmed in his review.
mrnugget
added a commit
that referenced
this pull request
May 27, 2021
This is a tiny follow-up to #540 and removes the TODO that Adam confirmed in his review.
scjohns
pushed a commit
that referenced
this pull request
Apr 24, 2023
This adds step-wise caching for the execution of batch specs.
In short, given a batch spec that contains the following
```yaml
on:
- repository: github.com/sourcegraph/automation-testing
- repository: github.com/sourcegraph-testing/mkcert
steps:
- run: echo "this is step 1" >> caching.txt
container: alpine:3
- run: echo "this is step 2" >> README.md
container: alpine:3
- run: echo "this is step 3" >> README.md
container: alpine:3
outputs:
myOutput:
value: "what is up"
- run: echo "this is step 4" >> caching.txt
if: ${{ eq repository.name "github.com/sourcegraph/automation-testing" }}
container: alpine:3
```
this PR would cause `src` to cache the results _per step and per repository.
In practice, this means that if we would change the batch spec from the above so it would look like this
```yaml
steps:
- run: echo "this is step 0" >> caching.txt
container: alpine:3
- run: echo "this is step 1" >> README.md
container: alpine:3
# vvvv LOOK HERE vvv
- run: echo "this is step 2 WITH A CHANGE" >> README.md
container: alpine:3
outputs:
myOutput:
value: "what is up"
- run: echo "this is step 3" >> caching.txt
if: ${{ eq repository.name "github.com/sourcegraph/automation-testing" }}
container: alpine:3
```
and we'd then re-execute the batch spec, **the steps 0 and 1 would not need to be re-executed**. Only step 2 would need to be re-executed for both repositories and step 3 would only need to be re-executed for both repositories.
scjohns
pushed a commit
that referenced
this pull request
Apr 24, 2023
This is a tiny follow-up to #540 and removes the TODO that Adam confirmed in his review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds step-wise caching for the execution of batch specs.
In short, given a batch spec that contains the following
this PR would cause
srcto cache the results _per step and per repository.In practice, this means that if we would change the batch spec from the above so it would look like this
and we'd then re-execute the batch spec, the steps 0 and 1 would not need to be re-executed. Only step 2 would need to be re-executed for both repositories and step 3 would only need to be re-executed for both repositories.