Skip to content

fix(trackers): remove dead ends on the Trackers page and trigger form - #392

Merged
artempartos merged 1 commit into
developfrom
fix/trackers-ui-dead-ends
Oct 1, 2026
Merged

artempartos merged 1 commit into
developfrom
fix/trackers-ui-dead-ends

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Removes the dead ends on the project Trackers page, the Connect a board column drawer and the tracker trigger form (integration docs review, design §6.8 / §8.3).

What was wrong, and what changed

  1. "Attach again" could 500. TrackersController#update called ProjectTracker#reattach! unrescued (app/controllers/web/company/projects/trackers_controller.rb:40). A detached tracker skips scope_covered_by_integration, so on a tracker the Jira connection no longer covers, reattach! raised RecordInvalid. It now redirects back with "connection no longer covers tracker. Add it to the connection on the Integrations page, then attach it again.", and the page shows the server's reason instead of "Failed to update tracker". Model errors are also passed as full messages ("Handle has already been taken").

  2. Detached trackers kept enabled triggers you could not edit. Behaviour chosen: the trigger keeps its tracker. It stays switched on but does not fire (a detached tracker publishes no events: ProjectTracker.usable in Trackers::EventPipeline), fires again after "Attach again" (already what the user guide promised), and stays editable. TriggerBinding#project_tracker_in_project (app/models/trigger_binding.rb:129) now refuses a detached tracker only when a binding is created on it or moved to it, so editing no longer forces the silent widening to "Any tracker". The builder now receives detached trackers with their status; the form lists the bound one as "Name (handle) — detached" and says the trigger does not fire until the tracker is attached again; the Triggers tab shows "handle (detached, not firing)"; the Detach confirmation says the triggers stop firing. The tracker kind is still offered only when an attached tracker exists.

  3. Boardless projects could not save a tracker trigger with the defaults. trackerValueFromTrigger (trackerTrigger.ts:61) always defaulted to find_or_create_task, which needs a Task column. With no board the default is now None — project-level run, and the subjects that create a task are greyed out with a hint.

  4. The intake column had to match exactly but was free text. ConnectColumnDrawer used an Autocomplete: suggestions from useTrackerStatuses, any text accepted, matched case-sensitively by TriggerFilter (in → exact include?). The column is now a Select of the board's real columns. Only when they cannot be read (or the board has none) does it fall back to typing, with a warning that the name is not checked. useTrackerStatuses now reports loading and failure.

  5. Connecting the same column twice made two triggers that both fired. New TriggerBinding validation: a workflow cannot hold two tracker bindings with the same event type, tracker and filter_predicate (compared as jsonb). The drawer shows the refusal. The rule applies to the API and MCP as well, because every binding that matches starts its own run. It only checks when a binding is created or its tracker or filter changes, so existing duplicates can still be edited and switched off.

  6. "Aixle is mentioned in a comment" was offered where it could not fire. New ProjectTracker#recognizes_mentions? (tracker_provider.identity.present?, the same identity mentions_self? uses), exposed as mentionsRecognized on ProjectTrackerResource and on the builder's tracker list. The drawer greys out the mention entry and gives the per-provider reason: Azure needs a first work-item write; Jira needs a service account or "This Atlassian account is kept for Aixle". The trigger form shows the same reason under "Only when Aixle is mentioned".

  7. Saving from the form dropped filter conditions set through the API or MCP. trackerTriggerPayload rebuilt filter_predicate from the form's fields only. Conditions the form cannot show exactly are now kept in otherConditions, listed read-only under "Other conditions", and merged back on save.

  8. No handle edit, and "Add tracker" almost never appears. Added Edit handle (pencil on each row → drawer → PATCH { handle }). update already accepted it. "Add tracker" stays. Trackers::Provisioning creates a tracker for every scope the connection covers, so the button appears only when provisioning skipped a scope. That makes it the recovery path, and it is also the design's path for connections that serve more than their own project. To stop it being a dead end, the page now says where trackers come from and links to Integrations when there is nothing to add.

User guide docs/user-guide/trackers.md and its bundled copy are updated (identical). The design doc's §6.4 validation, §6.8 setup and §8.3 step 6 now describe the chosen behaviour.

Tests

Run locally, targeted:

  • rubocop on every changed Ruby file; brakeman (0 warnings).
  • bin/rails test: project_tracker_test, trigger_binding_tracker_test, trigger_binding_test, trackers_controller_test, trackers_authorization_test, workflows_controller_test, API triggers_controller_test, plus neighbours event_pipeline_test, process_delivery_job_test, templates exporter_test/installer_test, workflow_triggers/creator_test, personal_mcp_triggers_test, jira/integration_service_test, run_status_reporter_test, jira/personal_data_test, resolve_azure_devops_event_job_test, jira_integrations_test, documentation_drift_test, docs_render_test. All green.
  • vitest: shared/resources/trackers/*, TriggerFormPanel, TriggersTab, BuilderPage, pages/Projects/Trackers, pages/Docs. Plus yarn tsc, yarn lint (no new warnings), yarn fsd.

New tests: a refused attach says why; a taken handle gets a readable error; a binding keeps a detached tracker but cannot be moved onto one; duplicate tracker bindings are refused (a different filter, any tracker or another workflow are not duplicates); mention recognition per provider; the builder lists detached trackers with mentionsRecognized. On the frontend: column picker and typed fallback, greyed-out mention option, handle edit, attach error, Integrations pointer, conditions kept on save, boardless default, detached tracker in the form and the Triggers tab.

The full suite runs on CI; it is the full verification for this PR.

Not changed

  • Write attribution and delivery (agent F2's area).
  • ProjectTracker#reattach! itself is unchanged. The readable refusal lives in the controller, its only caller.

🤖 Generated with Claude Code

Attaching a tracker its connection no longer covered raised
RecordInvalid unrescued (500); it now redirects with the reason and
points to the Integrations page.

A trigger keeps the tracker it names through a detach: it stays
switched on but does not fire (a detached tracker publishes no events),
it stays editable, and the form and Triggers tab say so. Before, saving
it was refused unless it was widened to "any tracker".

The tracker trigger form defaults to a project-level run without a
board, keeps filter conditions set through the API or MCP and lists
them, and says when a mention cannot fire. The intake drawer picks the
column from the board's real columns (free text only when they cannot
be read), greys out the mention entry with the reason, and a workflow
can no longer hold two identical tracker triggers. The handle can be
edited from the Trackers page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit 8c7828b into develop Oct 1, 2026
7 checks passed
artempartos added a commit that referenced this pull request Oct 1, 2026
…setting

Keeps the switch, and its field in the form value, clear of the lines the
trackers UI work (#392) edits, so the two merge without conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
artempartos added a commit that referenced this pull request Oct 1, 2026
…ks, failure-comment switch (#393)

* fix(trackers): attribute events that overtake the write that caused them

The event pipeline matches a tracker event to the write that caused it by
issue id, but with_write stored the issue id only after the provider call
returned. A webhook processed while the call was still in flight matched
nothing: under "Only from other workflows" it carried no chain and could
restart the same workflow, and on a Jira connection that acts as a person
it passed for that person's change.

Updates, transitions, assignments and comments now record the issue before
the call, as the caller named it (Provider#issue_identifier: the id, or on
Jira possibly the key), and the pipeline matches either. A create learns
its issue only from the answer, so an issue-created event that arrives
while a create on the same project is pending is retried by the delivery
job (12 runs, 5 s apart) and published as it stands on the last one.

RunStatusReporter resent a refused failure comment while its ledger row
was still `failed`, which the pipeline never matches; it is pending again
before the resend, as in with_write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

* fix(azure-devops): check and repair work item Service Hooks on Test connection

Test connection re-provisioned only the CI hooks, so the workitem.* hooks
Boards triggers depend on were never retried, and every failure was only
logged: the connection reported itself verified while no event could
arrive.

It now asks Azure for the state of every hook first (refresh_status!, which
had no caller), recreates the missing, refused or deleted ones, including
the workitem.* hooks once a tracker trigger waits for this connection's
trackers, and reports the outcome in the flash: green when every hook is in
place, red with each hook that is not delivering and why. Connecting
provisions the workitem.* hooks too when a trigger for any tracker already
exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

* feat(trackers): failure-comment switch on the tracker trigger form

The comment Flow posts on an issue when a tracker-started run fails or is
cancelled is governed by notify_on_failure (on by default), which only the
API could turn off. The tracker trigger form now has the switch, and the
MCP trigger tools and the model no longer describe the setting as
Slack-only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

* docs(trackers): attribution of in-flight writes, hook repair, failure switch

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

* refactor(trackers): place the failure switch after the Aixle-changes setting

Keeps the switch, and its field in the form value, clear of the lines the
trackers UI work (#392) edits, so the two merge without conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

---------

Signed-off-by: Artem Petrov <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant