Tickets: don't adopt a Closed ticket Tinker couldn't reopen #34

Merged
jared merged 1 commits from tinker-create-action into main 2026-11-11 02:01:11 -05:00
Owner

Why

Follow-up to tinker_tickets#116, which is now fixed and live in Tinker.

Tinker's create response has an action field that says what Tinker did with the request. Gandalf ignored it. With recurrence_noted, Tinker matched a Closed ticket it couldn't reopen unattended (tinker_tickets#115), and returned that ticket's ID. Gandalf stored the ID as the alert's ticket. That is how micro1 enp3s0 ended up attached to an unrelated reboot ticket (993441773).

What changes

recurrence_noted: Gandalf logs a warning naming the Closed ticket and does not use it, so the alert has no ticket. If you want the alert tracked on that ticket, reopen it in Tinker.

Retries: every create that hits this adds a "recurred" comment to the Closed ticket, so retrying each poll would pile comments onto it (the 786-comment pile in #115). The client therefore remembers the match and retries that title once a day.

Other actions (none, deduplicated, updated, reopened) are used as before, and the log line now names the action.

Not needed: check_code. Gandalf's ticket titles are already stable for each problem and contain no changing numbers, so Tinker's new heading-based key works without it. Sending one would re-key open tickets for no benefit.

Testing

373 tests pass (3 new), and flake8 is clean. The new tests cover:

  • deduplicated and new tickets are used
  • recurrence_noted is not used, and a second poll makes no API call
  • other alerts are unaffected
  • the title is retried after a day

🤖 Generated with Claude Code

## Why Follow-up to tinker_tickets#116, which is now fixed and live in Tinker. Tinker's create response has an `action` field that says what Tinker did with the request. Gandalf ignored it. With `recurrence_noted`, Tinker matched a Closed ticket it couldn't reopen unattended (tinker_tickets#115), and returned that ticket's ID. Gandalf stored the ID as the alert's ticket. That is how micro1 `enp3s0` ended up attached to an unrelated reboot ticket (993441773). ## What changes **`recurrence_noted`:** Gandalf logs a warning naming the Closed ticket and does not use it, so the alert has no ticket. If you want the alert tracked on that ticket, reopen it in Tinker. **Retries:** every create that hits this adds a "recurred" comment to the Closed ticket, so retrying each poll would pile comments onto it (the 786-comment pile in #115). The client therefore remembers the match and retries that title once a day. **Other actions** (`none`, `deduplicated`, `updated`, `reopened`) are used as before, and the log line now names the action. **Not needed:** `check_code`. Gandalf's ticket titles are already stable for each problem and contain no changing numbers, so Tinker's new heading-based key works without it. Sending one would re-key open tickets for no benefit. ## Testing 373 tests pass (3 new), and flake8 is clean. The new tests cover: - `deduplicated` and new tickets are used - `recurrence_noted` is not used, and a second poll makes no API call - other alerts are unaffected - the title is retried after a day 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jared added 1 commit 2026-11-11 01:53:02 -05:00
Tickets: don't adopt a Closed ticket Tinker couldn't reopen
Lint / JS (eslint) (push) Successful in 14s
Lint / Python (flake8) (push) Successful in 57s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 55s
Lint / Python (flake8) (pull_request) Successful in 1m31s
Test / Python Tests (pytest) (push) Successful in 1m51s
Lint / JS (eslint) (pull_request) Successful in 7s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 1m22s
Test / Python Tests (pytest) (pull_request) Successful in 1m46s
d234e36e3f
Tinker's create response says what it did (action). For recurrence_noted it
matched a Closed ticket it could not reopen unattended: that ticket isn't
tracking the alert (this is what hid micro1 enp3s0 behind an old reboot
ticket), so Gandalf now logs it and keeps no ticket for the alert. Each such
create adds a "recurred" comment to the closed ticket, so the same title is
retried once a day rather than every poll. Other actions are logged.

See tinker_tickets#116 and #115.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared scheduled this pull request to auto merge when all checks succeed 2026-11-11 02:01:07 -05:00
jared merged commit 9bdf5d9eed into main 2026-11-11 02:01:11 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/gandalf#34