Skip to content

Add profile id migration#781

Open
theodorsm wants to merge 4 commits into
mainfrom
profile-id
Open

Add profile id migration#781
theodorsm wants to merge 4 commits into
mainfrom
profile-id

Conversation

@theodorsm

@theodorsm theodorsm commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR updates the docs with the new profile ids and names.

Summary by CodeRabbit

  • Documentation
    • Clarified profile identity: display names may repeat; profiles are tracked by generated unique IDs plus a reserved default ID.
    • GUI quickstart updated with “Names and IDs” guidance and short-ID selection behavior; ACTIVE marker examples refreshed.
    • CLI docs expanded: profile commands now clearly describe selectors (ID, unique-ID prefix, or unique name handle) and improved not-found vs ambiguous error examples.
    • profile add/rename/remove behavior documented in detail, including short-ID output, rename scope (display name only), and blocking removal of active/default while removing related config/state for inactive profiles.
    • --profile flag documented to resolve using the same handle rules and prompt for authentication when needed.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b3242f3a-ae63-401a-a5d4-fc10ad9ed173

📥 Commits

Reviewing files that changed from the base of the PR and between 00ce719 and 9c20fb8.

📒 Files selected for processing (1)
  • src/pages/client/profiles.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pages/client/profiles.mdx

📝 Walkthrough

Walkthrough

Documentation clarifies NetBird's multi-profile model (non-unique display names with generated IDs stored as <id>.json) and expands CLI netbird profile docs to define handle resolution (ID, ID prefix, or name), ACTIVE markers, --show-id, auth prompts, and remove/rename behaviors.

Changes

Profile Documentation

Layer / File(s) Summary
Profile naming and storage fundamentals
src/pages/client/profiles.mdx
Display names need not be unique; each profile has a generated unique ID (mapped to <id>.json); default uses reserved default ID; --profile flag resolves handles using the same rules as profile select.
CLI profile command syntax and handle rules
src/pages/client/profiles.mdx
`netbird profile <add
Add and rename behavior details
src/pages/client/profiles.mdx
profile add shows short generated ID on success, creates <id>.json in background, leaves client disconnected until netbird up/netbird login, and warns on duplicate names with list --show-id for disambiguation. profile rename only updates display name; ID, config, and login state remain unchanged; rename follows same handle/ambiguity rules.
List, select, and remove semantics
src/pages/client/profiles.mdx
profile list shows ACTIVE marker; --show-id adds an ID column. select/remove document "not found" vs "ambiguous" errors, require auth for unused profiles, and remove rejects active/default removal and deletes both <id>.json and <id>.state.json for resolved inactive profiles.
CLI quick reference updates
src/pages/get-started/cli.mdx
Quickref bullets reworded: list notes --show-id; selectors for add/rename/remove/select clarified to accept name, ID, or unique-ID prefix.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit writes in hop and rhyme,
Each profile holds its secret sign,
Names may match but IDs know,
Short handles help the CLI flow,
Hooray—profiles tidy, neat, and fine! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Add profile id migration' does not accurately reflect the actual changes, which are documentation updates clarifying profile identity semantics, not a profile ID migration implementation. Consider retitling to something like 'Document profile identity semantics and ID handling' to better reflect that this is a documentation clarification rather than a code migration.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-id

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/pages/client/profiles.mdx

Oops! Something went wrong! :(

ESLint: 9.39.4

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from:
at JSON.stringify ()
at file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:308:45
at Array.map ()
at ConfigValidator.formatErrors (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:299:23)
at ConfigValidator.validateConfigSchema (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:330:84)
at ConfigArrayFactory._normalizeConfigData (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:676:19)
at ConfigArrayFactory._loadConfigData (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:641:21)
at ConfigArrayFactory._loadExtendedShareableConfig (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:946:21)
at ConfigArrayFactory._loadExtends (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:814:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (file:///node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/lib/config-array-factory.js:752:25)


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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/client/profiles.mdx`:
- Around line 132-134: Update the top-level CLI usage placeholder string
"netbird profile <add|list|select|remove> [name|id]" to reflect that
select/remove also accept ID-prefix handles: change the bracketed operand to
include handle (e.g., "[name|id|handle]" or similar) so the documented usage for
the command symbol netbird profile and actions select/remove explicitly permits
handles while preserving name/id semantics for add/list.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cd7ac6d9-1092-440a-9057-609d22c26a78

📥 Commits

Reviewing files that changed from the base of the PR and between a8c86c4 and f503847.

📒 Files selected for processing (2)
  • src/pages/client/profiles.mdx
  • src/pages/get-started/cli.mdx

Comment thread src/pages/client/profiles.mdx

@riccardomanfrin riccardomanfrin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Doc is great, I would add a note or clarify clearly about precedence and corner case (e.g. "AB" profile name / handles)

it, the rename still succeeds and a warning is printed (same as `add`).
* The **default profile can be renamed**. Its label changes everywhere it's shown, but it keeps
its reserved `default` ID and still cannot be removed.
* If the handle is ambiguous or matches no profile, you'll get the same errors as `select` and

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe describe what is "handle"

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