fix: recreate the Forgejo webhooks instead of editing them #34
No reviewers
Labels
No labels
breaking
bug
ci
dependencies
documentation
feature
security
skip-changelog
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thierryade/backend!34
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/recreate-forgejo-webhooks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #33 (follow-up of #31/#32).
Forgejo's
editHookonly appliesurlandcontent_typefromconfig— neversecret(onlyaddHookreads it) — so the PATCH inresend_forgejo_webhooksleft the hooks without a secret, and deliveries are still refused.apps.specs.forgejo.recreate_webhook(hook)(replacesresend_webhook_config): creates a new hook with a fresh secret insideconfig, saves its id and secret on the row, then deletes the old hook (a failed delete is only logged: the old hook's deliveries are refused anyway). A failed creation leaves the row untouched.manage.py resend_forgejo_webhooksnow recreates each hook; still harmless to run again.Test plan
manage.py test— 206 tests OK (the 2 command tests rewritten: create with the new secret then delete the old hook; a failed creation keeps the row and the next repo is still done)autopep8 --diffclean,bandit0 issuesdocker exec thierryade python manage.py resend_forgejo_webhooks, then a Forgejo test delivery is accepted🤖 Generated with Claude Code
https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
📊 Rapports Argus pour cette PR