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
{{ message }}
Repository navigation
Fly cannot delete Instanced Pipelines with Special Characters #8725
Either I should not be allowed to create a pipeline instance that contains commas, or there should be a documented way to delete it through fly.
Double-quoting or using escape characters should also allow me to delete it.
Actual results
fly -t my-team destroy-pipeline --pipeline my-group/env:"prod,staging,dev"
!!! this will remove all data for pipeline `my-group/env:prod`
fly -t my-team destroy-pipeline --pipeline my-group/env:"prod\,staging\,dev"
!!! this will remove all data for pipeline `my-group/env:prod\\`
tom@nix:~/concourse$ fly -t my-team destroy-pipeline --pipeline my-group/env:prod
!!! this will remove all data for pipeline `my-group/env:prod`
are you sure? [yN]: y
`my-group/env:prod` deleted
Special character names don't:
tom@nix:~/concourse$ fly -t my-team destroy-pipeline --pipeline my-group/env:\"prod,staging,dev\"
!!! this will remove all data for pipeline `my-group/env:"prod,staging,dev"`
are you sure? [yN]: y
`my-group/env:"prod,staging,dev"` does not exist
There is a hack to remove the pipeline, you have to use the concourse api directly.
Let's say you created a pipeline named test/pipeline:aaa,bbb for team test. First you need to encode the pipeline name: test%2Fpipeline%3Aaaa%2Cbbb. Then you need to call the API directly:
I think pipeline names should only include alphanumeric characters( a-z, A-Z, 0-9 ), underscores( _ ) or dashes ( - ). Using a regex would be a good approach to prevent any invalid characters.
I'd be happy to implement this. @taylorsilva , what do you think?
EDIT: Just ran a quick test because I doubted myself and I remembered wrong! The pipeline name is also not validated! I thought it was just the instance vars and their values. I would accept a PR then that adds warnings for bad pipeline names (e.g. pipe-), similar to what we have to other identifiers which I linked to above and is now crossed out.
Rest of original message
What's not being checked is the values of the pipeline's instance vars.
A pipeline name used to be just the name you'd pass in with --pipeline, but now it's the combination of that name and the instance var(s).
A different fix might be to change how we allow users to interact with instance pipelines with fly. I'm not a big fan of the current setup myself. I always forget the format and it feels finicky to work with. I'd be open to someone's attempt to improve the UX at the fly-level as I think that would also solve this problem.
We could also add warnings similar to what we do for pipeline names and other identifiers in pipelines (resource names, step names, etc) but for the values of instance vars, to discourage users from using special characters.
I'd be open to accepting contributions for both or one of those solutions.
It seems we never got around to adding that part though as I don't get any warnings from fly when I do fly set-pipeline --pipeline test- -c pipeline.yml.
There are many pieces that can be tackled here. If you have bandwidth to work on any of this it would be much appreciated 🙏
Hi @taylorsilva, i am sorry for the late response. I've checked what you suggested and started working on it.
I have one concern. If we use ValidateIdentifier to validate the pipeline name this will override the check regarding "/":
My suggestion here is to return error when there is invalid character caught from the ValidateIdentifier instead of warnings but this will be applied for each command which uses it. Should i change it to return error? What do you think?
After one year, we can turn these warnings into errors.
We are well past the one year point. Users have had 5 years to update their pipelines to conform with the identifier restrictions. I say we go ahead and start enforcing them starting with v8.
I'm going to add this as another breaking change for v8 of Concourse: #9184
Is this something you'd be able to work on? This would cover a lot of things and there will probably be quite a few tests that need to be updated.
Activity
xtremerui commentedon May 18, 2023
Please try
fly -t my-team destroy-pipeline --pipeline my-group/env:\"prod,staging,dev\"Basically it will need to quote the instance var value and escape the quotes at the same time. Sorry this is not very well documented.
theunpleasantowl commentedon Jun 1, 2023
Unfortunately, this does not seem to work for me.
Regular name works:
Special character names don't:
lcouto1 commentedon May 2, 2024
was there a fix for this?
taylorsilva commentedon Jan 7, 2025
No fix for this, we should make it very hard/not possible to use characters like this (that's my quick take at least)
PiotrLuboch commentedon Apr 9, 2025
There is a hack to remove the pipeline, you have to use the concourse api directly.
Let's say you created a pipeline named
test/pipeline:aaa,bbbfor teamtest. First you need to encode the pipeline name:test%2Fpipeline%3Aaaa%2Cbbb. Then you need to call the API directly:curl -X DELETE <the-concourse-url>/api/v1/teams/test/pipelines/test%2Fpipeline%3Aaaa%2Cbbb --verbose -H "Authorization: bearer <token>"ceco556 commentedon Apr 13, 2025
I think pipeline names should only include alphanumeric characters( a-z, A-Z, 0-9 ), underscores( _ ) or dashes ( - ). Using a regex would be a good approach to prevent any invalid characters.
I'd be happy to implement this. @taylorsilva , what do you think?
taylorsilva commentedon Apr 15, 2025
@ceco556
Pipeline names already have warnings/checks to warn against stuff like this: https://github.com/concourse/concourse/blob/master/atc/configwarning.goEDIT: Just ran a quick test because I doubted myself and I remembered wrong! The pipeline name is also not validated! I thought it was just the instance vars and their values. I would accept a PR then that adds warnings for bad pipeline names (e.g.
pipe-), similar to what we have to other identifiers which I linked to above and is now crossed out.Rest of original message
What's not being checked is the values of the pipeline's instance vars.
A pipeline name used to be just the name you'd pass in with
--pipeline, but now it's the combination of that name and the instance var(s).concourse/atc/pipeline.go
Lines 32 to 35 in 301f806
A different fix might be to change how we allow users to interact with instance pipelines with
fly. I'm not a big fan of the current setup myself. I always forget the format and it feels finicky to work with. I'd be open to someone's attempt to improve the UX at thefly-level as I think that would also solve this problem.We could also add warnings similar to what we do for pipeline names and other identifiers in pipelines (resource names, step names, etc) but for the values of instance vars, to discourage users from using special characters.
I'd be open to accepting contributions for both or one of those solutions.
taylorsilva commentedon Apr 15, 2025
The original RFC that added the identifier checks included pipeline names in the list of things to check: https://github.com/concourse/rfcs/blob/master/040-valid-identifiers/proposal.md
It seems we never got around to adding that part though as I don't get any warnings from fly when I do
fly set-pipeline --pipeline test- -c pipeline.yml.There are many pieces that can be tackled here. If you have bandwidth to work on any of this it would be much appreciated 🙏
ceco556 commentedon May 8, 2025
Hi @taylorsilva, i am sorry for the late response. I've checked what you suggested and started working on it.
I have one concern. If we use ValidateIdentifier to validate the pipeline name this will override the check regarding "/":
concourse/fly/commands/set_pipeline.go
Lines 40 to 42 in 108e1e4
If we use ValidateIdentifier the character "/" will be already caught by the regex and will return a warning instead of error:
concourse/atc/configwarning.go
Lines 14 to 17 in 108e1e4
My suggestion here is to return error when there is invalid character caught from the ValidateIdentifier instead of warnings but this will be applied for each command which uses it. Should i change it to return error? What do you think?
taylorsilva commentedon May 8, 2025
Reading the identifiers RFC a bit more, there is a section about transitioning from warnings to errors: https://github.com/concourse/rfcs/blob/master/040-valid-identifiers/proposal.md#easing-the-transition
We are well past the one year point. Users have had 5 years to update their pipelines to conform with the identifier restrictions. I say we go ahead and start enforcing them starting with v8.
I'm going to add this as another breaking change for v8 of Concourse: #9184
Is this something you'd be able to work on? This would cover a lot of things and there will probably be quite a few tests that need to be updated.
ceco556 commentedon May 8, 2025
Yes, i would be happy to implement this.
I will keep you updated and open a PR once i am done.
taylorsilva commentedon May 8, 2025
Feel free to drop a message in the
#devchannel in discord if you need any help or pointers.