Skip to content

Fix CI lint failures by aligning Ruff rules with FastAPI DI and tightening auth error handling - #1

Merged
HMZ-H merged 3 commits into
mainfrom
copilot/fix-lint-job
Sep 14, 2026
Merged

HMZ-H merged 3 commits into
mainfrom
copilot/fix-lint-job

Conversation

Copilot AI commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

The CI lint job failed due to Ruff violations introduced with the auth/migration changes, including import/order/type-style issues and bugbear checks conflicting with FastAPI dependency injection signatures.

  • Lint policy alignment

    • Configure Ruff bugbear to treat FastAPI Depends(...) calls as immutable defaults, preventing false-positive B008 on route dependencies.
    • Updated in backend/pyproject.toml under tool.ruff.lint.flake8-bugbear.
  • Auth router exception correctness

    • Replace broad exception handling in refresh-token decode path with explicit JWT token error handling.
    • This preserves 401 behavior while removing blind except Exception.
  • Codebase-wide Ruff conformance in touched backend paths

    • Apply required import sorting/format updates and modern type annotation forms in flagged files (API, infra, and migration modules) to satisfy the current lint ruleset.
# before
except Exception:
    raise HTTPException(status_code=401, detail="Invalid refresh token")

# after
from jwt import InvalidTokenError

except InvalidTokenError as exc:
    raise HTTPException(status_code=401, detail="Invalid refresh token") from exc

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f58abbf0-a0ca-4f2e-9ccb-0150f5b60a3f

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

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

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

Co-authored-by: HMZ-H <119335393+HMZ-H@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job lint Fix CI lint failures by aligning Ruff rules with FastAPI DI and tightening auth error handling Sep 14, 2026
Copilot AI requested a review from HMZ-H September 14, 2026 22:18

@HMZ-H HMZ-H left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Fix CI lint failures by aligning Ruff rules with FastAPI DI and tightening auth error handling

@HMZ-H

HMZ-H commented Sep 14, 2026

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

@HMZ-H
HMZ-H marked this pull request as ready for review September 14, 2026 22:28
# Conflicts:
#	backend/dwf/api/deps.py

Co-authored-by: HMZ-H <119335393+HMZ-H@users.noreply.github.com>
@HMZ-H
HMZ-H merged commit 56d28e2 into main Sep 14, 2026
1 check passed

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved by merging main into this branch and fixing the conflict in backend/dwf/api/deps.py in commit a708241e.

Copilot stopped work on behalf of HMZ-H due to an error September 14, 2026 22:30
Copilot AI requested a review from HMZ-H September 14, 2026 22:30
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