Repository navigation
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:
|
Brings in the nine commits this branch was behind: the --gate pass@K/pass^K verdict (#1803), the CREATE_METRIC workspace permission (#1810), and the per-run turns/steps counters (#1813). Seven files conflicted, all of them where master's new instrumentation landed in the same loops this branch had already changed. Resolved by keeping both sides in every case -- none of the conflicts were competing implementations: * alert_skill / kda_skill: master counts `turns`/`steps` (turns that came back), this branch counts `turns_used` (turns attempted, set before the call so a turn the chat faulted on is still charged against max_iterations). They differ by design on a CHAT_ERROR exit, so both are kept and the distinction is now stated in a comment. * visualization: same counters on both sides; master's refactor from float to int applied to this branch's version, which also carries the CHAT_ERROR path and the off-by-one comment explaining why the opening request is counted outside the loop. * conversation: additive dataclass field and constructor kwarg on each side. * the three test files: each side added its own tests, none overlapping. Git interleaved them only because both call the evaluator with an identical kwargs block, so the merged files were rebuilt as this branch's version plus master's four new tests rather than spliced by hand. uv run pytest: 1152 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.