Add settings team-roles command#10
Merged
Merged
Conversation
Adds 'entropy-data organization team-roles-mode get|set' to read and switch whether the organization derives team permissions from the built-in default roles or its custom team role catalog. Consumes the new GET/PUT /api/organization/team-roles-mode endpoint. 'set' takes a DEFAULT|CUSTOM argument; switching to CUSTOM with an empty catalog surfaces the API's 409. Refs DMM-446.
Follow the app's aggregate /api/settings/team-roles design:
- entropy-data settings team-roles get
- entropy-data settings team-roles put --file <json|yaml>
Removes the now-superseded 'organization custom-team-roles' group and the
interim 'organization team-roles-mode' command. 'put' sends the aggregate
payload ({mode} or {mode, team-roles:[...]}); the API enforces the empty-catalog
and in-use-role 409 guards, surfaced via the standard error path.
Refs DMM-446.
Update README command tree + examples and add a CHANGELOG entry for the team-roles CLI rework. Refs DMM-446.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Companion to app PR datamesh-manager/entropy-data#1444 (DMM-446), updated for the aggregate
/api/settings/team-rolesdesign from review.How it works
team-rolessub-group under the existingsettingsgroup (mirrors the/api/settings/*namespace and theget/put-customizationprecedent).get→GET /api/settings/team-roles; table view shows the mode and, when custom, a role table;-o json|yamlfor the raw payload.put --filereads a JSON or YAML aggregate body ({mode}or{mode, team-roles:[...]},-for stdin) andPUTs it as JSON. The API's empty-catalog and in-use-role 409s surface via the standard error path.Removed
organization custom-team-rolesgroup and the interimorganization team-roles-modecommand (the underlying app endpoints are removed in #1444).Testing
tests/commands/test_team_roles.py(7 cases): default/custom GET (table + json), PUT from JSON and YAML (asserting the request body), 409 surfacing,--helpsmoke test. Full suite green (240 passed);ruff checkclean.Notes / out of scope
custom-team-rolessubcommand; I can update the docs in a separate, focused change once the WIP lands.