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

Extend schema to allow conditional execution of steps #20399

Merged
merged 3 commits into from
May 5, 2021

Conversation

mrnugget
Copy link
Contributor

@mrnugget mrnugget commented Apr 26, 2021

Required schema changes for sourcegraph/src-cli#520

@mrnugget mrnugget force-pushed the mrn/schema-conditional-execution branch 2 times, most recently from 4bd1326 to 8eda415 Compare May 3, 2021 07:27
@mrnugget mrnugget force-pushed the mrn/schema-conditional-execution branch from adddb23 to ad3b106 Compare May 4, 2021 10:36
@mrnugget mrnugget marked this pull request as ready for review May 4, 2021 11:38
@mrnugget mrnugget requested a review from a team May 4, 2021 11:39
schema/batch_spec.schema.json Show resolved Hide resolved
schema/batch_spec.schema.json Show resolved Hide resolved
Copy link
Contributor

@chrispine chrispine left a comment

Choose a reason for hiding this comment

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

LGTM

@mrnugget mrnugget enabled auto-merge (squash) May 5, 2021 12:11
@mrnugget mrnugget force-pushed the mrn/schema-conditional-execution branch from 057cec0 to 9c3cc9a Compare May 5, 2021 12:17
@mrnugget mrnugget merged commit 9e07fe7 into main May 5, 2021
@mrnugget mrnugget deleted the mrn/schema-conditional-execution branch May 5, 2021 12:28
mrnugget added a commit to sourcegraph/src-cli that referenced this pull request May 6, 2021
This extends the schema of the batch spec `steps` to add a new field:

- `if: <string that can use templating to evaluate to "true" or "false">`

(the corresponding schema changes `sourcegraph/sourcegraph` are here: sourcegraph/sourcegraph#20399)

`if:` is evaluated in a best-effort partial-evaluation manner before the execution of the `steps`. If we can statically evaluate it, we use the result of that evaluation to build a per-repository/per-workspace list of tasks, which increases cache utilisation.

See the comments in `partial_eval.go` for more details.

It also extends the `StepContext` in the templates to have the `steps.{added,modified,deleted}_files` and `steps.path` fields.
scjohns pushed a commit to sourcegraph/src-cli that referenced this pull request Apr 24, 2023
This extends the schema of the batch spec `steps` to add a new field:

- `if: <string that can use templating to evaluate to "true" or "false">`

(the corresponding schema changes `sourcegraph/sourcegraph` are here: sourcegraph/sourcegraph#20399)

`if:` is evaluated in a best-effort partial-evaluation manner before the execution of the `steps`. If we can statically evaluate it, we use the result of that evaluation to build a per-repository/per-workspace list of tasks, which increases cache utilisation.

See the comments in `partial_eval.go` for more details.

It also extends the `StepContext` in the templates to have the `steps.{added,modified,deleted}_files` and `steps.path` fields.
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

4 participants