Skip to content

[1926 by GPT-5.6 Sol] Add repo-level configuration for automatic CI failure follow-up - #1929

Merged
propr-dev[bot] merged 2 commits into
1926-epic-automatic-ci-vn4from
1926/gpt-5.6-sol-add-repo-level-configurat-20260824-0813-3t5
Aug 24, 2026
Merged

propr-dev[bot] merged 2 commits into
1926-epic-automatic-ci-vn4from
1926/gpt-5.6-sol-add-repo-level-configurat-20260824-0813-3t5

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #1926

Branch: 1926/gpt-5.6-sol-add-repo-level-configurat-20260824-0813-3t5
Commits: ✅ Changes committed (43e8eb3)


AI Processing Completed

Execution Details:

Summary:
Implemented repository-level automatic CI follow-up configuration.

Changes include:

  • Added autoFollowupOnFailedCi, defaulting to false.
  • Added API validation and rejection of non-boolean values.
  • Normalized legacy GET responses to return false.
  • Added exported isAutoCiFollowupEnabledForRepository(owner, repo) helper with fail-closed behavior.
  • Updated CLI types and add/update request handling.
  • Added validation, API persistence, backward-compatibility, and CLI preservation tests.

Verification completed successfully:

  • Core, API, and CLI builds/typechecks
  • Core, API, and CLI linting
  • All new focused tests
  • Existing config-loader regression tests

Detailed Logs:

  • Conversation: 74 messages
  • Session: 01a032d5-ff8f-7f60-a555-59a237561543

Log files stored at:

  • conversation: /tmp/claude-logs/issue-1926-2026-08-24T08-21-54-009Z-conversation.json
  • output: /tmp/claude-logs/issue-1926-2026-08-24T08-21-54-009Z-output.txt
Latest Conversation Messages

This PR was created automatically by ProPR after processing issue #1926.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…atic CI fail

Implemented by ProPR AI using gpt-5.6-sol model.

Implementation completed successfully.
@propr-dev

propr-dev Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix
Triggered automatically by Planner execution settings.

@propr-dev propr-dev Bot added the ultrafix label Aug 24, 2026
@propr-dev

propr-dev Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — claude:claude-sonnet-5

Overall Evaluation

This PR adds a autoFollowupOnFailedCi repository-level configuration option: a new optional field on RepoToMonitor, API validation/persistence/normalization, an exported isAutoCiFollowupEnabledForRepository helper with fail-closed defaults, and matching CLI type/option plumbing in addRepo/updateRepo. The backend and CLI changes are internally consistent and well tested (validation edge cases, legacy-missing-field normalization, CLI preservation across unrelated updates). However, tracing the new field through the existing repository-management round trip used by the web admin UI reveals a real data-loss regression: the primary UI save path does not carry the new field, and the new POST normalization silently coerces the missing value to false, which will quietly disable a user's previously-configured setting on the very next unrelated UI save.

✅ Solid validation and backward compatibility — configRepoValidation.ts correctly rejects non-boolean values and defaults missing values to false, matching legacy-config expectations, and this is thoroughly covered by configRepoValidation.test.ts.

✅ Fail-closed helper design — isAutoCiFollowupEnabledForRepository in configLoader.ts treats load failures and unmatched repos as disabled, which is the safe default for an autonomous-action gate.

✅ CLI round-trip correctness — addRepo/updateRepo in packages/cli/src/api/repos.ts fetch the current config via GET (which always includes the normalized field) before re-posting, so CLI-driven updates correctly preserve autoFollowupOnFailedCi for untouched repos, as verified by repos.test.ts.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 New setting is silently wiped by normal web UI saves

  • Required behavior: Changed behavior added by this PR (the autoFollowupOnFailedCi field and its default-to-false-when-missing normalization in configRepoValidation.ts) must not silently discard a previously persisted, user-configured value; a repository-level setting that can be reset without any user action or warning is internally inconsistent with the purpose of adding persistent, repo-scoped configuration.
  • Evidence: packages/api/routes/configRepoValidation.ts:69 (autoFollowupOnFailedCi: candidate.autoFollowupOnFailedCi ?? false) combined with packages/api/routes/configRoutes.ts postRepos, which fully replaces repos_to_monitor with whatever the client posts (no merge against previously stored values). The unchanged UI hook propr-ui/src/hooks/useRepositoryManagement.ts:100-115 reconstructs each Repo from only {id, name, enabled, alias, baseBranch, starred, hidden} and then posts this stripped object back via updateRepoConfig (useRepositoryManagement.ts:238, configApi.ts:58-59). Since alias and baseBranch are carried through this UI model (matching the established pattern) but autoFollowupOnFailedCi is not, any admin using the web UI to make an unrelated change (e.g., toggling a different repo, editing an alias) will cause the CLI/API-configured autoFollowupOnFailedCi: true to be silently reset to false for every repository in the list.
  • Minimum fix: In postRepos (packages/api/routes/configRoutes.ts), when normalizing each incoming repo, merge against the matching previously-stored repo (already loaded as previousRepos) so that an omitted autoFollowupOnFailedCi preserves the prior persisted value for existing repos (falling back to false only for repos with no prior stored entry), rather than always defaulting missing input to false.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 isAutoCiFollowupEnabledForRepository has no caller yet

The new helper in packages/core/src/daemon/configLoader.ts is exported but nothing in this diff (or the supplied surrounding context, e.g. analysis_worker.ts's existing global-threshold gate) invokes it. This appears to be intentionally scoped as infrastructure for a follow-up change that wires it into the actual CI-failure/follow-up trigger path, consistent with the PR's own framing as adding "configuration." Not a blocker since the PR's stated scope is the configuration surface, but worth confirming/tracking so the feature doesn't remain inert.

S2: 🟢 No CLI flag exposes the new option

packages/cli/src/commands/repoCommands.ts (repo add, repo toggle) was not updated with a --auto-followup-on-failed-ci style flag even though AddRepoOptions/UpdateRepoOptions now accept autoFollowupOnFailedCi. Users can currently only set this through direct API calls or custom scripting against packages/cli/src/api/repos.ts, not through the documented CLI commands. This is optional polish rather than a blocker since the underlying API support is present and tested.

S3: 🟢 Web UI has no visibility or control for the new setting

Beyond the data-loss issue captured in F1, propr-ui/src/api/proprTypes.ts and the repository management UI have no field/control for autoFollowupOnFailedCi at all, so admins using the primary web UI have no way to see or toggle this setting. Once F1 is fixed to stop the silent reset, it would still be worth adding UI support so the feature is fully usable outside the CLI/API.

Score

The backend/CLI implementation is clean and well tested, and all current-head checks pass, but tracing the new field through its real write path (the web admin UI) exposes a genuine silent data-loss regression introduced by this PR's normalization logic, which is a merge blocker.

Score: 4/10


🤖 Review Details

  • Model: Claude Sonnet 5
  • Time: 2m 20s
  • Tokens: 66,752 (53,213 in / 13,539 out)
  • Cost: $0.27

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 95de9b8

Addressed 1 AI review comment (IDs: 5392688270)

Summary of Changes

Implemented F1 only.

  • postRepos now preserves an existing repository’s autoFollowupOnFailedCi when omitted, matched by stable repository ID.
  • Explicit boolean updates still apply.
  • New repositories and malformed legacy values default to false.
  • Added regression coverage in configRepoRoutes.test.ts.

Verification passed:

  • Focused route tests: 3/3
  • API typecheck
  • API lint
  • git diff --check

Only configRoutes.ts and its test changed. No commit created.


🤖 Implementation Details

  • Model: GPT-5.6 Sol (high)
  • Requested By: @propr-ultrafix
  • Time: 3m 39s
  • Tokens: 516,464 (510,255 in / 6,209 out)
  • Cost: $0.68

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

Implemented F1 only.

- `postRepos` now preserves an existing repository’s `autoFollowupOnFailedCi` when omitted, matched by stable repository ID.
- Explicit boolean updates still apply.
- New repositories and malformed legacy values default to `false`.
- Added regression coverage in [configRepoRoutes.test.ts](/tmp/git-processor/worktrees/integry/propr/pr-1929-followup-2026-08-24T08-36-13/packages/api/test/configRepoRoutes.test.ts).

Verification passed:

- Focused route tests: 3/3
- API typecheck
- API lint
- `git diff --check`

Only [configRoutes.ts](/tmp/git-processor/worktrees/integry/propr/pr-1929-followup-2026-08-24T08-36-13/packages/api/routes/configRoutes.ts) and its test changed. No commit created.

PR: #1929
Comment by: @propr-ultrafix (ID: 0)
Model: gpt-5.6-sol
@propr-dev

propr-dev Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — claude:claude-sonnet-5

Overall Evaluation

This PR adds a new repository-level autoFollowupOnFailedCi boolean setting: an optional field on RepoToMonitor, API-side validation/normalization, backward-compatible GET/POST handling, CLI type/option support, and a new exported isAutoCiFollowupEnabledForRepository helper with fail-closed semantics. The change is well-scoped, self-contained, and matches the stated objective of adding repo-level configuration plumbing (not necessarily wiring it into behavior yet). All current head checks pass (10 passed, 2 neutral/skipped, 0 failed).

I traced the trickiest part of the diff — the POST /api/config/repos handler's "preserve omitted field" logic in packages/api/routes/configRoutes.ts — against both the new tests and the existing UI/CLI consumers (propr-ui/src/hooks/useRepositoryManagement.ts, packages/cli/src/api/repos.ts). The id-based matching against previousRepos correctly preserves the flag for legacy clients (UI) that don't yet send the field, while still respecting an explicit false sent by an aware client. I did not find a correctness regression in the changed control/data paths.

✅ Backward-compatible persistence for legacy clients — configRoutes.ts's postRepos matches incoming repos to previousRepos by id and only defaults to false when the field is genuinely new (not previously stored), so the existing UI (which doesn't yet send this field) cannot silently flip it back to false on unrelated saves (e.g., toggling enabled).

