Skip to content

chore: upgrade dependencies and replace black with ruff formatter#92

Merged
Prashant-Surya merged 2 commits intomainfrom
fix-package-upgrades
Mar 24, 2026
Merged

chore: upgrade dependencies and replace black with ruff formatter#92
Prashant-Surya merged 2 commits intomainfrom
fix-package-upgrades

Conversation

@sriramveeraghanta
Copy link
Copy Markdown
Member

@sriramveeraghanta sriramveeraghanta commented Mar 23, 2026

Description

  • Upgrade PyJWT to >=2.12.0 (resolves Dependabot alert, locked at 2.12.1)
  • Upgrade authlib to >=1.6.9 (resolves Dependabot alert, locked at 1.6.9)
  • Replace black formatter with ruff format — removes black dev dependency and [tool.black] config
  • Update line length from 100 to 120 characters across ruff config
  • Fix implicit string concatenation in plane_oauth_provider.py
  • Fix E501 line-too-long violations in work_item_properties.py docstrings
  • Reformat codebase with ruff format (120 char line length)

Type of Change

  • Code refactoring

Test Scenarios

  • ruff check plane_mcp/ — all checks pass
  • ruff format --check plane_mcp/ — all files formatted
  • pytest tests/ — 13/13 unit tests pass (2 integration tests require live server)

Summary by CodeRabbit

  • Dependencies

    • Added PyJWT (>=2.12.0) and authlib (>=1.6.9) as runtime dependencies.
  • Development

    • Switched code formatting tool from Black to Ruff and increased configured line length to 120.
    • Repository formatting and lint guidance updated across codebase (whitespace/formatting-only changes).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 23, 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: 8065d250-d1de-4928-9dbc-1af0d2a2cc5b

📥 Commits

Reviewing files that changed from the base of the PR and between d9f0ca3 and 8ce6e9f.

📒 Files selected for processing (1)
  • plane_mcp/auth/plane_oauth_provider.py
✅ Files skipped from review due to trivial changes (1)
  • plane_mcp/auth/plane_oauth_provider.py

📝 Walkthrough

Walkthrough

Repository formatting and tooling switched from Black to Ruff (line-length 100→120), new runtime deps added (PyJWT, authlib), and many client call sites and minor messages were reformatted; no public APIs or functional behavior were changed.

Changes

Cohort / File(s) Summary
Build configuration & docs
CLAUDE.md, pyproject.toml
Replaced Black with Ruff formatter, increased Ruff line-length to 120, removed Black config and dev dep, added Ruff format setting (double quotes); added runtime deps PyJWT>=2.12.0, authlib>=1.6.9.
Core modules
plane_mcp/auth/plane_oauth_provider.py, plane_mcp/client.py, plane_mcp/server.py
Condensed logging, validation messages, and environment-variable assignment formatting into single-line expressions; no API or control-flow changes.
Tools — call-site formatting
plane_mcp/tools/... (e.g. cycles.py, epics.py, initiatives.py, intake.py, labels.py, milestones.py, modules.py, projects.py, states.py, work_item_types.py, work_items.py, workspaces.py), plane_mcp/tools/__init__.py
Refactored many multi-line client.*(...) invocations into single-line calls and removed trailing/extra whitespace/newline issues; behavior and signatures unchanged.
Tools — docs & messages
plane_mcp/tools/work_item_properties.py, plane_mcp/tools/work_item_relations.py
Reformatted docstring type-hints and adjusted an error-message f-string layout; no functional changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰✨ From Black to Ruff I hop with glee,
Lines stretched wider, tidy as can be,
Calls once spread now snug and neat,
New deps tucked in, the patch is sweet —
A tiny hop for cleaner tree.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: upgrading dependencies (PyJWT and authlib) and replacing the Black formatter with Ruff, which aligns with the primary objectives outlined in the PR description.
Docstring Coverage ✅ Passed Docstring coverage is 98.63% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-package-upgrades

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (1)
plane_mcp/tools/work_item_relations.py (1)

71-71: Optional: use a single f-string for readability.

This works, but one f-string is cleaner than adjacent literals.

♻️ Suggested cleanup
-                f"Invalid relation_type '{relation_type}'. " f"Must be one of: {get_args(WorkItemRelationTypeEnum)}"
+                f"Invalid relation_type '{relation_type}'. Must be one of: {get_args(WorkItemRelationTypeEnum)}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plane_mcp/tools/work_item_relations.py` at line 71, The two adjacent
f-strings used in the error message should be combined into a single f-string
for readability; update the code that constructs the invalid relation_type error
message (the expression using relation_type and
get_args(WorkItemRelationTypeEnum)) to use one f-string that includes both the
descriptive text and the interpolated values.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plane_mcp/auth/plane_oauth_provider.py`:
- Line 128: The log at verify_token (in plane_oauth_provider.py) prints part of
the bearer token; remove any logging of token content and replace it with a
non-sensitive indicator (e.g., log that verify_token was called and whether a
token was provided or its masked length like "token_provided=True" or
"token_present" without emitting characters). Update the logger.info line in the
verify_token function (and any similar statements) to avoid printing token[:20]
and instead use a safe placeholder or boolean so no token fragments appear in
logs.

In `@plane_mcp/client.py`:
- Line 40: The base_url assignment in variable base_url using
os.getenv("PLANE_INTERNAL_BASE_URL") or os.getenv("PLANE_BASE_URL",
"https://api.plane.so") exceeds the 100-char line length; reformat it to satisfy
Black/100-char rules by wrapping the expression in parentheses and breaking
across lines (preserving the preference for PLANE_INTERNAL_BASE_URL and the
fallback to PLANE_BASE_URL with the default "https://api.plane.so") so the logic
in client.py remains identical but fits the line-length policy.

In `@plane_mcp/tools/cycles.py`:
- Line 105: The single-line condensed client call "return
client.cycles.retrieve(workspace_slug=workspace_slug, project_id=project_id,
cycle_id=cycle_id)" violates the repo formatting policy; reformat this and the
other condensed client calls to a multi-line call so each argument is on its own
line (e.g., break the arguments workspace_slug, project_id, cycle_id onto
separate lines), and run Black/ruff with max-line-length=100 to ensure
compliance; locate occurrences by searching for client.cycles.retrieve and
similar one-line client calls in this file and apply the same multiline style.

In `@plane_mcp/tools/epics.py`:
- Line 146: The single-line call to client.work_items.create exceeds the
100-char limit; update the call to span multiple lines using implicit line
continuation (wrap the arguments in parentheses) so the call to
client.work_items.create(...) is split across lines, placing each argument
(workspace_slug=workspace_slug, project_id=project_id, data=data) on its own
line and keeping the assignment to work_item on a separate line so the statement
complies with the repository's black/100-char formatting.

In `@plane_mcp/tools/initiatives.py`:
- Line 35: The single-line call creating the PaginatedInitiativeResponse exceeds
the 100-char limit; update the statement that assigns response:
PaginatedInitiativeResponse =
client.initiatives.list(workspace_slug=workspace_slug, params=params) (and the
similar call around line 133) to a Black-style wrapped form so each argument is
on its own line (e.g., break after the method name and put workspace_slug=...
and params=... on separate indented lines), preserving the same identifiers
(client.initiatives.list, workspace_slug, params, PaginatedInitiativeResponse)
and ensuring line length stays ≤100 characters.

In `@plane_mcp/tools/intake.py`:
- Line 67: The single-line call to client.intake.create with workspace_slug,
project_id, and intake_data exceeds the 100-char line-length policy; reformat
the invocation by breaking the call across multiple lines so each line stays
under 100 characters (e.g., put the opening paren after client.intake.create and
place workspace_slug=..., project_id=..., data=... on their own indented lines)
and apply the same multiline formatting to the other client.intake.create
occurrence that also exceeds 100 chars.

In `@plane_mcp/tools/milestones.py`:
- Line 72: The single-line call to client.milestones.create(...) is too long;
reformat the invocation to obey the 100‑char line limit by breaking the call
across multiple lines (one argument per line or grouping keyword args) and
aligning continued lines, e.g., split the call to client.milestones.create and
place workspace_slug=..., project_id=..., and data=... each on their own
indented line; apply the same re-wrapping to the second occurrence around line
140 so both calls conform to the file's black/ruff 100-character formatting
rules.

---

Nitpick comments:
In `@plane_mcp/tools/work_item_relations.py`:
- Line 71: The two adjacent f-strings used in the error message should be
combined into a single f-string for readability; update the code that constructs
the invalid relation_type error message (the expression using relation_type and
get_args(WorkItemRelationTypeEnum)) to use one f-string that includes both the
descriptive text and the interpolated values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 137531a0-5cb4-46ff-b130-bc9ceeca0997

📥 Commits

Reviewing files that changed from the base of the PR and between c11d509 and d9f0ca3.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • CLAUDE.md
  • plane_mcp/auth/plane_oauth_provider.py
  • plane_mcp/client.py
  • plane_mcp/server.py
  • plane_mcp/tools/__init__.py
  • plane_mcp/tools/cycles.py
  • plane_mcp/tools/epics.py
  • plane_mcp/tools/initiatives.py
  • plane_mcp/tools/intake.py
  • plane_mcp/tools/labels.py
  • plane_mcp/tools/milestones.py
  • plane_mcp/tools/modules.py
  • plane_mcp/tools/projects.py
  • plane_mcp/tools/states.py
  • plane_mcp/tools/work_item_properties.py
  • plane_mcp/tools/work_item_relations.py
  • plane_mcp/tools/work_item_types.py
  • plane_mcp/tools/work_items.py
  • plane_mcp/tools/workspaces.py
  • pyproject.toml

Comment thread plane_mcp/auth/plane_oauth_provider.py Outdated
Comment thread plane_mcp/client.py
Comment thread plane_mcp/tools/cycles.py
Comment thread plane_mcp/tools/epics.py
Comment thread plane_mcp/tools/initiatives.py
Comment thread plane_mcp/tools/intake.py
Comment thread plane_mcp/tools/milestones.py
Copy link
Copy Markdown
Member

@Saurabhkmr98 Saurabhkmr98 left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@Prashant-Surya Prashant-Surya merged commit 608ff38 into main Mar 24, 2026
1 check passed
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.

3 participants