Repository navigation
fix(trackers): attribute in-flight writes, repair Azure work item hooks, failure-comment switch - #393
Merged
Merged
Conversation
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]>
…onnection 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]>
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]>
… switch Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…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
Dec 2, 2026
) The worker count is what a company is billed for, hour by hour, whether the workers are busy or idle. It shared one Save Changes button with branding, Enter in any field submitted it, and the unsaved-changes dialog could save it on the way out, so a mistyped number changed the bill without anyone noticing. Workers now have their own Save workers button. Where the installation bills for them, saving asks for confirmation first; branding, Enter and the leave-page dialog never save the count. Each change is written to the audit trail with who made it and the old and new number. Board task #393. Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Flow should always recognise its own tracker writes as Flow's, even when the tracker's webhook arrives before the write returns. This PR fixes that, and makes the
workitem.*Service Hooks something Azure's Test connection checks and repairs. It also puts the failure-comment setting on the tracker trigger form.1. Attribution race: events that overtake the write
What was wrong.
InternalTools::Concerns::TrackerContext#with_write(app/services/internal_tools/concerns/tracker_context.rb:48-57on develop) only storedtracker_operations.issue_idafter the provider call returned.Trackers::EventPipeline#matching_operation(app/services/trackers/event_pipeline.rb:90-96) matches events byissue_id. So a webhook processed while the call was still in flight matched nothing:The design doc (§6.6) already claimed the row "still finds" such an event; the code didn't do it.
What changed.
Trackers::Provider#issue_identifier(ref)reads it off the ref without making a request: on Azure it's the work item id, on Jira the numeric id or the key. Once the call returns, the canonical id replaces it. The pipeline matches on eitherissue.idorissue.key.issue_createdevent arrives, matches nothing, and acreate_issuerow on the same external project is stillpendingwith no issue (and is less than 2 minutes old). The pipeline then raisesEventPipeline::WriteInFlightinstead of publishing. Both delivery jobs (Trackers::ProcessDeliveryJobfor Jira,ResolveAzureDevopsEventJobfor Azure) retry that error up to 12 times, 5 s apart. On the last attempt they passwait_for_writes: false, so the event is published as it stands.TrackerOperation#succeed!now sets the result and the issue in one update. Before, there was a moment when a succeeded create had no issue, so its event could be neither matched nor waited for.Trackers::RunStatusReporterhad the same bug in another form. When it resent a failure comment that had been refused (e.g.rate_limited), the ledger row was stillfailed, and the pipeline only matchespendingandsucceededrows. The row is now set back to pending before the resend (TrackerOperation#retry!, now also used bywith_write).Tests that deliver the webhook while the write is in flight.
before_answeringhooks were added toFakeJira::ApiandFakeAzureDevops::WorkItemService; they run once the call has been applied and before it returns.tracker_tools_jira_test: on a 3LO Jira connection, an agent transitionsENG-1by key. Jira's webhook is delivered and processed mid-call, and the event is attributed to the run, so the "ignore Aixle" trigger does not restart the workflow.tracker_tools_jira_test: an issue-created webhook arrives during a create. The job is retried rather than published, and after the create returns the event is attributed.tracker_tools_test: the same create race on Azure, throughResolveAzureDevopsEventJob.run_status_reporter_test: a comment resent after a refusal is attributed even though its event arrives mid-call.event_pipeline_test/process_delivery_job_test: waiting stops on the last attempt, and a create left pending past the 2-minute window holds nothing up.All four race tests fail when run against the old attribution code: the workflow gets restarted, or the event has no origin.
2. Azure Test connection didn't cover
workitem.*hooksWhat was wrong.
AzureDevops::IntegrationService#test→provision_subscriptions→SubscriptionService#ensure_all!used the defaultGATE_EVENT_TYPES, which are the CI hooks only (integration_service.rb:144,subscription_service.rb:29). Failures were only logged, and the flash said "Connection verified" no matter what.SubscriptionService#refresh_status!had no callers at all, so a hook deleted in Azure was never noticed.What changed.
Check, then repair. Test connection first asks Azure for the state of every hook (
refresh_status!). Thenensure_all!recreates the missing, refused or deleted ones. Theworkitem.*hooks are included once an active tracker trigger waits for this connection's trackers, either by name or as "any tracker" in the project. Connecting provisions them on the same rule, so an "any tracker" trigger set up before the connection now gets its hooks.Result in the UI. The new
SubscriptionService#undeliveredlists every hook that isn't delivering, with the reason: missing, the error code, disabled, or probation. The result shows in the flash:In the controller, only the success branch of
test_connectionchanged (one line). Jira's test returns no message, so Jira still shows "Connection verified".Tests.
subscription_service_testcovers three cases: a waiting Boards trigger gets work-item hooks, a hook deleted in Azure is recreated, and refused hooks are named while the connection stays verified.azure_devops_integrations_testchecks the red flash end to end.3. Failure comment (§6.9):
notify_on_failurehad no switch on the formThe comment is controlled by
notify_on_failure(on by default), and only the API could turn it off. The tracker trigger form now has a Comment on the issue when a run fails switch, on by default (TrackerTriggerFields.tsx, plusnotifyOnFailureintrackerTrigger.ts). Thecreate/update_workflow_triggerMCP param descriptions and theTriggerBindingcomment used to describe it as Slack-only; they're corrected.Docs
trackers.md: the switch, attribution of in-flight writes, and what Test connection now does for Boards hooks.azure-devops.md: Test connection as the check-and-repair step for every Service Hook, and a new "A Boards trigger never fires" troubleshooting row.Both have identical bundled copies under
app/frontend/pages/Docs/data/pages/. The design doc §6.6 and §6.9 now describe what the code does.How it was tested
Targeted local runs, through a throwaway test container:
bin/rails teston every touched test file and its neighbours (test/services/trackers, both delivery jobs, the trigger binding models, the Azure subscription, onboarding and service-hook-grant tests, the Azure, Jira and integrations request tests, the webhooks trackers controller, the Jira integration service, the Azure parity tools, and the personal MCP trigger tests): 293 runs, all green.rubocopon the changed Ruby files,brakeman(0 warnings),vitestonTriggerFormPanel.test.tsx,yarn tsc,yarn lint(0 errors),yarn fsd.CI runs the full suite and is the full verification.
Merging with the parallel PRs. The switch sits right after "Changes made by Aixle", and its form field sits next to
aixleChanges. Both spots are clear of the lines #392 (trackers UI) edits.git merge-file.tscis clean.Not done, and why
🤖 Generated with Claude Code