Skip to content

Add settings team-roles command#10

Merged
andredlng merged 3 commits into
mainfrom
feature/team-roles-mode
Jun 29, 2026
Merged

Add settings team-roles command#10
andredlng merged 3 commits into
mainfrom
feature/team-roles-mode

Conversation

@andredlng

@andredlng andredlng commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What & why

Companion to app PR datamesh-manager/entropy-data#1444 (DMM-446), updated for the aggregate /api/settings/team-roles design from review.

entropy-data settings team-roles get
entropy-data settings team-roles put --file <json|yaml>

How it works

  • New team-roles sub-group under the existing settings group (mirrors the /api/settings/* namespace and the get/put-customization precedent).
  • getGET /api/settings/team-roles; table view shows the mode and, when custom, a role table; -o json|yaml for the raw payload.
  • put --file reads a JSON or YAML aggregate body ({mode} or {mode, team-roles:[...]}, - for stdin) and PUTs it as JSON. The API's empty-catalog and in-use-role 409s surface via the standard error path.

Removed

  • The previously-shipped organization custom-team-roles group and the interim organization team-roles-mode command (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, --help smoke test. Full suite green (240 passed); ruff check clean.

Notes / out of scope

  • Depends on #1444 — merge that first.
  • README/CHANGELOG left untouched: the working tree already carries unrelated in-progress edits to those files. The README still lists the removed custom-team-roles subcommand; I can update the docs in a separate, focused change once the WIP lands.

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.
@andredlng andredlng self-assigned this Jun 25, 2026
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.
@andredlng andredlng changed the title Add organization team-roles-mode command Add settings team-roles command Jun 27, 2026
Update README command tree + examples and add a CHANGELOG entry for the
team-roles CLI rework.

Refs DMM-446.
@andredlng andredlng merged commit 13c1ca3 into main Jun 29, 2026
5 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.

1 participant