Repository navigation
Description
Context
The user-contributed half of the request asks for automatic pull request assignment with three knobs:
- "Keep the feature optional and disabled by default."
- "Optionally allow configuring a default assignee per repository, overriding the issue author."
- "Optionally request a GitHub review from the assigned user."
That is three per-repository options. They belong on RepoToMonitor beside autoFollowupOnFailedCi and cancelCiDuringFollowup, which are the same shape of thing: opt-in automation configured per repository, off by default.
This task adds the configuration end to end - the type, the validator, the "a client that does not know the field must not clear it" preservation, the resolver the worker will call, the CLI flags and the MCP fields. The worker behaviour that consumes it is the next task, and the Web UI control is the one after. Splitting it this way keeps each diff focused, and it means the options can be reviewed as data before anything acts on them.
configRepoValidation.ts establishes a hard rule this task must follow: every per-repository option needs a preserveRepo* function and must be added to the preserveRepoSettings chain, because partial and legacy clients (the CLI, scripts, older UIs) post the whole repository list without fields they do not know about. Forgetting it means a propr repo toggle silently turns off auto-assignment.
Requirements
- Add to
RepoToMonitorinpackages/core/src/config/configManager.ts:autoAssignPullRequests?: boolean- off when absent.autoAssignDefaultAssignee?: string | null- a GitHub login replacing the issue author; null or absent means use the issue author.autoAssignRequestReview?: boolean- off when absent.
- Normalize and validate all three in
normalizeRepoConfig, validating the login with the sharedisGitHubLogin. - Add
preserveRepoAutoAssignand include it in thepreserveRepoSettingschain; treat the three options as repository-wide, applied to every branch entry, matching how notifications and visual previews already behave. - Default all three in
withDefaultRepoOptions. - Add
resolveRepositoryAutoAssignment(owner, repo)topackages/core/src/daemon/configLoader.ts, returning the effective settings and failing closed (disabled) when the configuration cannot be read. - Add CLI flags to
propr repo addandpropr repo toggle:--auto-assign <on|off>,--auto-assign-to <login|none>,--auto-assign-review <on|off>; show the values inpropr repo list; send only explicitly supplied values. - Add the three fields to the MCP
update_repository_configurationtool and ensureget_repository_configurationreturns them. - Tests covering validation, preservation under a partial write, the repository-wide application across branch entries, the resolver's fail-closed behaviour and the CLI flag parsing.
Implementation Specification
Files modified
packages/core/src/config/configManager.ts- the three fields onRepoToMonitor.packages/api/routes/configRepoValidation.ts- normalization, validation, preservation.packages/core/src/daemon/configLoader.ts- the resolver.packages/cli/src/api/repos.ts- the typed options.packages/cli/src/commands/repoCommands.ts- the flags and the list column.packages/api/mcp/toolsManagement.ts- the tool fields.packages/api/test/repoAutoAssignConfig.test.ts(new file).
Step-by-step
- Add the fields to
RepoToMonitorwith comments stating the default and the override semantics. - In
configRepoValidation.ts: add the two booleans toOPTIONAL_BOOLEAN_FIELDS, add anormalizeAutoAssignDefaultAssigneehelper validating the login, and writepreserveRepoAutoAssignfollowingpreserveRepoNotifications- resolve the repository-wide value, apply an explicit change to every entry, and keep the stored value for entries that omit the field. - Add
resolveRepositoryAutoAssignmenttoconfigLoader.ts, followinggetCancelCiDuringFollowupWorkflowsForRepository's structure, including its fail-closed behaviour on an unreadable configuration. - Add the CLI flags, converting
on/offandnoneexplicitly rather than treating any string as truthy. - Add the MCP fields with descriptions and include them in the patch key list.
- Add the test file.
Acceptance Criteria
npm run typecheck,npm run lintand the API tests pass.- A repository with none of the fields set reports all three as disabled or null; existing configurations are unchanged.
POST /api/config/reposwith the three fields persists them; a non-boolean, a non-login string, or an unknown login shape is rejected with 400 naming the repository and field.- Posting the repository list without the fields - as the CLI and older clients do - leaves the stored values untouched.
- Setting any of the three on one branch entry applies it to every entry of that repository.
autoAssignDefaultAssignee: nullclears the override so the issue author is used again.resolveRepositoryAutoAssignmentreturns the effective values, and returns disabled when the configuration cannot be read.propr repo add owner/name --auto-assign on --auto-assign-to octocat --auto-assign-review onpersists all three;propr repo togglechanges only the flags given;--auto-assign-to noneclears the override;propr repo listshows the state.- MCP
update_repository_configurationsets and clears each field, andget_repository_configurationreturns them. - No behaviour change yet: nothing reads the resolver in this task.
Created by ProPR AI Planner
Activity
propr-dev commentedon Oct 8, 2026
Suggested Implementation:
Implementation Approach
These three options are structurally identical to options this codebase already has, so the approach is to follow the existing pattern exactly rather than invent a new one.
autoFollowupOnFailedCiandcancelCiDuringFollowupare both opt-in automation, per repository, off by default, with an operator-supplied payload (a workflow list) attached to one of them. Auto-assignment is the same shape with a login instead of a workflow list.Two parts of that pattern are load-bearing and easy to get wrong.
Preservation.
configRepoValidation.tsdocuments the rule in its own comments: "Clients that do not know the option (older UIs, the CLI, scripts) submit repositories without it; their writes must never silently switch it off." Every per-repository option therefore has apreserveRepo*function wired intopreserveRepoSettings. For auto-assignment the consequence of forgetting is specific and quiet: someone runspropr repo toggle owner/nameto flip monitoring, the CLI posts the list without the auto-assign fields, and automatic assignment silently stops. No error, no log, just PRs that stop getting assigned.Repository-wide, not per branch entry. A repository can have several
RepoToMonitorentries, one per monitored base branch. Notifications, the GitHub PR template fallback and visual previews are all repository-wide and apply a change to every entry. Auto-assignment must be too: "assign the PR to the issue author" is a property of how the team works, not of which branch the work targets, and per-branch divergence would mean the same pull request behaved differently depending on its base.The default assignee is a login, not an id. This is the one place in the feature that stores a login rather than a stable id. That is deliberate: an operator types a login, and a configuration file holding
octocatis reviewable while one holding583231is not. The cost is that a renamed account breaks the override - which fails loudly (GitHub refuses the assignee, the worker logs it and falls back to the issue author) rather than silently assigning the wrong person, which is the failure an id would risk if the id were ever mistyped.The resolver fails closed. An unreadable repository configuration returns disabled, matching
isCancelCiDuringFollowupEnabledForRepository. Automation that writes to the customer's repository must not run on a guess.File:
packages/core/src/config/configManager.tsWhy this file:
RepoToMonitoris the shared contract for per-repository configuration, consumed by the API validator, the daemon resolver, the CLI client and the MCP tool. The defaults have to be documented here because every one of those readers depends on "absent means off".File:
packages/api/routes/configRepoValidation.tsWhy this file: the single validator for every repository write, and the home of the preservation chain. Both halves have to change here: validation rejects a malformed login before it can reach GitHub, and preservation is what stops the CLI from silently clearing the options.
File:
packages/core/src/daemon/configLoader.tsWhy this file: the worker and daemon read per-repository options through this module, which already owns the fail-closed convention for them. Putting the resolver here means the next task's worker code needs no knowledge of how the options are stored or of the branch-entry layout.
File:
packages/cli/src/api/repos.tsWhy this file: the CLI builds the whole repository list client-side and posts it back, so it must be able to express "I am not changing this field" by omitting it. The existing
notificationsEnabledandautoResolveMergeConflictshandling is the model.@@ in addRepo's new entry ...(options.notificationsEnabled !== undefined && { notificationsEnabled: options.notificationsEnabled }), + // Omitted unless the flag was given, so the server's preservation chain + // keeps whatever the repository already had. + ...(options.autoAssignPullRequests !== undefined && { autoAssignPullRequests: options.autoAssignPullRequests }), + ...(options.autoAssignDefaultAssignee !== undefined && { autoAssignDefaultAssignee: options.autoAssignDefaultAssignee }), + ...(options.autoAssignRequestReview !== undefined && { autoAssignRequestReview: options.autoAssignRequestReview }),@@ in updateRepo's updatedRepo ...(updates.notificationsEnabled !== undefined && { notificationsEnabled: updates.notificationsEnabled }), + ...(updates.autoAssignPullRequests !== undefined && { autoAssignPullRequests: updates.autoAssignPullRequests }), + // Explicit null is meaningful (clear the override), so the presence check + // must be on undefined rather than on truthiness. + ...(updates.autoAssignDefaultAssignee !== undefined && { autoAssignDefaultAssignee: updates.autoAssignDefaultAssignee }), + ...(updates.autoAssignRequestReview !== undefined && { autoAssignRequestReview: updates.autoAssignRequestReview }),File:
packages/cli/src/commands/repoCommands.tsWhy this file: the flags and the list rendering.
on/off/noneare converted explicitly rather than treated as truthy strings, matchingparseAutoResolveConflictsalready in this file - otherwise--auto-assign offwould turn the feature on.@@ in the list table columns + { heading: 'Auto-assign', values: repos.map(formatAutoAssign) },File:
packages/api/mcp/toolsManagement.tsWhy this file:
update_repository_configurationbuilds its patch from an explicit key list, so a field absent from both the schema and that list is unwritable from MCP.get_repository_configurationreturns the raw repository object, so it needs no change to read them back.File:
packages/api/test/repoAutoAssignConfig.test.ts(new file)Why this file: the preservation rule is the one thing here that fails silently in production, and the branch-entry behaviour is the one that produces inconsistent results depending on a PR's base. Both need explicit tests; neither is visible from a single-entry happy path.
propr-dev commentedon Oct 9, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-52897/claude-opus-5-5-add-repository-configurat-20261009-1024-rxe2888-epic-task-assignment-1m4issue-2897-20261009-1024-claude-opus-5-5-rxe🔍 Track Task Execution