Skip to content

fix(ci): unblock main — align reporting 500 test with sanitized detail - #826

Merged
groupthinking merged 1 commit into
mainfrom
claude/determined-maxwell-pj53nx
Jul 17, 2026
Merged

fix(ci): unblock main — align reporting 500 test with sanitized detail#826
groupthinking merged 1 commit into
mainfrom
claude/determined-maxwell-pj53nx

Conversation

@groupthinking

Copy link
Copy Markdown
Owner

Summary

main CI has been red on the test job since the #805 merge (~2h) — 1 failed, 7163 passed. The single failure is a stale test, not a code regression:

  • reporting_routes.generate_dashboard_url already returns a sanitized HTTPException(status_code=500, detail="Internal server error") (CWE-209 hardening — merged to main).
  • But tests/unit/test_cloud_routes.py::TestReportingRoutes::test_generate_dashboard_url_service_error still asserted "Failed to generate" in detail, which no longer holds → AssertionError: assert 'Failed to generate' in 'Internal server error'.

This is a symptom of the 500-hardening work being split across the duplicate-PR cluster: the source-sanitization half landed on main while the matching test update lived only in the still-open #818.

Change

Update the assertion to expect the sanitized body and to prove the caught exception text does not leak to the client:

detail = response.json()["detail"]
assert detail == "Internal server error"
assert "Looker unavailable" not in detail

This is the same test edit already staged inside #818; landing it directly unblocks main without waiting on that PR's consolidation.

Verification

pytest tests/unit/test_cloud_routes.py::TestReportingRoutes::test_generate_dashboard_url_service_error
# 1 passed

Source-only test change; no production code touched.

Opened as draft for human review — not auto-merged.

🤖 Generated with Claude Code

https://claude.ai/code/session_014BmkwKENnbsy3v94m1sBid


Generated by Claude Code

reporting_routes.generate_dashboard_url already returns a static
detail="Internal server error" (CWE-209 hardening), but
test_generate_dashboard_url_service_error still asserted the old
"Failed to generate" substring, leaving main CI red on the `test`
job (1 failed, 7163 passed).

Update the assertion to expect the sanitized body and to prove the
caught exception text ("Looker unavailable") does not leak. This is
the same test change already staged in PR #818; landing it directly
unblocks main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BmkwKENnbsy3v94m1sBid
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-uvai Ready Ready Preview, Comment, Open in v0 Jul 17, 2026 3:43am

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • [‘architecture-gap’, ‘bug’, ‘ci-cd’, ‘ci/cd’, ‘copilot-rabbit’, ‘documentation’, ‘duplicate’, ‘enhancement’, ‘frontend’, ‘github_actions’, ‘good first issue’, ‘help wanted’, ‘high-priority’, ‘invalid’, ‘javascript’, ‘ml-model’, ‘needs-triage’, ‘pipeline-critical’, ‘placeholder-code’, ‘priority:high’, ‘python’, ‘python:uv’, ‘question’, ‘styling’, ‘tests’, ‘v0’]

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 77661e70-1e61-4ea7-ae33-352de30c0355

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/determined-maxwell-pj53nx
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/determined-maxwell-pj53nx

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 943238a.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@groupthinking
groupthinking marked this pull request as ready for review July 17, 2026 03:55
Copilot AI review requested due to automatic review settings July 17, 2026 03:55
@groupthinking
groupthinking enabled auto-merge July 17, 2026 03:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates a stale unit test to match sanitized HTTP 500 responses and prevent exception-detail leakage.

Changes:

  • Assert the static "Internal server error" response.
  • Verify the underlying Looker exception text is not exposed.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

✅ Created PR with unit tests: #830

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.

3 participants