Skip to content

Pass FwHeadless status through on snapshot regeneration - #2880

Merged
myieye merged 1 commit into
developfrom
claude/regenerate-snapshot-status
Oct 31, 2026
Merged

myieye merged 1 commit into
developfrom
claude/regenerate-snapshot-status

Conversation

@myieye

@myieye myieye commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

POST /api/fw-lite/sync/regenerate-snapshot/{projectId} turned every FwHeadless failure into a 500, because FwHeadlessClient.RegenerateProjectSnapshot returned only the response body and the controller called Problem(result) without a status. FwHeadless answers 404 for an unknown commit id (and for an unknown or never-synced project), so those now come back as a 404 with FwHeadless's message.

  • FwHeadlessClient.RegenerateProjectSnapshot returns (bool success, HttpStatusCode statusCode, string? error), the same shape as SyncMercurialAndHarmony.
  • SyncController.RegenerateProjectSnapshot passes that status to Problem(error, statusCode: ...). Other failures keep their own status; transport exceptions still hit the existing catch and give a 500.
  • No OpenAPI change: the endpoint already declares 404 and 500.
  • Added FwHeadlessClientTests, a unit test with a mocked HttpMessageHandler returning 404.

Heads-up: #2877 also edits this method (it makes commitId required). This PR deliberately leaves the signature's parameters alone, so the merge conflict should be a small one: keep #2877's Guid commitId together with this PR's tuple return type.

Test plan

  • CI: FwHeadlessClientTests.RegenerateProjectSnapshot_PassesThroughFwHeadlessStatusCode passes
  • Manually: call the endpoint with an unknown commitId and get a 404 with "Commit … not found" instead of a 500

Generated by Claude Code

FwHeadlessClient.RegenerateProjectSnapshot now returns
(success, statusCode, error) like SyncMercurialAndHarmony, and
SyncController uses that status for its Problem response, so an
unknown commit or project gives a 404 instead of a 500.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AM78WDo2i51h7253MJHFy9
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aef9b793-2b79-4441-8abb-e4086d62c86a
Commits

Reviewing files that changed from the base of the PR and between 5efc48f and f922ee9.

Files selected for processing: 3
  • backend/LexBoxApi/Controllers/SyncController.cs
  • backend/LexBoxApi/Services/FwHeadlessClient.cs
  • backend/Testing/LexBoxApi/Services/FwHeadlessClientTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the 📦 Lexbox issues related to any server side code, fw-headless included label Oct 31, 2026
@myieye
myieye merged commit 2459e09 into develop Oct 31, 2026
23 checks passed
@myieye
myieye deleted the claude/regenerate-snapshot-status branch October 31, 2026 09:29
myieye pushed a commit that referenced this pull request Oct 31, 2026
Keeps this branch's required commitId with #2880's status-passing return type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AM78WDo2i51h7253MJHFy9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 Lexbox issues related to any server side code, fw-headless included

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants