Repository navigation
Add support-qa-toolkit v1 - #1
Conversation
Rule-based ticket-to-bug and log triage commands, fictional Paperlane samples, pytest coverage, and a ruff/pytest GitHub Actions workflow. Co-authored-by: David Kupratis <dkupratis@student.bccc.edu>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61f8e1d17c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| def parse_json_ticket(text: str) -> Ticket: | ||
| try: | ||
| data = json.loads(text) |
There was a problem hiding this comment.
Strip the detected BOM before decoding a JSON ticket
For a UTF-8 JSON ticket with a byte-order mark, parse_ticket strips the BOM when detecting the format but then passes the original text here. Consequently, json.loads rejects an otherwise valid ticket with Unexpected UTF-8 BOM, and ticket2bug exits 2 instead of producing a report. Pass the normalized text to the JSON parser or remove the leading BOM before decoding, consistent with the existing handling of plain-text tickets.
Useful? React with 👍 / 👎.
| _ERROR_TYPE_RE = re.compile( | ||
| r"\berror[_ ]?type=(\"[^\"]+\"|'[^']+'|[A-Za-z_][A-Za-z0-9_]*)", | ||
| re.IGNORECASE, | ||
| ) |
There was a problem hiding this comment.
Recognize explicit exception fields in text logs
For recognized text log lines containing exception=JobFailed, the explicit exception field is ignored because this expression only accepts error_type, while the fallback exception expression requires a name ending in Error, Exception, or Fault. This contradicts the documented precedence of explicit error_type or exception fields and corrupts grouping: three lines with distinct exceptions such as JobFailed, QueueFull, and WorkerStopped, all with message="operation failed", become one repeated issue. Include exception in the explicit-field matcher so those counts and repeat decisions remain separate.
Useful? React with 👍 / 👎.
Summary
Adds a small local CLI for the support-to-QA workflow.
sqt ticket2bugturns a plain-text or JSON ticket into a Markdown bug report (summary, environment, steps, expected vs actual, severity with the rule that fired, and open questions).sqt triagesummarizes an application log: error counts by type, first and last seen, 5-minute spikes, and repeated issues.The rules are documented in
src/sqt/severity.pyandsrc/sqt/logs.py. There is no language model and no network call. Sample tickets and logs are fictional (a made-up app called Paperlane).Also included: pytest coverage of both commands and the empty/malformed/unknown-format edges, a
sqtconsole script, a Python.gitignore, the MIT license (Copyright 2026 David Kupratis), and a GitHub Actions workflow that runs ruff and pytest on push and pull request.Try it
pip install -e ".[dev]" sqt ticket2bug samples/tickets/export-hang.txt sqt triage samples/logs/api-morning.logBad input exits 2 with an
sqt:line on stderr rather than a traceback.Tests
ruff check .is clean.pytestreports 57 passed, locally on Python 3.11 and 3.12.