Repository navigation
Allow globs in groups - #6060
Conversation
0d5de0c to
541cc39
Compare
|
This looks useful for many of our teams who have fairly elaborate pipeline setups that include deployment and testing in multiple environments. I was just looking at some of the group configs our users currently have, and it should be nice if they can say stuff like |
|
I wonder if we should use https://github.com/gobwas/glob and support the full wildcards suite instead of just |
|
I could get behind that - I actually used that library to begin with but then didn't want to add a new dependency since the one I used is already included via the Vault dep |
ee8ea0f to
2d9e7f6
Compare
|
I've squashed everything down to a single commit and it uses |
2d9e7f6 to
a3c8361
Compare
It is quite common to have an "all" group or a "test" group in a pipeline and it can be annoying when you forget to add new jobs to those groups. By allowing globs, groups can be kept smaller and catch new jobs (provided they match the expression) Signed-off-by: Andy Paine <[email protected]>
a3c8361 to
5903b6f
Compare
|
I've fixed all the tests now. Can you let me know if there is anything more I need to do on this? |
aoldershaw
left a comment
There was a problem hiding this comment.
Sorry for the delay getting this reviewed! Appreciate your patience 🙏
Looks good to me! Seems like a useful feature - I have also felt the pain of forgetting to add new jobs to groups. While it's not so hard to add the job to the group after fly complains, it's certainly a QoL improvement. I also like how this encourages consistent naming of jobs!
Thanks!
concourse/concourse#6060 Signed-off-by: Aidan Oldershaw <[email protected]>
concourse/concourse#6060 Signed-off-by: Aidan Oldershaw <[email protected]>
What does this PR accomplish?
Allow groups to list jobs via globs rather than just strict matches. It isn't uncommon to have an
allgroup which you need to remember to add any new jobs to and it is easy to forget tofly validate-pipelinefirst. With this feature, the groups could just be (quoting to prevent being seen as YAML anchor):Bug Fix | Feature | Documentation
Changes proposed by this PR:
When validating/saving groups that a job is in, use
glob.Globrather thanLookup/map keys which strictly check equality. Add/modify some tests to ensure behaviour is covered.Notes to reviewer:
There are 2 commits here - the first uses a regular expression and the second converts it to using globs. I think globs seem nicer so I would prefer to use globs and just squash these 2 commits but I left it there for reference. I don't think users need/necessarily want the full power of regular expressions just for selecting groups.
On my travels I also noticed that a group can contain resources - I'm pretty sure this field only exists on the object and in validation and isn't actually persisted to the DB anywhere. Doing some manual testing specifying
resourcesin the pipeline config doesn't do anything so I'm pretty sure this is dead code. I say all this to qualify why I didn't bother extending the glob based matching to resources as well 😂Release Note
groupsin a pipeline can now match jobs based on globs e.g.:Contributor Checklist
Reviewer Checklist
BOSH and
Helm packaging; otherwise, ignored for
the integration
tests
(for example, if they are Garden configs that are not displayed in the
--helptext).