[Improve] Attribute tasks and PRs to the initiating user or named automation#14
Draft
roomote-roomote-v1[bot] wants to merge 3 commits into
Draft
Conversation
… fallback user ids
Author
|
Superseded by the current review summary: #14 (comment) |
Author
|
No new code issues found. See task
|
Author
|
Fixed both flagged issues:
Covered by a new webhook unit test plus the full bullmq suite; lint/typecheck/knip green. The PR description reflects both fixes. |
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.
What changed
Every task now resolves to a single initiator — either the user who started it or the named automation that did — and all attribution surfaces read only that:
resolveTaskAutomationDisplayName) maps task types, background-automation keys, and suggestion sources to the automation labels from the registry ("PR Reviewer", "Resolve PR Conflicts", "Suggest Ideas", "Triage Sentry Issues", etc.). The attribution snapshot stampsattributionSourceKind: 'automation'plus that label at task creation; unnamed automatic work falls into a shared "Automations" bucket.attributionOverrideaccepts an explicitdisplayNamefor callers that want to name themselves.author:roomotefilter value is gone (no real users yet, so no compat shims).> Created by PR Reviewer.(or the relevant automation) instead of always> Created by Roomote.; humans keep "Opened on behalf of".userId, and the guard allows automation-initiated tasks explicitly. Job tokens and MCP credentials already resolve lazily; the resolver was renamed toresolveCredentialUserIdForCloudJoband documented as credential plumbing, never attribution. Four Slack MCP endpoints that compared tokens against the raw jobuserIdcolumn now use the same lazy resolution so automation tasks keep Slack access. A lightweightdeploymentHasActiveCredentialUser()preflight keeps the old empty-deployment behavior: automation launchers skip (or record a failed run) up front when no active user exists, instead of recording a succeeded run for a job that would later fail credential resolution at dequeue; manual “Run now” triggers complete their pre-created queued run asskippedso it never sticks inqueued.This supersedes #13: its automation-name resolver and analytics dimension extraction are absorbed here, and this PR goes further by consolidating the read surfaces and removing the stamped user ids entirely.
Why this change was made
The Tasks By User chart mixed people with generic automation/bot labels, and attribution facts were spread across three overlapping systems (legacy
tasks.userId, the attribution snapshot, and the authorship-rules columns) stitched together differently per surface. Direction confirmed in the task thread: one initiator per task — user name or automation name — and simplify aggressively while the product has no real users.Impact
effectiveAuthor*/effectivePrOwner*) remain the feature-flagged override layer for git author and PR ownership, but analytics no longer depends on them.Screenshots