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

inherit tags for canned_actions #599

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rossmeier
Copy link
Contributor

Thanks to canned action, it is very easy to create dependency errors
with code like this:

svc_systemd = {
    'test.service': {
        'tags': {'a'},
        'needed_by': {'!tag:a'},
    },
}

Therefore canned actions should inherit the tags of their parent
actions to avoid confisions by using the !tag:foobar selector.

@trehn
Copy link
Member

trehn commented Feb 21, 2021

@CroneKorkN do you agree?

@trehn
Copy link
Member

trehn commented Feb 21, 2021

related to #568 and #560

@CroneKorkN
Copy link

I actually have a usecase, where i need to tag each action independently: there are tags representing stages of app deployent, like install, start, setup, stop or restart. When we need to do something after an app has started, but before it was stopped, we do something like

action['setup_app'] = {
  'action': 'some setup stuff',
  'needs': ['tag:app-start.target'],
  'needed_by': ['tag:app-stop.target'],
}

Maybe this could be resolved via an explicit svc_systemd:test:start canned action, wich is triggered by default. Then tags on the base item could be inherited by canned actions und still each action could be tagged individually, if needed.

@rossmeier
Copy link
Contributor Author

I don't see a conflict between this PR and @CroneKorkN 's suggestion. Inheriting tags could still be the default behaviour that could be made overwriteable in a future commit/PR

@trehn
Copy link
Member

trehn commented Aug 11, 2021

The problem is that this isn't backwards-compatible. Right now we actually have bundles that depend on a tag which is assigned to a service and world break if that dependency were to suddenly include the restart action as well.

Nevertheless, I still agree that the behavior implemented in this PR is probably the right way to go, so I'm tagging it for 5.0.

@trehn trehn added this to the 5.0.0 milestone Aug 11, 2021
@rossmeier
Copy link
Contributor Author

Thanks for the reply. I guess I will use a patched bundlewrap version until then.

Thanks to canned action, it is very easy to create dependency errors
with code like this:

```
svc_systemd = {
    'test.service': {
        'tags': {'a'},
        'needed_by': {'!tag:a'},
    },
}
```

Therefore canned actions should inherit the tags of their parent
actions to avoid confisions by using the `!tag:foobar` selector.
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 this pull request may close these issues.

3 participants