Skip to content

feat(gooddata-api-client): add the CREATE_METRIC workspace permission - #1810

Merged
Vojtasii merged 1 commit into
masterfrom
vto/f1-2785-create-metric-permission
Sep 11, 2026
Merged

feat(gooddata-api-client): add the CREATE_METRIC workspace permission#1810
Vojtasii merged 1 commit into
masterfrom
vto/f1-2785-create-metric-permission

Conversation

@Vojtasii

@Vojtasii Vojtasii commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

CREATE_METRIC landed in the backend under F1-2785 — it was added to the permission
hierarchy and POST /api/v1/entities/workspaces/{workspaceId}/metrics now requires it
instead of MANAGE. The specs this client generates from still predate that, so assigning
the level through the SDK fails client-side validation.

  • schemas/gooddata-metadata-client.json — adds CREATE_METRIC (after CREATE_FILTER_VIEW,
    matching the backend ordering) to all seven workspace-permission enums:
    DeclarativeSingleWorkspacePermission, DeclarativeWorkspaceHierarchyPermission,
    workspace meta.permissions, and the permissions / hierarchyPermissions arrays of
    UserManagementWorkspacePermissionAssignment and WorkspacePermissionAssignment. Also
    syncs the metrics POST x-gdc-security-info to CREATE_METRIC.
  • schemas/gooddata-api-client.json plus five generated model files — the result of
    make api-client-local.

The spec edit is targeted rather than a make api-client STAGING=1 re-download, which would
bury this change under every unrelated upstream drift accumulated since the last sync. The
merge step was verified deterministic first: re-merging the committed per-API specs
reproduced gooddata-api-client.json byte-for-byte, so the only spec delta is this one.

Test Plan

  • make api-client-local — regenerated cleanly; diff is 25 added lines, all additive enum
    entries, no model shape change, so nothing in packages/ needs adapting.
  • The five regenerated modules compile (python -m py_compile).
  • make test was not run: uv here is a pyenv shim and the repo's .python-version pins
    3.14.0, which is not installed locally. CI is the gate for that.
  • The generated client is excluded from lint / format / type-check per AGENTS.md.

JIRA

https://gooddata.atlassian.net/browse/F1-2785

Risk

low — additive enum values only. Existing values keep their meaning, and the backend already
accepts CREATE_METRIC; this only stops the client from rejecting it before the request is
sent.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added the CREATE_METRIC permission for workspace and hierarchy permission assignments.
    • Metric creation now has a dedicated permission requirement, allowing access to be granted independently from broader management permissions.
    • Updated API schemas and metadata to recognize and document the new permission across supported workspace permission models.

F1-2785 added CREATE_METRIC to the backend permission hierarchy and
switched POST /entities/workspaces/{id}/metrics over to it, but the
specs this client generates from still predate that, so assigning the
level through the SDK failed client-side validation.

Adds the value to the seven workspace-permission enums in the metadata
spec and updates the metrics POST security info, then regenerates. The
merged spec was verified to be reproducible from the per-API specs
first, so the only delta is this one, rather than the unrelated drift a
full staging re-download would pull in.

jira: F1-2785
risk: low
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: f900a449-b85c-46b4-aee3-ce2a6240f3be

📥 Commits

Reviewing files that changed from the base of the PR and between c1d2bcb and 1c1ae20.

📒 Files selected for processing (7)
  • gooddata-api-client/gooddata_api_client/model/declarative_single_workspace_permission.py
  • gooddata-api-client/gooddata_api_client/model/declarative_workspace_hierarchy_permission.py
  • gooddata-api-client/gooddata_api_client/model/json_api_workspace_out_meta.py
  • gooddata-api-client/gooddata_api_client/model/user_management_workspace_permission_assignment.py
  • gooddata-api-client/gooddata_api_client/model/workspace_permission_assignment.py
  • schemas/gooddata-api-client.json
  • schemas/gooddata-metadata-client.json

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The change adds CREATE_METRIC to workspace permission models and schema enums. Metric-controller security metadata now requires CREATE_METRIC instead of MANAGE.

Changes

CREATE_METRIC permission support

Layer / File(s) Summary
Permission model values
gooddata-api-client/gooddata_api_client/model/*permission*.py
Permission models now allow CREATE_METRIC in workspace permission fields.
Schema permission metadata
schemas/gooddata-api-client.json, schemas/gooddata-metadata-client.json
Permission enums include CREATE_METRIC. Metric-controller metadata requires CREATE_METRIC for metric creation.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 1c1ae

This additive change consistently enables CREATE_METRIC validation and metric creation authorization metadata across the SDK schemas and generated models.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the CREATE_METRIC workspace permission to the GoodData API client.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

A rabbit adds a metric key,
To permission lists sleek and neat.
The schemas now declare the right,
Creation access clear and bright,
While MANAGE rests beneath the seat.

Comment @coderabbitai help to get the list of available commands.

@Vojtasii
Vojtasii enabled auto-merge September 11, 2026 12:28
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.30%. Comparing base (c1d2bcb) to head (1c1ae20).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1810   +/-   ##
=======================================
  Coverage   82.30%   82.30%           
=======================================
  Files         283      283           
  Lines       20421    20421           
=======================================
  Hits        16807    16807           
  Misses       3614     3614           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Vojtasii
Vojtasii merged commit 8bfa6ff into master Sep 11, 2026
14 checks passed
@Vojtasii
Vojtasii deleted the vto/f1-2785-create-metric-permission branch September 11, 2026 12:33
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