✅ Fail-closed helper design — isAutoCiFollowupEnabledForRepository in packages/core/src/daemon/configLoader.ts explicitly returns false on any load error or missing/malformed config, consistent with its documented safety intent, and is symmetric with the GET/POST normalization that always coerces the value to a strict boolean.

✅ Solid layered test coverage — Validation (configRepoValidation.test.ts), route-level backward-compatibility/preservation (configRepoRoutes.test.ts), and CLI preservation (repos.test.ts) each verify the specific new behavior they own, including the “omitted vs. explicit false” distinction.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 New helper has no wired consumer

isAutoCiFollowupEnabledForRepository is exported from packages/core/src/daemon/configLoader.ts and re-exported via packages/core/src/index.ts, but nothing in this diff calls it to actually gate automatic CI follow-up behavior. This appears intentional given the PR's stated scope ("Implemented repository-level automatic CI follow-up configuration"), but it's worth confirming a follow-up PR will wire this into the actual CI-follow-up trigger path so the setting isn't dead code indefinitely.

S2: 🟢 Helper doesn't consider the repository's enabled state

isAutoCiFollowupEnabledForRepository only checks autoFollowupOnFailedCi === true by name match; it doesn't check whether the repository is currently enabled for monitoring. If a repo is later disabled but still has autoFollowupOnFailedCi: true persisted, a future caller of this helper could get true for a repo that's no longer actively monitored. Since the helper has no current caller, this isn't a live bug, but it's worth deciding the intended semantics before wiring it up.

S3: 🟢 No dedicated unit tests for the new core helper

Unlike the validation, route, and CLI layers, isAutoCiFollowupEnabledForRepository (in packages/core/src/daemon/configLoader.ts) has no new test file in this diff covering its matching logic, case-insensitivity, or fail-closed error path. Adding a focused test would strengthen confidence in this helper before it's consumed elsewhere, though it's optional since the function is currently unused.

S4: 🟢 Frontend type/UI not updated for the new field

propr-ui/src/api/proprTypes.ts's MonitoredRepo interface and propr-ui/src/hooks/useRepositoryManagement.ts were not updated to read/write autoFollowupOnFailedCi. This is handled gracefully server-side (the field is preserved via id matching), but end users currently have no UI to toggle this setting — likely fine if a follow-up UI PR is planned, but worth tracking.

Score

No actionable findings were identified, the changed logic is internally consistent with backward-compatibility handled correctly, and all current-head checks pass.

Score: 9/10


🤖 Review Details

  • Model: Claude Sonnet 5
  • Time: 2m 5s
  • Tokens: 68,819 (56,278 in / 12,541 out)
  • Cost: $0.27

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Aug 24, 2026
@propr-dev
propr-dev Bot merged commit aa29e6f into 1926-epic-automatic-ci-vn4 Aug 24, 2026
14 checks passed
@propr-dev
propr-dev Bot deleted the 1926/gpt-5.6-sol-add-repo-level-configurat-20260824-0813-3t5 branch August 24, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants