mani icon indicating copy to clipboard operation
mani copied to clipboard

Exclude projects by tag during sync

Open aayushsrivastava opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe

I have a use case where I want to clone all projects except a few.

I thought of a few ways out like tagging all the other projects besides the excluded ones with a particular tag and using this tag during sync. It makes it difficult to maintain the config though since the excluded projects are fewer in number and will remain static in count. Whereas this new tag has to be now added for any new project.

Describe the solution you'd like

A new flag --exclude-tags which ignores the projects with such tags while cloning repositories.

Additional context

N/A

aayushsrivastava avatar Aug 22 '24 10:08 aayushsrivastava

There's a field you can set on individual projects, named sync, which if set to false, will not sync the project.

projects:
  pinto:
    path: frontend/pinto
    url: [email protected]:alajmo/pinto
    tags: [dev]
    sync: false

There's no dynamic flag for this though, but feel free to open up a PR implementing it (I'm bottlenecked at the moment, but can check PRs), it shouldn't require too much work, the function for filtering is FilterProjects.

alajmo avatar Aug 22 '24 11:08 alajmo

I missed this field somehow! Thanks for pointing it out. This does solve my problem.

aayushsrivastava avatar Aug 22 '24 12:08 aayushsrivastava

We think it will be helpful to have an additional CLI override to sync projects with sync: false. Something like mani sync --all syncs all projects irrespective of the sync flag's value.

Willing to contribute a PR for the same. Would you be interested in such an addition?

aayushsrivastava avatar Aug 23 '24 07:08 aayushsrivastava

I thought about it, sounds like a good idea. Feel free to open a PR!

alajmo avatar Aug 26 '24 13:08 alajmo

It's been added now as part of 0.30.0, to ignore the sync state of projects that have sync set to false, use the flag --ignore-sync-state.

alajmo avatar Dec 25 '24 21:12 alajmo