You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the forge (whichever one) fails to activate a repository (the Activate() func of the forge returns an error), woodpecker has already created the repo in the database. As a result the repository is considered as active from the woodpecker side even the webhook has not been created at the forge. This also does not allow the user to activate the repo again (producing the Repository is already active error).
Deactivate follows the same pattern, as it deletes the repo from the local DB and then it invokes the forge's API to delete the webhook.
Steps to reproduce
Change a forge's Activate() function to return an error always (that way we emulate an issue with the forge's API).
Run woodpecker service using the changed forge.
Try to activate any repo
It will fail but the repo entry will be persisted in the repo
If you don't refresh the page you can try to enable that again (it fails with error Repository is already active.
If you refresh the page the repo seems to be enabled while it isn't
Expected behavior
I would expect a repo to be enabled only if the webhook is created successfully at the forge side.
I would expect a repo to be removed only if the webhook is removed successfully from the forge side.
System Info
Tested with woodpecker 2.8.2 and the next.
Run locally using ` go run ./cmd/server`.
Component
server
Describe the bug
When the forge (whichever one) fails to activate a repository (the Activate() func of the forge returns an error), woodpecker has already created the repo in the database. As a result the repository is considered as active from the woodpecker side even the webhook has not been created at the forge. This also does not allow the user to activate the repo again (producing the
Repository is already active
error).Deactivate follows the same pattern, as it deletes the repo from the local DB and then it invokes the forge's API to delete the webhook.
Steps to reproduce
Repository is already active
.Expected behavior
I would expect a repo to be enabled only if the webhook is created successfully at the forge side.
I would expect a repo to be removed only if the webhook is removed successfully from the forge side.
System Info
Tested with woodpecker 2.8.2 and the next. Run locally using ` go run ./cmd/server`.
Additional context
No response
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]The text was updated successfully, but these errors were encountered: