Skip to content

refactor(gooddata-api-client): split LDM object permissions per family - #1791

Merged
jeskepetr merged 1 commit into
masterfrom
PJE/F1-2851
Sep 9, 2026
Merged

jeskepetr merged 1 commit into
masterfrom
PJE/F1-2851

Conversation

@jeskepetr

@jeskepetr jeskepetr commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

metadata-api splits its shared LDM object permission DTOs into one family per grantable resource type (gdc-nas #26771). The four LdmObjectPermissions* schemas become twelve Attribute/Label/Fact ones, so the attribute, label and fact permission endpoints no longer share request and response models.

⚠️ Do not merge before gdc-nas #26771 — the schema here describes an API no backend serves yet.

What is hand-written and what is generated

One file was edited by hand: schemas/gooddata-metadata-client.json (+204 / −18). Three edits — delete the four LdmObjectPermissions* schemas, insert the twelve new ones verbatim from metadata-api's open-api-spec.json, repoint the $refs in the six attribute/label/fact permission operations.

It is patched rather than downloaded because no backend serves the new shape yet, and a full make download would also sweep in unrelated drift — the checked-in copy predates the computedAttributes permission endpoints, among others.

Everything else (56 paths: schemas/gooddata-api-client.json, gooddata-api-client/**) is make api-client-local output with no manual editing. Regenerating should reproduce it byte for byte provided jq is 1.7+ — jq 1.6 does not preserve number literals and rewrites unrelated values across the merged schema.

Breaking changes for client users

Removed models: LdmObjectPermissions, LdmObjectPermissionsAssignment, LdmObjectPermissionsForAssignee, LdmObjectPermissionsForAssigneeAllOf, LdmObjectPermissionsForAssigneeRule.

Added: 16 model classes across Attribute* / Label* / Fact*, including ManageLabelPermissionsRequestInner and ManageFactPermissionsRequestInner — previously all three endpoints shared one inner model, so ManageAttributePermissionsRequestInner's composition changes too.

One collateral rename: DeclarativeAnalyticalDashboardPermissionForAssigneeRuleAllOf is gone, even though this PR does not touch dashboards. The generator materialises each inline allOf member as a class, reuses one class across parents whose member is identical, and names it after the first such parent in the alphabetically sorted schema map. AttributePermissionsForAssigneeRule now sorts ahead of the dashboard schema, so the shared class is AttributePermissionsForAssigneeRuleAllOf. The class body is identical apart from the name, and the dashboard model still composes it. The same mechanism already applied before this PR, with PermissionsForAssignee composing LdmObjectPermissionsForAssigneeAllOf.

Test Plan

  • make api-client-local completes clean; the resulting diff is confined to the permission schemas, their models and docs.
  • The six operations still exist on ActionsApi and PermissionsApi, now typed AttributePermissions / LabelPermissions / FactPermissions.
  • import gooddata_api_client.models loads all 1340 classes.
  • No hand-written code is affected: nothing under packages/ referenced the removed names, and ruff excludes gooddata-api-client.

JIRA

F1-2851, epic GDP-3402.

Risk

low — generated-client rename following a backend rename. No behaviour change; the break is limited to imports of the removed class names.

Summary by CodeRabbit

  • New Features

    • Added resource-specific permission support for attributes, facts, and labels.
    • Added dedicated models for fact and label permissions, assignments, assignees, and management requests.
    • Fact and label permission management now accepts resource-specific request formats.
  • Documentation

    • Updated API references and examples to reflect the new permission models.
  • Refactor

    • Renamed attribute permission models for clearer resource alignment.
    • Replaced obsolete generic LDM-object and dashboard permission references.

@coderabbitai

coderabbitai Bot commented Sep 9, 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: 5f1717bb-d8e4-48a0-9908-30829028941c

📥 Commits

Reviewing files that changed from the base of the PR and between bf5c1b6 and 55e22cd.

📒 Files selected for processing (47)
  • gooddata-api-client/.openapi-generator/FILES
  • gooddata-api-client/README.md
  • gooddata-api-client/docs/ActionsApi.md
  • gooddata-api-client/docs/AttributePermissions.md
  • gooddata-api-client/docs/AttributePermissionsAssignment.md
  • gooddata-api-client/docs/AttributePermissionsForAssignee.md
  • gooddata-api-client/docs/AttributePermissionsForAssigneeAllOf.md
  • gooddata-api-client/docs/AttributePermissionsForAssigneeRule.md
  • gooddata-api-client/docs/AttributePermissionsForAssigneeRuleAllOf.md
  • gooddata-api-client/docs/FactPermissions.md
  • gooddata-api-client/docs/FactPermissionsAssignment.md
  • gooddata-api-client/docs/FactPermissionsForAssignee.md
  • gooddata-api-client/docs/FactPermissionsForAssigneeRule.md
  • gooddata-api-client/docs/LabelPermissions.md
  • gooddata-api-client/docs/LabelPermissionsAssignment.md
  • gooddata-api-client/docs/LabelPermissionsForAssignee.md
  • gooddata-api-client/docs/LabelPermissionsForAssigneeRule.md
  • gooddata-api-client/docs/ManageFactPermissionsRequestInner.md
  • gooddata-api-client/docs/ManageLabelPermissionsRequestInner.md
  • gooddata-api-client/docs/PermissionsApi.md
  • gooddata-api-client/gooddata_api_client/api/actions_api.py
  • gooddata-api-client/gooddata_api_client/api/permissions_api.py
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions.py
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions_assignment.py
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions_for_assignee.py
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions_for_assignee_all_of.py
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions_for_assignee_rule.py
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions_for_assignee_rule_all_of.py
  • gooddata-api-client/gooddata_api_client/model/declarative_analytical_dashboard_permission_for_assignee_rule.py
  • gooddata-api-client/gooddata_api_client/model/fact_permissions.py
  • gooddata-api-client/gooddata_api_client/model/fact_permissions_assignment.py
  • gooddata-api-client/gooddata_api_client/model/fact_permissions_for_assignee.py
  • gooddata-api-client/gooddata_api_client/model/fact_permissions_for_assignee_rule.py
  • gooddata-api-client/gooddata_api_client/model/label_permissions.py
  • gooddata-api-client/gooddata_api_client/model/label_permissions_assignment.py
  • gooddata-api-client/gooddata_api_client/model/label_permissions_for_assignee.py
  • gooddata-api-client/gooddata_api_client/model/label_permissions_for_assignee_rule.py
  • gooddata-api-client/gooddata_api_client/model/manage_attribute_permissions_request_inner.py
  • gooddata-api-client/gooddata_api_client/model/manage_fact_permissions_request_inner.py
  • gooddata-api-client/gooddata_api_client/model/manage_label_permissions_request_inner.py
  • gooddata-api-client/gooddata_api_client/model/metric_permissions_for_assignee.py
  • gooddata-api-client/gooddata_api_client/model/metric_permissions_for_assignee_rule.py
  • gooddata-api-client/gooddata_api_client/model/permissions_for_assignee.py
  • gooddata-api-client/gooddata_api_client/model/permissions_for_assignee_rule.py
  • gooddata-api-client/gooddata_api_client/models/__init__.py
  • schemas/gooddata-api-client.json
  • schemas/gooddata-metadata-client.json
🚧 Files skipped from review as they are similar to previous changes (13)
  • gooddata-api-client/docs/AttributePermissionsForAssigneeRule.md
  • gooddata-api-client/docs/AttributePermissionsForAssigneeAllOf.md
  • gooddata-api-client/docs/AttributePermissionsForAssignee.md
  • gooddata-api-client/docs/AttributePermissionsAssignment.md
  • gooddata-api-client/docs/AttributePermissionsForAssigneeRuleAllOf.md
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions.py
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions_for_assignee_rule_all_of.py
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions_assignment.py
  • gooddata-api-client/README.md
  • gooddata-api-client/gooddata_api_client/models/init.py
  • gooddata-api-client/docs/AttributePermissions.md
  • gooddata-api-client/gooddata_api_client/model/attribute_permissions_for_assignee_all_of.py
  • gooddata-api-client/.openapi-generator/FILES

Included review availability: 2 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 OpenAPI schemas and generated Python client now use separate attribute, fact, and label permission models. Fact and label management endpoints accept dedicated request models. Obsolete generic LDM object permission references and dashboard permission variants were removed.

Changes

Permission model contracts

Layer / File(s) Summary
Resource-specific schemas
schemas/*.json
Added attribute, fact, and label permission schemas. Updated endpoint references and assignment variants.
Generated permission models
gooddata-api-client/gooddata_api_client/model/*.py
Added fact and label models. Renamed attribute models. Updated composed schemas and request models.
API integration
gooddata-api-client/gooddata_api_client/api/*.py
Updated response types and fact/label request parameters in the Actions and Permissions APIs.
Exports and documentation
gooddata-api-client/gooddata_api_client/models/__init__.py, gooddata-api-client/docs/*, gooddata-api-client/README.md, gooddata-api-client/.openapi-generator/FILES
Updated package exports, generated-file manifests, model indexes, API documentation, and model pages.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 55e22

The resource-specific permission contracts are consistently propagated through the generated client, with no actionable merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 56.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 102 functions across 24 files. (23 skippe… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: splitting LDM object permissions by resource family in the GoodData API client.
Full details: Docstring Coverage

Explanation

Docstring coverage is 56.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 102 functions across 24 files. (23 skipped: 22 unsupported, 1 too large.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

A rabbit checks each permission gate
Attribute, fact, and label now state
Requests use their proper name
Typed responses join the game
Old generic paths hop away
Clean schemas guide the day

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

@jeskepetr
jeskepetr marked this pull request as ready for review September 9, 2026 13:48
metadata-api splits its shared LDM object permission DTOs into one family per
grantable resource type (gdc-nas #26771), so the four LdmObjectPermissions*
schemas become twelve Attribute/Label/Fact ones. The attribute, label and fact
endpoints no longer share request and response models.

schemas/gooddata-metadata-client.json is patched rather than downloaded: no
backend serves the new shape yet. The patch deletes the four schemas, inserts the
twelve verbatim from metadata-api's open-api-spec.json, and repoints the refs in
the six operations -- the only places the deleted schemas were referenced.
Everything else is `make api-client-local` output, generated with jq 1.7 so that
number literals are preserved.

One collateral rename: DeclarativeAnalyticalDashboardPermissionForAssigneeRuleAllOf
is gone. The generator materialises each inline allOf member as a class, reuses one
class across parents whose member is identical, and names it after the first such
parent in the alphabetically sorted schema map. AttributePermissionsForAssigneeRule
now sorts ahead of the dashboard schema, so the shared class is
AttributePermissionsForAssigneeRuleAllOf -- same shape, and the dashboard model
still composes it. The dashboard and metric permission models change by that one
import only.

Depends on gdc-nas #26771 and must not merge before it.

JIRA: F1-2851
risk: low
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.86%. Comparing base (bf5c1b6) to head (55e22cd).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1791   +/-   ##
=======================================
  Coverage   81.86%   81.86%           
=======================================
  Files         277      277           
  Lines       20016    20016           
=======================================
  Hits        16387    16387           
  Misses       3629     3629           

☔ 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.

@jeskepetr
jeskepetr merged commit ebca7d9 into master Sep 9, 2026
14 checks passed
@jeskepetr
jeskepetr deleted the PJE/F1-2851 branch September 9, 2026 13:58
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