You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parent context: surfaced during PR #681 review by @isadeks (issue #306). Needs maintainer approved before implementation (ADR-003).
Finding
LinearProjectMappingTable rows carry no workspace identifier. The only writer — onboard-project (cli/src/commands/linear.ts:~1484) — writes linear_project_id, repo, label_filter, optional team_id, status, onboarded_at, updated_at. So any attempt to delete a workspace's project mappings (e.g. during bgagent linear remove-workspace) cannot attribute rows to a workspace and matches nothing.
Because of this, PR #681 (remove-workspace) removed its mapping-cleanup path entirely (it was a provable no-op reported to the operator as success). This issue restores that capability the correct way.
Scope
Record linear_workspace_id on LinearProjectMappingTable rows at onboard time (onboard-project writer).
Backfill or migration strategy for existing rows (they predate the field).
Once the field exists, re-add workspace-scoped mapping cleanup to remove-workspace (the DELETE handler cdk/src/handlers/linear-remove-workspace.ts): re-introduce the paginated mapping scan/delete filtered on linear_workspace_id, its projectMappingTable.grantReadWriteData grant, the --keep-mappings flag, and the longer Lambda timeout — all of which feat(cli): bgagent linear remove-workspace + DELETE route + fail-closed resolver (#306) #681 removed as dead code.
Parent context: surfaced during PR #681 review by @isadeks (issue #306). Needs maintainer
approvedbefore implementation (ADR-003).Finding
LinearProjectMappingTablerows carry no workspace identifier. The only writer —onboard-project(cli/src/commands/linear.ts:~1484) — writeslinear_project_id,repo,label_filter, optionalteam_id,status,onboarded_at,updated_at. So any attempt to delete a workspace's project mappings (e.g. duringbgagent linear remove-workspace) cannot attribute rows to a workspace and matches nothing.Because of this, PR #681 (
remove-workspace) removed its mapping-cleanup path entirely (it was a provable no-op reported to the operator as success). This issue restores that capability the correct way.Scope
linear_workspace_idonLinearProjectMappingTablerows at onboard time (onboard-projectwriter).remove-workspace(the DELETE handlercdk/src/handlers/linear-remove-workspace.ts): re-introduce the paginated mapping scan/delete filtered onlinear_workspace_id, itsprojectMappingTable.grantReadWriteDatagrant, the--keep-mappingsflag, and the longer Lambda timeout — all of which feat(cli): bgagent linear remove-workspace + DELETE route + fail-closed resolver (#306) #681 removed as dead code.workspace_slug(registry) /linear_workspace_id(mappings) to turn the recurring slug→row lookups intoQuery(also noted in feat(cli): bgagent linear remove-workspace + DELETE route + fail-closed resolver (#306) #681 review N4).Fulfills
The
LinearProjectMappingTabledeletion acceptance criterion of #306 that PR #681 deferred.Refs #306