Skip to content

feat(smithery): add gitlabPermissionMode config option - #820

Merged
zereight merged 2 commits into
mainfrom
feat/smithery-permission-mode
Oct 10, 2026
Merged

zereight merged 2 commits into
mainfrom
feat/smithery-permission-mode

Conversation

@zereight

@zereight zereight commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Why

Follow-up to #814, which left the Smithery config out. GITLAB_READ_ONLY_MODE is deprecated and will be removed in v3.0.0 (#815). Its replacement is GITLAB_PERMISSION_MODE, but Smithery users had no way to set it, so they could only use the deprecated gitlabReadOnlyMode option. This PR adds the replacement.

Changes

smithery.yaml only (+9 lines, nothing removed):

  • New gitlabPermissionMode property in both configSchema and startCommand.configSchema: type: string, enum: [readonly, modify, full] (the values config.ts accepts), no default. If unset, the server default (full) applies.
  • commandFunction passes it as GITLAB_PERMISSION_MODE only when it is set.
  • Existing fields, including gitlabReadOnlyMode, are unchanged. docs: include core in deprecated env replacements and mark deprecated settings #814 edits their descriptions, and this PR stays out of those lines to avoid conflicts.

User impact

Additive. Existing Smithery configs behave the same. Smithery users can now pick readonly, modify or full instead of the deprecated gitlabReadOnlyMode.

Note: gitlabReadOnlyMode still has default: false, so Smithery may always send GITLAB_READ_ONLY_MODE=false. After #816, that shows a deprecation warning on stderr. Permissions are not affected, because only true overrides GITLAB_PERMISSION_MODE. This PR does not change that. It can be handled separately or when the field is removed in v3.0.0.

Tests

  • npm ci, npm run build: pass
  • npm run test:schema: pass (schema 121, toJSONSchema 7, node:test 33)
  • npx tsc --noEmit: pass
  • npm run check:skill-sync: pass
  • No test, script or generated doc in the repo reads smithery.yaml, so nothing was regenerated.
  • Manual check: parsed smithery.yaml with js-yaml and evaluated commandFunction:
    • readonly / modify / full → GITLAB_PERMISSION_MODE set to that value
    • unset or empty → no GITLAB_PERMISSION_MODE in env
    • both schemas: type=string, enum=[readonly, modify, full], no default

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a1d6eace-4bc7-4915-9552-4e2a18d4f0b6

📥 Commits

Reviewing files that changed from the base of the PR and between 08766b9 and 6adab81.


📒 Files selected for processing (1)
  • smithery.yaml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📜 Recent review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: test
  • GitHub Check: code-quality
  • GitHub Check: integration-test
  • GitHub Check: schema-tests
  • GitHub Check: docs-build
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (ruby)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (python)

🔇 Additional comments (1)
smithery.yaml (1)

18-21: LGTM!

Also applies to: 47-50, 66-66



📝 Summary

Summary by CodeRabbit

  • New Features
    • Added a GitLab permission mode setting with readonly, modify, and full options. The setting defaults to full and is passed to the command environment when configured.
  • Deprecations
    • Marked the existing GitLab read-only setting as deprecated. Its environment variable mapping remains available.

Walkthrough

The Smithery schemas add gitlabPermissionMode with readonly, modify, and full values. They mark the read-only setting as deprecated. When the new option is truthy, the command environment sets GITLAB_PERMISSION_MODE.

Changes

GitLab permission mode configuration

Layer / File(s) Summary
Declare and pass permission mode
smithery.yaml
The top-level and start-command schemas add gitlabPermissionMode with three allowed values. Their descriptions document full as the default and mark the read-only setting as deprecated. The command environment sets GITLAB_PERMISSION_MODE when the new option is truthy.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature


Merge Risk: ⚪ Minimal · up to 6adab

The new option reaches the application as configured, while the existing explicit read-only setting retains its tested behavior. No material merge-blocking risk remains; the change is ready for normal checks.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: adding the gitlabPermissionMode Smithery configuration option.
Description check Passed The description directly explains the new configuration option, supported values, environment mapping, compatibility impact, and reported validation results.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

✨ Simplify code
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 10, 2026

@zereight zereight left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict

APPROVE. No serious issues.

gitlabPermissionMode is on both schemas and in commandFunction:

...(config.gitlabPermissionMode ? { GITLAB_PERMISSION_MODE: config.gitlabPermissionMode } : {}),

The enum is readonly | modify | full, same as GitLabPermissionMode. Leaving it unset does not set the env var, so the server stays at its default full.

Checked, not a defect: GITLAB_READ_ONLY_MODE=true still wins in config.ts and forces readonly. That is the existing server rule. Setting gitlabPermissionMode does not clear a gitlabReadOnlyMode: true that is still on.

Docs mismatch and tests were skipped for this pass.

…ion-mode

Keep gitlabReadOnlyMode without a default and with the deprecated description, and pass gitlabPermissionMode as GITLAB_PERMISSION_MODE only when it is set.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zereight
zereight merged commit bedf858 into main Oct 10, 2026
12 checks 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.

1 participant