Skip to content

[client] Profile ownership migration - #7508

Merged
theodorsm merged 18 commits into
profile-ownershipfrom
profile-ownership-migration
Sep 17, 2026
Merged

theodorsm merged 18 commits into
profile-ownershipfrom
profile-ownership-migration

Conversation

@theodorsm

@theodorsm theodorsm commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

This PR adds a migration path for profile ownership where profiles are stamped by a caller that matches the username directory.

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • I ran and tested this change locally — I did not rely on CI to find out whether it works
  • This PR has a single purpose (not a fix + refactor + feature in one)
  • This change is a trivial fix, OR it links an issue the NetBird team agreed on beforehand. Changes to the public API, gRPC protocols, functionality behavior, CLI / service flags, or new features always need that agreement first. See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Review in cubic

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a91fedf3-85d9-4a9e-aab8-831f4766f757

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.

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

Release artifacts

Built for PR head 4605d0f in workflow run #19059.

Artifact Link
All release artifacts Download
Linux packages Download
Windows packages Download
macOS packages Download
UI artifacts Download
UI GTK3 artifacts Download
UI macOS artifacts Download

GHCR images (amd64)

This comment is updated by the Release workflow. Artifact links expire according to the workflow retention policy.

@theodorsm
theodorsm added this pull request to stack #7530 September 14, 2026 09:16
@theodorsm
theodorsm marked this pull request as ready for review September 14, 2026 09:32

@cubic-dev-ai cubic-dev-ai Bot 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.

2 issues found across 17 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="client/mobile/profile_manager.go">

<violation number="1" location="client/mobile/profile_manager.go:109">
P1: After upgrading a mobile installation, existing non-default profiles become inaccessible because this identity-scoped listing never stamps legacy profiles with the app identity. Migrate or stamp the existing files before applying `AccessibleBy`, otherwise users lose every previously created mobile profile.</violation>

<violation number="2" location="client/mobile/profile_manager.go:170">
P2: When `CurrentProcessIdentity` fails, `AddProfile` still passes a non-nil zero identity and persists `uid:0` as the profile owner. The newly created profile is then inaccessible to the failed-identity manager and may be incorrectly associated with root; pass `nil` unless `pm.identity.Known()` is true.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread client/internal/profilemanager/profilemanager.go
Comment thread client/internal/profilemanager/migration.go Outdated
Comment thread client/internal/profilemanager/migration.go
Comment thread client/internal/profilemanager/service.go Outdated
Comment thread client/server/server.go Outdated
Comment thread client/server/server.go
Comment thread client/internal/profilemanager/migration_test.go
Comment thread client/internal/profilemanager/migration_test.go
Comment thread client/internal/profilemanager/service.go Outdated
Comment thread client/server/setconfig_mdm_test.go

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread client/server/server.go Outdated
Comment thread client/server/server.go

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread client/server/server.go

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread client/internal/profilemanager/service.go Outdated
@theodorsm
theodorsm force-pushed the profile-ownership-migration branch 2 times, most recently from c162eb6 to ce703d8 Compare September 15, 2026 14:16

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 6 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread client/server/server.go
Comment thread client/internal/profilemanager/migration.go
@theodorsm
theodorsm force-pushed the profile-ownership-migration branch from 49f21a9 to 2052931 Compare September 16, 2026 08:51

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread client/internal/profilemanager/migration.go
Comment thread client/internal/profilemanager/service.go
theodorsm and others added 2 commits September 16, 2026 16:00
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@theodorsm
theodorsm force-pushed the profile-ownership-migration branch from 88ece9e to 4605d0f Compare September 16, 2026 14:00
@sonarqubecloud

Copy link
Copy Markdown

@theodorsm
theodorsm merged commit 52b16e7 into profile-ownership Sep 17, 2026
42 of 44 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.

2 participants