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

bug: Proposed Change Merged Webhook Missing #5600

Open
minitriga opened this issue Jan 28, 2025 · 1 comment
Open

bug: Proposed Change Merged Webhook Missing #5600

minitriga opened this issue Jan 28, 2025 · 1 comment
Labels
priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release state/planned This issue is planned to be worked on in an upcoming release. type/bug Something isn't working as expected

Comments

@minitriga
Copy link
Contributor

minitriga commented Jan 28, 2025

Component

API Server / GraphQL

Infrahub version

1.1.2

Current Behavior

Currently webhooks are created when a proposed change is created and when it transitions into the merging state however once a PC is merged there is no webhook for this update.

https://github.com/opsmill/infrahub/blob/stable/backend/infrahub/proposed_change/tasks.py#L143

Expected Behavior

Customers are to expect a webhook to be fired when a PC is transitioned into a merged state so that automations can be achieved.

Steps to Reproduce

Setup a webhook reciever. Wehbook.site will do.

demo.infrahub.app
Configure the webhook in the Infrahub UI.
Create a branch
Update a value
create a proposed change
You should see webhooks coming in.
Merge the PC.
Webhook for state merging comes in but not when the status goes into merged

Additional Information

Blocking AVD integration with Ansible EDA. Workaround includes running playbook on merging state and putting a wait in the playbook.

@minitriga minitriga added the type/bug Something isn't working as expected label Jan 28, 2025
@exalate-issue-sync exalate-issue-sync bot added state/planned This issue is planned to be worked on in an upcoming release. priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release labels Jan 28, 2025
@ogenstad
Copy link
Contributor

Adding some context here, when thinking about this at first I pointed to the line that @minitriga indicated and thought that the problem was that the state transitions from "merging" to "merged", when the prefect worker updates the database directly.

A problem though is that we override the state here: https://github.com/opsmill/infrahub/blob/infrahub-v1.1.5/backend/infrahub/graphql/mutations/proposed_change.py#L125-L127 and then return the object where it's in state "merging". Then we send it as an event here:
https://github.com/opsmill/infrahub/blob/infrahub-v1.1.5/backend/infrahub/graphql/mutations/main.py#L100C37-L111

This is why the webhook indicates "merging" instead of "merge".

@exalate-issue-sync exalate-issue-sync bot added this to the Infrahub - 1.2 milestone Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release state/planned This issue is planned to be worked on in an upcoming release. type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants