feat(gooddata-api-client): add the CREATE_METRIC workspace permission - #1810
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (7)
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. 📝 WalkthroughWalkthroughThe change adds ChangesCREATE_METRIC permission support
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Feature Merge Risk: ⚪ Minimal · up to 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)
✨ Finishing Touches📝 Generate docstrings
A rabbit adds a metric key, Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Summary
CREATE_METRIClanded in the backend under F1-2785 — it was added to the permissionhierarchy and
POST /api/v1/entities/workspaces/{workspaceId}/metricsnow requires itinstead of
MANAGE. The specs this client generates from still predate that, so assigningthe level through the SDK fails client-side validation.
schemas/gooddata-metadata-client.json— addsCREATE_METRIC(afterCREATE_FILTER_VIEW,matching the backend ordering) to all seven workspace-permission enums:
DeclarativeSingleWorkspacePermission,DeclarativeWorkspaceHierarchyPermission,workspace
meta.permissions, and thepermissions/hierarchyPermissionsarrays ofUserManagementWorkspacePermissionAssignmentandWorkspacePermissionAssignment. Alsosyncs the metrics
POSTx-gdc-security-infotoCREATE_METRIC.schemas/gooddata-api-client.jsonplus five generated model files — the result ofmake api-client-local.The spec edit is targeted rather than a
make api-client STAGING=1re-download, which wouldbury 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.jsonbyte-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 enumentries, no model shape change, so nothing in
packages/needs adapting.python -m py_compile).make testwas not run:uvhere is a pyenv shim and the repo's.python-versionpins3.14.0, which is not installed locally. CI is the gate for that.
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 issent.
🤖 Generated with Claude Code
Summary by CodeRabbit
CREATE_METRICpermission for workspace and hierarchy permission assignments.