You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement step-wise caching for batch spec execution (#540)
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.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@ All notable changes to `src-cli` are documented in this file.
15
15
16
16
### Changed
17
17
18
+
-`src batch [apply|preview]` now cache the results of each step when executing a batch spec. That can make re-execution a lot faster when only a subset of the steps has been changed. [#540](https://github.com/sourcegraph/src-cli/pull/540)
0 commit comments