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

Allowing filtering on tree/branch pairs #2548

Open
a-wai opened this issue May 7, 2024 · 3 comments · May be fixed by #2613
Open

Allowing filtering on tree/branch pairs #2548

a-wai opened this issue May 7, 2024 · 3 comments · May be fixed by #2613

Comments

@a-wai
Copy link
Contributor

a-wai commented May 7, 2024

Currently, our rules system allows one to ensure jobs will run only for allowed values of each specified node attribute.

This makes it possible to run jobs only for a given set of trees and/or branches, but doesn't allow to enter a list of tree/branch combinations, which can be useful to have more fine-grained conditions.

An example situation could be the following:

  • the mainline tree is built on branch master
  • the media tree is built on branches master and fixes
  • we want to run a job on both mainline/master and media/fixes, but not on media/master

This could be achieved by allowing tree and branch rules to be formatted as <tree>/<branch> and process those entries in a special way if they contain a / character. This solution feels the most user-friendly one, however implementing this might be quite complex.

Alternative solutions could be:

  • add a new build_config rule type, which will look at the build configs defined in the pipeline configuration to identify the tree/branch combinations, and then proceed to checking the corresponding node attributes
  • add a new rule type (name TBD) which will be a special case (just like current *_version rules) in the filtering code working as described above (accept entries in the <tree>/<branch> format and filter based on the node's tree and branch)
@nuclearcat
Copy link
Collaborator

@a-wai you keep amazing me! Thank you very much for your responsiveness and help to colleagues, you are a wonderful person.

@a-wai
Copy link
Contributor Author

a-wai commented May 7, 2024

Thanks, but I didn't do anything yet, just created an issue so we keep it in mind 😉

(maybe next week though)

@nuclearcat
Copy link
Collaborator

Proper planning is actually is major part of the job.

a-wai added a commit to a-wai/kernelci-core that referenced this issue Jul 16, 2024
Currently the rules can only specify allowed/denied trees or branches as
a whole, but we lack a way to authorize (or exclude) only a specific
branch for a given tree.

This change implements tree/branch combination-based rules, by allowing
to specify such combinations using the `tree:branch` format under the
`tree` and/or `branch` rules.

Note: the `:` character has been chosen as a separator because git
forbids its use in branch names.

Fixes kernelci#2548

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
a-wai added a commit to a-wai/kernelci-core that referenced this issue Jul 16, 2024
Currently the rules can only specify allowed/denied trees or branches as
a whole, but we lack a way to authorize (or exclude) only a specific
branch for a given tree.

This change implements tree/branch combination-based rules, by allowing
to specify such combinations using the `tree:branch` format under the
`tree` and/or `branch` rules.

Note: the `:` character has been chosen as a separator because git
forbids its use in branch names.

Fixes kernelci#2548

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
a-wai added a commit to a-wai/kernelci-core that referenced this issue Jul 16, 2024
Currently the rules can only specify allowed/denied trees or branches as
a whole, but we lack a way to authorize (or exclude) only a specific
branch for a given tree.

This change implements tree/branch combination-based rules, by allowing
to specify such combinations using the `tree:branch` format under the
`tree` and/or `branch` rules.

Note: the `:` character has been chosen as a separator because git
forbids its use in branch names.

Fixes kernelci#2548

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
@a-wai a-wai linked a pull request Jul 16, 2024 that will close this issue
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 a pull request may close this issue.

2 participants