Skip to content

feat(gooddata-sdk): [AUTO] Add certification fields and setCertification endpoint for analytics#1572

Open
yenkins-admin wants to merge 1 commit intomasterfrom
auto/openapi-sync-C009-20260420-r82171
Open

feat(gooddata-sdk): [AUTO] Add certification fields and setCertification endpoint for analytics#1572
yenkins-admin wants to merge 1 commit intomasterfrom
auto/openapi-sync-C009-20260420-r82171

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added certification fields to CatalogMetric, created CatalogSetCertificationRequest model, and added set_metric_certification() service method to CatalogWorkspaceContentService. CatalogSetCertificationRequest is exported from gooddata_sdk.

Impact: new_feature | Services: gooddata-metadata-client

Files changed

  • packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/content_objects/metric.py
  • packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/certification.py
  • packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/content_service.py
  • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • packages/gooddata-sdk/tests/catalog/test_catalog_workspace_content.py

Agent decisions

Decisions (4)

use existing generic setCertification endpoint — Use ActionsApi.set_certification (workspace-level endpoint) with type='metric'

  • Alternatives: Implement the new metric-specific /metrics/{objectId}/setCertification path via _do_post_request
  • Why: The metric-specific endpoint from the diff is NOT present in the generated API client; the existing workspace-level endpoint already accepts type='metric' and achieves the same result. Using the generated client avoids raw HTTP plumbing.

certification field type in CatalogMetric — str | None (not bool)

  • Alternatives: bool | None (matching the diff's 'type: boolean')
  • Why: The generated JsonApiMetricOutAttributes model defines certification as str with allowed_values={'CERTIFIED': 'CERTIFIED'}, not as boolean. The diff is a rough approximation; the generated code is authoritative.

where to place CatalogSetCertificationRequest — New file catalog/workspace/entity_model/certification.py

  • Alternatives: Inline in content_objects/metric.py, In catalog/workspace/action_model/
  • Why: Certification applies to multiple entity types (metric, visualizationObject, analyticalDashboard), so a separate file avoids coupling it to the metric module.

status=None handling in as_api_model — Always forward status (including None) to the API model

  • Alternatives: Omit status from kwargs when None
  • Why: The API's SetCertificationRequest allowed_values includes None as a valid status to clear certification; callers must be able to pass None explicitly.
Assumptions to verify (3)
  • The certified_at field in json_api_attributes arrives as an ISO-8601 string (not a datetime object) since _check_return_type=False is used; exposed as str | None.
  • The certified_by relationship is delivered via include=certifiedBy side-load mechanism, not as a direct attribute; omitted from CatalogMetric properties.
  • ActionsApi.set_certification with type='metric' is functionally equivalent to the new /metrics/{objectId}/setCertification endpoint for the metric certification use-case.
Layers touched (3)
  • entity_model — Added certification/certification_message/certified_at read-only properties to CatalogMetric; new CatalogSetCertificationRequest action-request model
    • packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/content_objects/metric.py
    • packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/certification.py
  • public_api — Exported CatalogSetCertificationRequest; added set_metric_certification() to CatalogWorkspaceContentService
    • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
    • packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/content_service.py
  • tests — Four new unit tests covering model serialisation and service method forwarding
    • packages/gooddata-sdk/tests/catalog/test_catalog_workspace_content.py

Source commits (gdc-nas)

  • a6f9082 Merge pull request #20581 from hkad98/jkd/certification
  • 0c3c662 Merge pull request #20578 from hkad98/jkd/certification
OpenAPI diff
+      "SetCertificationRequest": {
+        "properties": {
+          "certificationMessage": { "type": "string" }
+        }
+      },
       "JsonApiMetricAttributes": {
         "properties": {
+          "certification": { "type": "boolean" },
+          "certificationMessage": { "type": "string" },
+          "certifiedAt": { "format": "date-time", "type": "string" },
+          "certifiedBy": { "type": "string" },
           "content": { ... }
         }
       },
+    paths:
+      "/api/v1/actions/workspaces/{workspaceId}/metrics/{objectId}/setCertification": { "post": {...} }

Workflow run


Generated by SDK OpenAPI Sync workflow

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 88.57143% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.68%. Comparing base (c00ca3b) to head (098c389).
⚠️ Report is 170 commits behind head on master.

Files with missing lines Patch % Lines
...g/workspace/entity_model/content_objects/metric.py 66.66% 3 Missing ⚠️
...dk/catalog/workspace/entity_model/certification.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1572       +/-   ##
===========================================
+ Coverage    0.00%   78.68%   +78.68%     
===========================================
  Files         158      231       +73     
  Lines       11048    15440     +4392     
===========================================
+ Hits            0    12149    +12149     
+ Misses      11048     3291     -7757     

☔ View full report in Codecov by Sentry.
📢 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.

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