feat(dexdex): support repository selector for CreateUnitTask#280
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 647ed9b5fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| autoGroupID := buildAutoRepositoryGroupID(repositoryID) | ||
| if cleanupErr := h.store.DeleteRepositoryGroup(workspaceID, autoGroupID); cleanupErr != nil { | ||
| if !isNotFoundError(cleanupErr) { | ||
| err := fmt.Errorf("failed to delete auto repository group %s: %w", autoGroupID, cleanupErr) | ||
| h.logger.Error("DeleteRepository auto-group cleanup failed", | ||
| "workspace_id", workspaceID, | ||
| "repository_id", repositoryID, | ||
| "repository_group_id", autoGroupID, | ||
| "error", cleanupErr, | ||
| ) | ||
| return nil, connect.NewError(connect.CodeInternal, err) | ||
| } | ||
| } else { |
There was a problem hiding this comment.
Delay auto-group cleanup until delete can succeed
When a repository belongs to a normal group and also has repository-targeted tasks, this block removes the singleton auto group before DeleteRepository() checks the remaining references. The RPC still returns FailedPrecondition because the normal group keeps the repo “in use”, but the state is already mutated: existing tasks that stored that auto-group ID can no longer dispatch retries/forks because CreateSubTask, RetrySubTask, and ForkSession all call GetRepositoryGroup(task.RepositoryGroupId) and skip dispatch when it is missing (task_handler.go and session_handler.go).
Useful? React with 👍 / 👎.
Summary
repository_idtoCreateUnitTaskRequestand enforce exactly-one selector validation withrepository_group_idauto-repo-singleton-<repository_id>) whenrepository_idis useddocs/Test Plan
cd protos/dexdex && buf lint && buf buildcd protos/dexdex && PATH="$(pwd)/../../apps/dexdex/node_modules/.bin:$PATH" buf generate && PATH="$(pwd)/../../apps/dexdex/node_modules/.bin:$PATH" buf generate --template buf.gen.web.yamlgo test ./servers/dexdex-main-server/...cd apps/dexdex && pnpm test