Repository navigation
fix(api): preserve approval and image error responses - #1224
Conversation
|
Deployment failed for project drydock-website with the following error: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughApproval and image services now parse error responses as Priority: ⬇️ Low Change: Bug fix Merge Risk: ⚪ Minimal · up to The error-handling changes preserve useful server messages while safely falling back for malformed responses, including the prune timeout flow. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Deployment failed for project drydockdemo-website with the following error: |
|
@coderabbitai review Please review the current head, 2eb254f. The scope is frontend handling of malformed server/proxy error envelopes. Check that null JSON preserves HTTP status and fallback messages, valid server errors are unchanged, and the Images regression exercises the real prune service without changing confirmation or request counts. Authentication and action policy are unchanged. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== HEAD =='
git rev-parse HEAD
echo '== PARENTS =='
git show -s --format='%P' HEAD
echo '== CHANGED FILES (parent..HEAD) =='
git diff --name-status HEAD^ HEAD
echo '== DIFF STAT =='
git diff --stat HEAD^ HEAD
echo '== TYPESCRIPT/VUE OUTLINE FOR CHANGED FILES =='
git diff --name-only HEAD^ HEAD | while IFS= read -r file; do
case "$file" in
*.ts|*.vue)
echo "--- $file"
ast-grep outline "$file" --items all 2>&1 || true
;;
esac
done
echo '== ERROR-ENVELOPE ACCESS SEARCH =='
rg -n -C 3 --glob '*.{ts,vue}' '\bbody\.error\b|\berror\.message\b|JSON\.parse\s*\(' . || true
echo '== PR DIFF =='
git diff --find-renames --find-copies --unified=80 HEAD^ HEADLength of output: 189651 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== RECENT COMMITS =='
git log --oneline --decorate -30
echo '== COMMITS MATCHING SCOPE =='
git log --all --oneline --regexp-ignore-case --grep='approval\|image.*error\|error.*image\|malformed\|null.*json\|prune'
echo '== TRACKED FILES MATCHING SCOPE =='
fd -t f . | rg -i '(approval|images|image).*?(test|spec)?\.(ts|vue)$|(?:approval|images|image).*\.(ts|vue)$' | head -n 250
echo '== SYMBOL REFERENCES =='
rg -n -C 2 --glob '*.{ts,vue}' 'Approvals|approvals|pruneImages|prune.*image|image-prune|ImagesView|read.*[Ee]rror|parse.*[Ee]rror' ui app | head -n 1000
echo '== CHANGES WITHIN LAST 30 COMMITS TO SCOPE FILES =='
git log -30 --oneline --name-only | awk '
/^[0-9a-f]{7,}/ { commit=$0 }
/(^|\/)([Aa]pproval|[Ii]mage|[Ee]rror)/ { print commit "\n" $0 }
' | head -n 500Length of output: 77909 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== SCOPED COMMIT FILES =='
for commit in 83ba5f0b ccc59519 9071ff8d; do
echo "--- $commit"
git show --format='%H%n%s' --name-status "$commit"
done
echo '== SCOPED COMMIT DIFFS =='
git show --format=fuller --find-renames --unified=35 83ba5f0b ccc59519 9071ff8d -- \
ui/src/services/approval.ts \
ui/src/services/images.ts \
ui/tests/services/approval.spec.ts \
ui/tests/services/images.spec.ts \
ui/tests/views/ImagesView.spec.ts \
ui/src/utils/api.ts
echo '== APPROVAL IMPLEMENTATION =='
sed -n '1,280p' ui/src/services/approval.ts
echo '== IMAGE IMPLEMENTATION =='
sed -n '1,210p' ui/src/services/images.ts
echo '== API READER AND ERROR TYPE =='
sed -n '1,180p' ui/src/utils/api.ts
sed -n '1,180p' ui/src/utils/error.ts
echo '== APPROVAL ERROR TESTS =='
sed -n '1,110p' ui/tests/services/approval.spec.ts
echo '== IMAGE SERVICE ERROR TESTS =='
sed -n '1,105p' ui/tests/services/images.spec.ts
sed -n '215,290p' ui/tests/services/images.spec.ts
echo '== IMAGES VIEW PRUNE TEST LOCATIONS =='
rg -n -C 8 'prun|confirm|still running|still-running|504|ApiError|mock.*images|services/images' ui/tests/views/ImagesView.spec.tsLength of output: 63534 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== IMAGES VIEW PRUNE CONTROL FLOW =='
rg -n -C 12 'function.*prune|pruneImages|status === 504|status.*504|still be running|confirm.*prune|handle.*Prune' ui/src/views/ImagesView.vue
echo '== IMAGES VIEW TEST SETUP =='
sed -n '1,180p' ui/tests/views/ImagesView.spec.ts
sed -n '500,730p' ui/tests/views/ImagesView.spec.ts
echo '== ALL SOURCE FILES CHANGED BY SCOPE COMMITS =='
git diff-tree --no-commit-id --name-only -r 83ba5f0b ccc59519 9071ff8d | sort -u
echo '== AUTH/ACTION-POLICY PATHS IN SCOPED COMMITS =='
git diff-tree --no-commit-id --name-only -r 83ba5f0b ccc59519 9071ff8d |
rg -n -i 'auth|action.*policy|policy.*action' || true
echo '== DIFFERENCE FROM PRE-SCOPE BASE TO HEAD IN AFFECTED SOURCE =='
git diff --check 83ba5f0b^..HEAD -- ui/src/services/approval.ts ui/src/services/images.ts ui/tests/services/approval.spec.ts ui/tests/services/images.spec.ts ui/tests/views/ImagesView.spec.ts
git diff --unified=12 83ba5f0b^..HEAD -- ui/src/services/approval.ts ui/src/services/images.ts ui/tests/services/approval.spec.ts ui/tests/services/images.spec.ts ui/tests/views/ImagesView.spec.tsLength of output: 32843
The approval and image services preserve the fallback message and HTTP status for JSON
|
|
@coderabbitai review Please complete the first full review at unchanged head 2eb254f now that the included-review allowance has reopened. The scoped source inspection found no actionable defects. Scope remains frontend handling of invalid server/proxy error envelopes, preserving HTTP status, valid diagnostics and Images confirmation/request behavior. No authentication or action-policy changes. |
|
✅ Action performedFull review finished. |
biggest-littlest
left a comment
There was a problem hiding this comment.
The current head preserves HTTP status and valid diagnostics for malformed approval/image error envelopes. The full local gate and all required CI checks pass. CodeRabbit completed the source review without actionable findings.
Change
An unsuccessful Approvals or Images response containing JSON
nullthrew a TypeError while readingbody.error, discarding the HTTP status. Validate the parsed value as unknown before accessing the error message. All six approval operations and all three image operations retain their fallback and HTTP status, while nonblank server diagnostics remain verbatim.For a prune timeout (504), this also restores the existing warning that pruning may still be running and the inventory reload. The two services share this root cause, so their fixes are reviewed together.
Request paths, request bodies, successful responses, approval eligibility, prune confirmation and backend authorization are unchanged.
Verification
Threat model for review: normal frontend handling of an unexpected server/proxy response. This does not change authentication, authorization, update dispatch or release behavior.
Changelog
nulland malformed error envelopes.error.ImagesViewtest using the realpruneImagesservice.Concerns