Skip to content

Some minor improvments to the delete environment logic & other code clarity improvements - #524

Merged
stephahart merged 4 commits into
mainfrom
steph/delete-improvements
Nov 5, 2026
Merged

stephahart merged 4 commits into
mainfrom
steph/delete-improvements

Conversation

@stephahart

Copy link
Copy Markdown
Contributor

I found featureflag.IsAdmin to be confusing, so I renamed it to featureflag.UseSystemAdminFeatures. I also found handleAdminUser confusing in the delete method, so I refactored that a big.

I also made use of the existing FindUserWorkspaceByNameOrID so we could get rid of an instance of error string matching.

@stephahart
stephahart requested a review from a team as a code owner November 5, 2026 00:08
Comment thread pkg/auth/auth.go Outdated

// IsCurrentUserSystemAdmin reports whether system-admin CLI behavior is enabled
// for the current credential. API keys and feature.not_admin disable it.
func IsCurrentUserSystemAdmin(store CurrentUserAuthStore) (bool, error) {

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.

is this even a real use case? I was struggling to refactor this a bit, but I'm not sure this use case really exists or should exist and using the Admin UI makes more sense to me than having the CLI do it. Thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

honestly fair

@stephahart
stephahart merged commit b88da7a into main Nov 5, 2026
11 checks passed
@stephahart
stephahart deleted the steph/delete-improvements branch November 5, 2026 18:15
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