Skip to content

Remove: machine_accounts feature flag.#5971

Merged
evankanderson merged 3 commits intomindersec:mainfrom
Mujib-Ahasan:release-machineAccounts-flag
Feb 3, 2026
Merged

Remove: machine_accounts feature flag.#5971
evankanderson merged 3 commits intomindersec:mainfrom
Mujib-Ahasan:release-machineAccounts-flag

Conversation

@Mujib-Ahasan
Copy link
Copy Markdown
Contributor

Summary

The default value of machine_accounts flag is false now. But related functionalities sets it to true. This PR is raised for the release of the flag.

Fixes #5435

Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
@Mujib-Ahasan Mujib-Ahasan requested a review from a team as a code owner November 15, 2025 19:09
@evankanderson
Copy link
Copy Markdown
Member

The test failure appears to be valid:

❌ TestAssignRole/grant_permission_to_GitHub_Action (0s)
      handlers_authz_test.go:894: 
          	Error Trace:	/home/runner/work/minder/minder/internal/controlplane/handlers_authz_test.go:894
          	Error:      	Received unexpected error:
          	            	Code: 12
          	            	Name: UNIMPLEMENTED
          	            	Description: Unimplemented
          	            	Details: machine accounts are not enabled
          	Test:       	TestAssignRole/grant_permission_to_GitHub_Action
      controller.go:251: missing call(s) to *mock_roles.MockRoleService.CreateRoleAssignment(is anything, is anything, is anything, is anything, is equal to {repo:mindersec/community:ref:refs/heads/main  githubactions  } (auth.Identity), is equal to admin (authz.Role)) /home/runner/work/minder/minder/internal/controlplane/handlers_authz_test.go:839
      controller.go:251: aborting test due to missing call(s)

Comment thread internal/controlplane/handlers_authz.go Outdated
return nil, util.UserVisibleError(codes.Unimplemented, "human users may only be added by invitation")
}
if isMachine && !flags.Bool(ctx, s.featureFlags, flags.MachineAccounts) {
if isMachine {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ooh, this is tricky, since this is a negative use of the flag -- in this case, I think flags.Bool(ctx, s.featureFlags, flags.MachineAccounts) should effectively always return true, so if isMachine && !true will always evaluate to false, and the entire if false {...} block can be removed.

@github-actions
Copy link
Copy Markdown
Contributor

This PR needs additional information before we can continue. It is now marked as stale because it has been open for 30 days with no activity. Please provide the necessary details to continue or it will be closed in 30 days.

@evankanderson
Copy link
Copy Markdown
Member

I think the test failure here is clear and fairly simple (the wrong flag branch was removed).

@github-actions
Copy link
Copy Markdown
Contributor

This PR needs additional information before we can continue. It is now marked as stale because it has been open for 30 days with no activity. Please provide the necessary details to continue or it will be closed in 30 days.

@github-actions github-actions Bot added the Stale label Jan 20, 2026
@evankanderson
Copy link
Copy Markdown
Member

With the merge of #6052, you may need to merge test changes, but based on the earlier comments, it seems like it should be straightforward to fix.

@github-actions github-actions Bot removed the Stale label Feb 3, 2026
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
@Mujib-Ahasan
Copy link
Copy Markdown
Contributor Author

Hello @evankanderson, I tried to fix the test cases.

evankanderson
evankanderson previously approved these changes Feb 3, 2026
Copy link
Copy Markdown
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

Thanks for doing (and updating) this! I think there's a little more removal that you can do, but the cleanup looks correct.

I suspect that the other PR may also be easier now that #6052 is in, but I wanted to get to this one first, because it looked a bit easier to resolve.

Comment on lines 794 to 800
Provider: &githubactions.GitHubActions{},
},
expectedError: "Description: Unimplemented\nDetails: machine accounts are not enabled",
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can probably remove this entire test case, and remove the flagData from the next test case on line 808.

Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
@Mujib-Ahasan
Copy link
Copy Markdown
Contributor Author

Thank you @evankanderson for suggestions, I have made the changes (suggested by you).

@evankanderson evankanderson merged commit 7a1fa17 into mindersec:main Feb 3, 2026
24 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.

Remove machine_accounts feature flag

2 participants