feat: process place revocations via Gitea ticket sync in cron job#98
Draft
dadofsambonzuki wants to merge 1 commit into
Draft
feat: process place revocations via Gitea ticket sync in cron job#98dadofsambonzuki wants to merge 1 commit into
dadofsambonzuki wants to merge 1 commit into
Conversation
When a place submission is revoked, the sync_submitted_places cron job now handles the Gitea ticket lifecycle: - Revoked before ticket closed → closes issue, swaps label 901→904, comments - Revoked after ticket closed → reopens issue, swaps label 901→904 Uses the presence of label 904 on the Gitea issue as an idempotency signal to avoid re-processing already-handled revocations. Adds Gitea API functions: close_issue, reopen_issue, set_issue_labels, add_issue_comment. Adds select_revoked_with_ticket_url DB query. Closes #59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the two remaining tasks from #59:
Changes
src/service/gitea.rs— 4 new API functions:close_issue— PATCH issue withstate: "closed"reopen_issue— PATCH issue withstate: "open"set_issue_labels— PUT to{url}/labelsadd_issue_comment— POST to{url}/commentsGetIssueResponsenow includeslabelsfield for idempotency checksrc/db/main/place_submission/— newselect_revoked_with_ticket_urlquerysrc/rpc/import/sync_submitted_places.rs— main refactor:Design
All Gitea operations stay in the cron job for resilience — Gitea downtime won't affect admin revocations. Labels serve as the signal that processing has already occurred.
Verification
cargo clippy -- -D warningscleancargo fmtapplied