-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
(appset) Filtering by title on Pull Request generator #16447
Comments
Rather than adding a new filter, I think we can take advantage of the existing post-selector. apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: guestbook
spec:
goTemplate: true
generators:
- pullRequest:
github:
owner: myorg
repo: myrepository
values:
titleMatches: '{{ regexMatch "some-regex" .title }}'
selector:
matchLabels:
values.titleMatches: "true" I haven't tested this, but seems like it should work. We'd still need to add the |
Indeed, that could be a solution as well. I will try it out locally later and see how it goes |
I don't see the |
Ah, we need to add that apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: guestbook
spec:
goTemplate: true
generators:
- matrix:
generators:
- pullRequest:
github:
owner: myorg
repo: myrepository
- list:
elements:
- titleMatches: '{{ regexMatch "some-regex" .title }}'
selector:
matchLabels:
titleMatches: "true" |
Just tested, and that actually works. |
It seem that the apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: preview
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- matrix:
generators:
- pullRequest:
bitbucketServer:
project: project-name
repo: repo-name
api: https://bitbucket.example.com
basicAuth:
// ...
- list:
elements:
- titleMatches: '{{ regexMatch "some-regex" .title }}'
selector:
matchLabels:
titleMatches: "true"
template:
// ... |
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
A PR adding the |
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
Signed-off-by: ggjulio <juligonz@student.42.fr>
…j#17907) Signed-off-by: ggjulio <juligonz@student.42.fr> Signed-off-by: Vegard Færgestad <vegardf@mnemonic.no>
Summary
Currently it is only possible to filter pull requests with the PR generator by target and source branches (also labels in case of Github and Gitlab). I think it would be nice to be able to do some filtering based on the PR title - especially for Git providers such as Bitbucket Server which do not support labels.
Motivation
We use Bitbucket Server and currently we can only filter pull requests based on the source/target branch. Sometimes we would like to perform other actions on the PR before it is picked up by ArgoCD, but as source/target branches are immutable and Bitbucket doesn't support labels, we have no option to do that. Filtering based on the title would allow us to configure ArgoCD to only pick PRs with particular keywords.
Proposal
I can have a look into this
The text was updated successfully, but these errors were encountered: