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

Support a way to skip implied get after put. #8492

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions atc/builds/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ func (visitor *planVisitor) VisitPut(step *atc.PutStep) error {

plan.Put.TypeImage = visitor.resourceTypes.ImageForType(plan.ID, resource.Type, step.Tags, visitor.manuallyTriggered)

if step.NoGet {
visitor.plan = plan
return nil
}

dependentGetPlan := visitor.planFactory.NewPlan(atc.GetPlan{
Type: resource.Type,
Name: logicalName,
Expand Down
71 changes: 71 additions & 0 deletions atc/builds/planner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,77 @@ var factoryTests = []PlannerTest{
}
}`,
},
{
Title: "put step with no_get",
Config: &atc.PutStep{
Name: "some-name",
Resource: "some-resource",
Params: atc.Params{"some": "params"},
Tags: atc.Tags{"tag-1", "tag-2"},
Inputs: &atc.InputsConfig{All: true},
NoGet: true,
},
Inputs: []db.BuildInput{
{
Name: "some-name",
Version: atc.Version{"some": "version"},
},
},
ManuallyTriggered: true,
CompareIDs: true,
PlanJSON: `{
"id": "1",
"put": {
"name": "some-name",
"type": "some-resource-type",
"resource": "some-resource",
"source": {
"some": "source",
"default-key": "default-value"
},
"params": {"some":"params"},
"tags": ["tag-1", "tag-2"],
"inputs": "all",
"image": {
"base_type": "some-base-resource-type",
"check_plan": {
"id": "1/image-check",
"check": {
"name": "some-resource-type",
"type": "some-base-resource-type",
"resource_type": "some-resource-type",
"source": { "some": "type-source" },
"image": {
"base_type": "some-base-resource-type"
},
"interval": "1m0s",
"skip_interval": true,
"tags": [
"tag-1",
"tag-2"
]
}
},
"get_plan": {
"id": "1/image-get",
"get": {
"name": "some-resource-type",
"type": "some-base-resource-type",
"source": { "some": "type-source" },
"image": {
"base_type": "some-base-resource-type"
},
"version_from": "1/image-check",
"tags": [
"tag-1",
"tag-2"
]
}
}
}
}
}`,
},
{
Title: "task step",

Expand Down
1 change: 1 addition & 0 deletions atc/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ type PutStep struct {
Tags Tags `json:"tags,omitempty"`
GetParams Params `json:"get_params,omitempty"`
Timeout string `json:"timeout,omitempty"`
NoGet bool `json:"no_get,omitempty"`
}

func (step *PutStep) ResourceName() string {
Expand Down