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

Allow block step #9

Merged
merged 3 commits into from
Oct 23, 2023
Merged

Allow block step #9

merged 3 commits into from
Oct 23, 2023

Conversation

gmenih
Copy link
Contributor

@gmenih gmenih commented Oct 18, 2023

Block step was not allowed in .jobsworth.yml, because Jobsworth automatically adds the env and agents fields to every step, which are invalid fields for the block step.

pipeline.go Outdated
// Block and wait steps must not contains agents or env, so we return early here
_, hasBlockStep := step["block"]
_, hasWaitStep := step["wait"]
if hasBlockStep || hasWaitStep {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would call it isBlockStep and isWaitStep rather than hasBlockStep and hasWaitStep.

pipeline_test.go Outdated
t.Error("lowerStep returned err:", err)
}
if !reflect.DeepEqual(step["env"], nil) {
t.Errorf("env should not be set for a wait step")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
t.Errorf("env should not be set for a wait step")
t.Errorf("env should not be set for a block step")

pipeline_test.go Outdated
t.Errorf("env should not be set for a wait step")
}
if !reflect.DeepEqual(step["agents"], nil) {
t.Errorf("agents should not be set for a wait step")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
t.Errorf("agents should not be set for a wait step")
t.Errorf("agents should not be set for a block step")

@gmenih gmenih merged commit 35a2785 into saymedia:master Oct 23, 2023
2 checks passed
@gmenih gmenih self-assigned this Oct 23, 2023
@gmenih gmenih deleted the feat/allow-block-step branch October 23, 2023 08:48
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.

3 participants