Skip to content

Fix CI deprecation warnings and unbuffer test output#7568

Merged
galvana merged 2 commits intomainfrom
fix/cleanup-ci-deprecation-warnings
Mar 4, 2026
Merged

Fix CI deprecation warnings and unbuffer test output#7568
galvana merged 2 commits intomainfrom
fix/cleanup-ci-deprecation-warnings

Conversation

@galvana
Copy link
Contributor

@galvana galvana commented Mar 4, 2026

Summary

  • Replace deprecated HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT across 27 files (19 src, 8 tests) to eliminate starlette DeprecationWarnings in CI
  • Add -s to pytest addopts so startup logs appear before tests run instead of being buffered and dumped at the end by pytest's capture

Test plan

  • CI passes with no HTTP_422_UNPROCESSABLE_ENTITY deprecation warnings
  • Startup logs appear before test results in CI output
  • All existing tests continue to pass

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated HTTP 422 error responses across API endpoints to use the latest status code standard.
    • Improved CI test logging by disabling output capture during test runs to resolve buffered startup logs.

Replace deprecated HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT
across 27 files to eliminate starlette DeprecationWarnings in CI. Add -s to pytest
addopts so startup logs appear before tests run instead of being buffered to the end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 4, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Mar 4, 2026 10:33pm
fides-privacy-center Ignored Ignored Mar 4, 2026 10:33pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cbf54c10-ca91-4853-8d0a-b9d6230ed065

📥 Commits

Reviewing files that changed from the base of the PR and between 41f7587 and 065fc78.

📒 Files selected for processing (29)
  • changelog/7568-cleanup-ci-warnings.yaml
  • pyproject.toml
  • src/fides/api/api/v1/endpoints/connection_endpoints.py
  • src/fides/api/api/v1/endpoints/consent_request_endpoints.py
  • src/fides/api/api/v1/endpoints/dataset_config_endpoints.py
  • src/fides/api/api/v1/endpoints/drp_endpoints.py
  • src/fides/api/api/v1/endpoints/dsr_package_link.py
  • src/fides/api/api/v1/endpoints/generic_overrides.py
  • src/fides/api/api/v1/endpoints/messaging_endpoints.py
  • src/fides/api/api/v1/endpoints/partitioning_endpoints.py
  • src/fides/api/api/v1/endpoints/policy_endpoints.py
  • src/fides/api/api/v1/endpoints/privacy_request_endpoints.py
  • src/fides/api/api/v1/endpoints/saas_config_endpoints.py
  • src/fides/api/api/v1/endpoints/storage_endpoints.py
  • src/fides/api/api/v1/exception_handlers.py
  • src/fides/api/common_exceptions.py
  • src/fides/api/db/crud.py
  • src/fides/api/db/safe_crud.py
  • src/fides/api/main.py
  • src/fides/api/util/connection_util.py
  • src/fides/api/util/consent_util.py
  • tests/api/v1/endpoints/test_dataset_endpoints.py
  • tests/api/v1/endpoints/test_dsr_package_link.py
  • tests/ctl/core/test_api.py
  • tests/ops/api/v1/endpoints/test_connection_config_endpoints.py
  • tests/ops/api/v1/endpoints/test_dataset_test_endpoints.py
  • tests/ops/api/v1/endpoints/test_partitioning_endpoints.py
  • tests/ops/api/v1/endpoints/test_user_endpoints.py
  • tests/ops/api/v1/endpoints/test_user_permission_endpoints.py

📝 Walkthrough

Walkthrough

The pull request systematically replaces the deprecated HTTP status code constant HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT across API endpoints, exception handlers, utilities, and tests. Additionally, pytest configuration is updated to disable output capture using the -s flag, and a changelog entry documents these CI improvements.

Changes

Cohort / File(s) Summary
Changelog & Configuration
changelog/7568-cleanup-ci-warnings.yaml, pyproject.toml
New changelog entry documenting the 422 status code migration and pytest output capture fix; pytest config updated with -s flag in addopts to disable buffering during CI test runs.
API Endpoint Status Code Updates
src/fides/api/api/v1/endpoints/connection_endpoints.py, src/fides/api/api/v1/endpoints/consent_request_endpoints.py, src/fides/api/api/v1/endpoints/dataset_config_endpoints.py, src/fides/api/api/v1/endpoints/drp_endpoints.py, src/fides/api/api/v1/endpoints/dsr_package_link.py, src/fides/api/api/v1/endpoints/generic_overrides.py, src/fides/api/api/v1/endpoints/messaging_endpoints.py, src/fides/api/api/v1/endpoints/partitioning_endpoints.py, src/fides/api/api/v1/endpoints/policy_endpoints.py, src/fides/api/api/v1/endpoints/privacy_request_endpoints.py, src/fides/api/api/v1/endpoints/saas_config_endpoints.py, src/fides/api/api/v1/endpoints/storage_endpoints.py
HTTP 422 status constant replaced in imports and HTTPException raises across OAuth, dataset, privacy request, and config-related validation error handlers.
Core Exception & Main Handler Updates
src/fides/api/api/v1/exception_handlers.py, src/fides/api/common_exceptions.py, src/fides/api/main.py
HTTP status code constant updated in request validation exception handlers and common exception classes (ClientWriteFailedError, InvalidScopeError).
Database & Utility Status Code Updates
src/fides/api/db/crud.py, src/fides/api/db/safe_crud.py, src/fides/api/util/connection_util.py, src/fides/api/util/consent_util.py
HTTP 422 status constant replaced in CRUD delete operations and connection/consent validation utilities.
Test Status Code Assertions
tests/api/v1/endpoints/test_dataset_endpoints.py, tests/api/v1/endpoints/test_dsr_package_link.py, tests/ctl/core/test_api.py, tests/ops/api/v1/endpoints/test_connection_config_endpoints.py, tests/ops/api/v1/endpoints/test_dataset_test_endpoints.py, tests/ops/api/v1/endpoints/test_partitioning_endpoints.py, tests/ops/api/v1/endpoints/test_user_endpoints.py, tests/ops/api/v1/endpoints/test_user_permission_endpoints.py
Test imports and assertions updated to expect HTTP_422_UNPROCESSABLE_CONTENT instead of the deprecated HTTP_422_UNPROCESSABLE_ENTITY constant.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hoppity-hop through the codebase wide,
Constants renamed with whisker-ed pride,
Four-two-two grows more bright and new,
CI logs flowing without a clue,
This cleanup brings peace, it's true!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a clear summary of changes and test plan, but lacks the required template structure with sections like ticket reference, code changes list, and pre-merge checklist items. Follow the repository's description template: add ticket reference, organize changes into the Code Changes section, include Steps to Confirm, and complete the Pre-Merge Checklist.
Docstring Coverage ⚠️ Warning Docstring coverage is 73.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: replacing deprecated HTTP status constants and enabling unbuffered test output to fix CI warnings.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/cleanup-ci-deprecation-warnings

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

@galvana galvana marked this pull request as ready for review March 4, 2026 22:31
@galvana galvana requested a review from a team as a code owner March 4, 2026 22:31
@galvana galvana requested review from adamsachs and removed request for a team March 4, 2026 22:31
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR addresses two CI hygiene concerns:

  1. HTTP 422 constant rename: Replaces the starlette-deprecated HTTP_422_UNPROCESSABLE_ENTITY constant with HTTP_422_UNPROCESSABLE_CONTENT across 27 source and test files. Both constants resolve to the same integer value (422), so this change carries zero runtime risk. The update is applied consistently across all 19 source files and 8 test files, eliminating starlette DeprecationWarning noise in CI.

  2. -s flag (unbuffered output): Adds -s to the global pytest addopts in pyproject.toml to prevent startup log output from being buffered and dumped at the end of test runs. This improves CI log readability by surfacing diagnostics in chronological order with the tests that run.

Confidence Score: 5/5

  • Purely mechanical refactor with zero behavioral risk.
  • The PR contains two independent, low-risk changes: (1) HTTP constant rename—both the old and new constants map to integer 422, and the replacement is applied consistently across all source and test files; (2) pytest -s flag addition—a straightforward CI improvement for log readability that does not interfere with pytest's local capture fixtures. Both changes are well-scoped and safe to merge.
  • No files require special attention.

Last reviewed commit: 065fc78

Copy link
Contributor

@JadeCara JadeCara left a comment

Choose a reason for hiding this comment

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

very clean - 1 note.

@galvana galvana added this pull request to the merge queue Mar 4, 2026
Merged via the queue into main with commit f7b17b5 Mar 4, 2026
57 of 58 checks passed
@galvana galvana deleted the fix/cleanup-ci-deprecation-warnings branch March 4, 2026 23:46
mfbrown pushed a commit that referenced this pull request Mar 12, 2026
Co-authored-by: Adrian Galvan <galvana@uci.edu>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants