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

Ability to filter projects by target from the command line #82

Open
joehorsnell opened this issue Jun 11, 2024 · 2 comments
Open

Ability to filter projects by target from the command line #82

joehorsnell opened this issue Jun 11, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@joehorsnell
Copy link

joehorsnell commented Jun 11, 2024

Is your feature request related to a problem? Please describe

targets are a useful way to define named groups of projects, for example all projects with a certain set of tags. However, I believe that currently those targets can only be referenced "statically" in the Mani config for a task, to control which projects that task applies to.

It would be useful to be able to select the projects to operate on from the command line when executing mani, referencing the targets defined in the Mani config.

Describe the solution you'd like

In much the same way that mani currently supports selecting the projects to operate on via the --projects, --paths and --tags command line arguments, it could have a --targets option to reference the targets declared in the config and run the specified tasks/commands on those projects, eg when using the run or exec command.

Additional context

A similar case could be made for specs, which are named groups of config that alter task execution and output. It would be handy to have a --spec command line argument for mani, to select which spec to apply.

@joehorsnell joehorsnell added the enhancement New feature or request label Jun 11, 2024
@alajmo
Copy link
Owner

alajmo commented Jun 24, 2024

Great idea, it's available in sake as well. I don't have time to implement this now, but feel free to open up a pull request, it shouldn't be too hard to implement it.

Relevant code:

https://github.com/alajmo/mani/blob/main/cmd/run.go#L112C1-L121C24
https://github.com/alajmo/mani/blob/main/core/dao/task.go#L276
https://github.com/alajmo/mani/blob/main/core/dao/project.go#L292

@joehorsnell
Copy link
Author

Hi @alajmo - thanks for getting back to me and providing the starting context. If I get some time I'll take a look at this, cheers 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants