Forge issue intake: an issue whose routed workflow is disabled still spawns a task #1913

Closed
opened 2026-11-12 13:33:48 +00:00 by sam · 1 comment
Owner

On the production instance, every issue opened in the archie repo spawns a task (source forge). The task is claimed, an attempt starts, and only then does it park with "workflow is disabled" (for example task 466 for issue #1908, parked 0.08s after queueing, plus a task.needs_decision alert). With the routed workflow disabled, intake should not create the task at all: the issue poll should skip publishing when the label-routed workflow is disabled for the identity's org, and should not acknowledge the issue, so re-enabling the workflow picks the issue up on a later poll. Event bindings already skip disabled workflows at dispatch time; the issue-poll intake path should match instead of queue-then-park.

On the production instance, every issue opened in the archie repo spawns a task (source forge). The task is claimed, an attempt starts, and only then does it park with "workflow <name> is disabled" (for example task 466 for issue #1908, parked 0.08s after queueing, plus a task.needs_decision alert). With the routed workflow disabled, intake should not create the task at all: the issue poll should skip publishing when the label-routed workflow is disabled for the identity's org, and should not acknowledge the issue, so re-enabling the workflow picks the issue up on a later poll. Event bindings already skip disabled workflows at dispatch time; the issue-poll intake path should match instead of queue-then-park.
sam self-assigned this 2026-11-12 13:34:27 +00:00
Author
Owner

Fixed in PR !1915 (branch fix/1913-intake-skip-disabled).

What changed:

  • internal/daemon/daemon.go: in pollNATS, after the TaskByIssue existence check and before PublishTask, the issue's label-routed workflow is now checked. If it resolves and is disabled for the polling identity's org, one InfoContext line is logged (repo, issue, workflow, disabled) and pollNATS returns false without calling acknowledge, so the issue is re-discovered on a later poll and picked up if the workflow is re-enabled. Any error reading the org, the workflow definitions or the enablement logs a Warn and falls through to the previous publish behaviour; no routable definition keeps the current publish behaviour (the pin path parks).
  • internal/daemon/binding_target.go: new helper disabledRoutedWorkflow resolves org via identityOrg, builds the available definition set via activeWorkflows, routes via workflow.ResolveWorkflowID, and checks enablement.Enabled(org, routed), matching the filter dispatchOrgBindings already applies to armed bindings.
  • internal/daemon/intake_disabled_test.go: table-driven TestPollNATSSkipsDisabledRoutedWorkflow covering disabled bug/tdd, feature/feasibility and default/triage routes (skipped: returns false, nothing published to the task bus, no ack reaction on the forge), enabled route (publishes and acknowledges), disabled for a different org (still publishes), and fall-through on enablement, definitions and org read errors plus the no-routable-definition case.

processNATSTask's park path, withdrawUnpolled and binding dispatch are unchanged; PublishTask's only caller is pollNATS, so chat/dashboard spawns through the Gateway are unaffected.

Verified (all on the committed tree):

  • go test -short -count=1 ./internal/daemon/... -> ok
  • go test -short ./internal/domain/workflow/... -> ok
  • task check -> exit 0
  • the four disabled-route test cases fail against the pre-fix code (verified by stashing the daemon change) and pass with the fix.
Fixed in PR !1915 (branch fix/1913-intake-skip-disabled). What changed: - internal/daemon/daemon.go: in pollNATS, after the TaskByIssue existence check and before PublishTask, the issue's label-routed workflow is now checked. If it resolves and is disabled for the polling identity's org, one InfoContext line is logged (repo, issue, workflow, disabled) and pollNATS returns false without calling acknowledge, so the issue is re-discovered on a later poll and picked up if the workflow is re-enabled. Any error reading the org, the workflow definitions or the enablement logs a Warn and falls through to the previous publish behaviour; no routable definition keeps the current publish behaviour (the pin path parks). - internal/daemon/binding_target.go: new helper disabledRoutedWorkflow resolves org via identityOrg, builds the available definition set via activeWorkflows, routes via workflow.ResolveWorkflowID, and checks enablement.Enabled(org, routed), matching the filter dispatchOrgBindings already applies to armed bindings. - internal/daemon/intake_disabled_test.go: table-driven TestPollNATSSkipsDisabledRoutedWorkflow covering disabled bug/tdd, feature/feasibility and default/triage routes (skipped: returns false, nothing published to the task bus, no ack reaction on the forge), enabled route (publishes and acknowledges), disabled for a different org (still publishes), and fall-through on enablement, definitions and org read errors plus the no-routable-definition case. processNATSTask's park path, withdrawUnpolled and binding dispatch are unchanged; PublishTask's only caller is pollNATS, so chat/dashboard spawns through the Gateway are unaffected. Verified (all on the committed tree): - go test -short -count=1 ./internal/daemon/... -> ok - go test -short ./internal/domain/workflow/... -> ok - task check -> exit 0 - the four disabled-route test cases fail against the pre-fix code (verified by stashing the daemon change) and pass with the fix.
sam closed this issue 2026-11-12 13:45:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1913