feat(ci): triage v2 task-level tracking and auto-close of resolved failures#776
Merged
Conversation
lugarbos
force-pushed
the
lugarbos/task/refactor-report-triage
branch
from
July 16, 2026 08:33
fd19c0a to
b94c3e7
Compare
daniel-herrero
self-requested a review
July 16, 2026 08:45
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.
Done Definition Checks
Description
The first iteration of the triage automation worked, but real use surfaced four gaps. Every line in the digest linked to the release user story instead of the specific task, so "Taiga #1683" appeared repeated on every cluster and reviewers still had to hunt for the right task. Resolved failures were only flagged, leaving manual closing work. Deleting the release story in Taiga (a natural way to try to "reset") left the state file behind, producing a confusing situation where re-runs recreated an empty story with no tasks. And a run failed against api.taiga.io with an HTML 403 — an intermittent Cloudflare edge block of GitHub runner traffic, unrelated to our credentials.
Solution
Task-level tracking. When a cluster's task is created, its Taiga task id, ref, and subject are now stored in the per-release state. Every digest and Mattermost line — new, known, and resolved clusters — links to the cluster's own task (.../task/) instead of the story; the story link remains only as the single entry point in the Mattermost verdict line. Resolved lines also show the task's subject so "what went green" is readable without clicking.
Auto-close of resolved tasks. A cluster green for 3 consecutive triaged runs is now closed automatically: the script resolves the project's "Closed" task status and the qa.integrations.bot user via the API, then updates the task with that status, that assignee, and an explanatory comment. Closed fingerprints are removed from state, so a failure that returns later becomes a fresh cluster with a fresh task. Both names are configurable (TAIGA_CLOSE_ASSIGNEE, TAIGA_CLOSED_STATUS). Degradation is graceful at every step: unknown status name → skip with a log line; bot not a project member → close without reassigning; a single failed close → logged and retried on the next run. Mattermost distinguishes Auto-closed from Resolved — close manually (the latter covers file-mode clusters, which share tasks per spec file and are never auto-closed, and pre-upgrade state entries that never recorded a task ref).
Story deletion is now a supported rebuild. If the stored release story no longer exists in Taiga, the script rebuilds it and recreates tasks for known clusters (their tasks died with the story), while preserving each cluster's failure history ("failing N runs in a row" counters survive). The file-mode task map is reset accordingly.
Self-service reset. New reset_state boolean input on the workflow: when ticked, the run deletes the tag's state file from S3 before triaging, so the whole release starts from scratch — no AWS access needed by the person triggering. Scoped strictly to the given tag; deleting the old story in Taiga remains a deliberate human action.
Taiga edge hardening. All Taiga requests now send a User-Agent (Cloudflare commonly 403-blocks UA-less requests with an HTML page). An HTML-bodied 403 is detected, explained in the error message ("blocked before reaching Taiga / check TAIGA_URL"), and retried twice with backoff — while a genuine JSON 403 (real permission problem) still fails fast.
Rename. The workflow is now Report triage (.github/workflows/report-triage.yml, previously release-triage.yml). Internal concepts (release tag, release- Taiga tag, state filename) are unchanged, so existing state remains valid.
Migration note for in-flight tags
Tasks created before this change never recorded their task refs, so their clusters keep linking to the story and cannot be auto-closed. For any tag still in testing (e.g. 2.18): delete its story in Taiga and trigger with reset_state ticked — the rebuild records task refs for everything and the new behavior applies fully. Tags started after this PR need nothing.
How to test
Prerequisite check: the Taiga project must have a task status named "Closed" (or set TAIGA_CLOSED_STATUS), and qa.integrations.bot must be a project member.