- Issue created by @amaisano
- πΊπΈUnited States amaisano Boston
Secondary thought - I just had a use case of running everything EXCEPT. So some kind of negation would be a cool bonus feature:
drush mim --all --tag=!translation #import everything except migrations tagged "translation"
- π³πΏNew Zealand xurizaemon Εtepoti, Aotearoa π
As suggested in the Slack thread, I think it's worth picking a syntax which produces a decent UX on the commandline, and ideally one which is already established (rather than coming up with our own).
From Migrate's side, we should consider that selecting characters like
! ~ & + ,
will potentially modify how some existing tags in existing migrations behave.Considering use from CLI, we have to consider the UX as well when we use characters, which will probably mean
--tag="foo&&bar"
to avoid behaviour of characters handled specially by the shell (! &
etc).Thinking about the grouping syntax suggestion in Slack, I think CLI syntax has to be clear and concise as well. (I suspect grouping might be more complicated than this feature needs?)
The proposal reminds me of Behat's Gherkin filter syntax, which does most of what you've proposed here - it has OR, AND and NOT, but does not have grouping.
Examples (see https://docs.behat.org/en/v2.5/guides/6.cli.html#gherkin-filters to unpack):
--tags 'orm,database' # Tests tagged orm or database --tags 'orm&&fixtures' # Tests with both orm and fixtures tags --tags '~javascript' # All tests except javascript --tags 'orm&&fixtures&&~javascript' # Tests with both orm and fixtures, except if they have javascript
I'm sure there are other syntaxes which are similar and might fit as well - my suggestion is that if possible we select an existing syntax that'll be familiar or accessible to the community, rather than rolling our own. Are there any Drush commands which already have something similar?
- Status changed to Closed: works as designed
7 months ago 9:01pm 31 May 2024 - heddn Nicaragua
The current approach is probably fine. If someone needs to do this, they can type the different tags manually.