Skip to content

feat(gooddata-sdk): [AUTO] add knowledge document list/patch SDK wrapper#1438

Closed
yenkins-admin wants to merge 2 commits intomasterfrom
feature/auto-P010-knowledge-doc-endpoints
Closed

feat(gooddata-sdk): [AUTO] add knowledge document list/patch SDK wrapper#1438
yenkins-admin wants to merge 2 commits intomasterfrom
feature/auto-P010-knowledge-doc-endpoints

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Adds SDK wrapper layer for knowledge document list (with cursor-based pagination) and patch (enable/disable, title, scopes) operations, exposing the newly regenerated API client endpoints through the gooddata-sdk.

P010 | Workflow: https://github.com/gooddata/gdc-nas/actions/runs/23194184862

What changed in gdc-nas

Three commits added new capabilities to the knowledge documents subsystem in afm-exec-api and gen-ai:

  • dd45e5d feat(gen-ai): enable/disable knowledge docs for AI use — New PATCH /documents/{filename} endpoint with PatchKnowledgeDocumentRequestDto (isDisabled, title, scopes); is_disabled optional bool field added to KnowledgeDocumentMetadata proto; new patch_knowledge_document RPC on GenAIService (LX-2095)
  • 0bcdded feat(gen-ai): pagination for knowledge doc listingGET /documents gains size, pageToken, metaInclude query params; ListKnowledgeDocumentsResponseDto gains totalCount and nextPageToken fields (LX-2103)
  • e52f451 feat(gen-ai): pass knowledge doc read permission — Server-side READ_KNOWLEDGE_DOCUMENTS permission check in AIController; no new SDK surface required (LX-2110)

What was implemented in SDK

Created a new catalog/knowledge package with three @attrs.define wrapper classes that wrap the regenerated API client DTOs:

  • CatalogKnowledgeDocumentMetadata — wraps KnowledgeDocumentMetadataDto, includes filename, title, is_disabled, scopes
  • CatalogListKnowledgeDocumentsResponse — wraps ListKnowledgeDocumentsResponseDto, includes documents, total_count, next_page_token
  • CatalogPatchKnowledgeDocumentRequest — wraps PatchKnowledgeDocumentRequestDto, all fields optional (is_disabled, title, scopes)

Added two service methods to ComputeService:

  • list_knowledge_documents(workspace_id, *, size, page_token, meta_include) — forwards optional pagination params via conditional kwargs
  • patch_knowledge_document(workspace_id, filename, patch_request) — calls actions_api.patch_document

All three classes exported from gooddata_sdk/__init__.py. 14/14 unit tests pass.

Files modified

  • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • packages/gooddata-sdk/src/gooddata_sdk/catalog/knowledge/__init__.py
  • packages/gooddata-sdk/src/gooddata_sdk/catalog/knowledge/model/__init__.py
  • packages/gooddata-sdk/src/gooddata_sdk/catalog/knowledge/model/knowledge_document.py
  • packages/gooddata-sdk/src/gooddata_sdk/compute/service.py
  • packages/gooddata-sdk/tests/catalog/knowledge/__init__.py
  • packages/gooddata-sdk/tests/catalog/knowledge/test_knowledge_documents.py

JIRA: PENDING (Jira ticket will be created after review)
Risk: Low

Auto Implementer and others added 2 commits March 17, 2026 13:01
Adds CatalogKnowledgeDocumentMetadata, CatalogListKnowledgeDocumentsResponse,
and CatalogPatchKnowledgeDocumentRequest model classes under catalog/knowledge/,
plus list_knowledge_documents() and patch_knowledge_document() service methods
on ComputeService to expose the new API client endpoints (LX-2095, LX-2103).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 87.69231% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.29%. Comparing base (4dc3f87) to head (a83fcf0).

Files with missing lines Patch % Lines
..._sdk/catalog/knowledge/model/knowledge_document.py 82.97% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1438      +/-   ##
==========================================
+ Coverage   77.24%   77.29%   +0.04%     
==========================================
  Files         227      230       +3     
  Lines       14672    14737      +65     
==========================================
+ Hits        11334    11391      +57     
- Misses       3338     3346       +8     

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

@hkad98 hkad98 closed this Mar 18, 2026
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