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

Support Dependencies in Actions hooks.if conditionals #7706

Open
imaouhoubi opened this issue Apr 30, 2024 · 0 comments
Open

Support Dependencies in Actions hooks.if conditionals #7706

imaouhoubi opened this issue Apr 30, 2024 · 0 comments

Comments

@imaouhoubi
Copy link

Problem:

Currently in LakeFS actions, When setting up Action Hooks, the hooks.if conditions are global and there is no way to specify for example if a hook has a dependency of the success or failure of another hook.

Details:

Consider this workflow:

  • create_table_hook: main hook
  • trigger_gitlab_pipeline_hook: should run if create_table_hook fails
  • send_notification_hook: should run if trigger_gitlab_pipeline_hook fails

if we try to implement this currently in lakefs actions, we would have something like this:

- id: create_table_hook
  type: lua
- id: trigger_gitlab_pipeline_hook
  type: lua
  if: failure()
- id: send_notification_hook
  type: lua
  if: failure()

the issue we will have here is that the hooks trigger_gitlab_pipeline_hook and send_notification_hook will both be executed if create_table_hook fails.

instead, it would be more flexible if we could specify which hooks to listen in the hooks.if clause.
here's the previous example with this proposal:

- id: create_table_hook
  type: lua
- id: trigger_gitlab_pipeline_hook
  type: lua
  if: failure(create_table_hook)
- id: send_notification_hook
  type: lua
  if: failure(trigger_gitlab_pipeline_hook)

Note that in another case, we might want to specify multiple hooks to listen to for failure. In this case, if one of the hooks mentioned fails, it should execute the conditional hook. but if it's success, all the hooks mentioned should succeed before running the conditional hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants