Skip to content

feat(ingestion): Support status aspect patching with auto_status_aspect.py#18239

Merged
chriscollins3456 merged 5 commits into
masterfrom
cc--support-status-patch
Jul 9, 2026
Merged

feat(ingestion): Support status aspect patching with auto_status_aspect.py#18239
chriscollins3456 merged 5 commits into
masterfrom
cc--support-status-patch

Conversation

@chriscollins3456

Copy link
Copy Markdown
Collaborator

There's a bug in auto_status_aspect.py where we are always overwriting the status aspect. Instead this should be a patch MCP since there is other info in this aspect like lifecycleStage.

This supports PATCH for the status aspect in GMS and then checks the server version on the auto status aspect populator and uses patch if it's supported.

@github-actions github-actions Bot added the ingestion PR or Issue related to the ingestion of metadata label Jul 7, 2026
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 9 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...a/aspect/patch/template/common/StatusTemplate.java 10.00% 9 Missing ⚠️

📢 Thoughts on this report? Let us know!

@datahub-connector-tests

datahub-connector-tests Bot commented Jul 7, 2026

Copy link
Copy Markdown

Connector Tests Results

All connector tests passed for commit 2d1d6ab

View full test logs →

To skip connector tests, add the skip-connector-tests label (org members only).

Autogenerated by the connector-tests CI pipeline.

@maggiehays maggiehays added the needs-review Label for PRs that need review from a maintainer. label Jul 7, 2026
Comment on lines +30 to +33
from datahub.utilities.server_config_util import (
RestServiceConfig,
get_gms_config,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, we prefer imports at the top
Is there any reason for having these nested? circular deps doesn't seem an issue here

# PATCH only sets removed=false without overwriting other
# fields (lifecycleStage, lifecycleState, lifecycleLastUpdated).
patch_builder = MetadataPatchProposal(urn)
patch_builder._add_patch(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch_builder._add_patch(...) calls a private method from outside its class — it works, but it's a code smell.
Adding a patch helper or StatusPatchBuilder is probably out of scope for this PR, but could we leave a TODO comment for now?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Coverage gap: the version-gating in _gms_supports_status_patch() itself (cloud vs core thresholds, missing-config → False) isn't unit-tested — only the patch/upsert branch selection is. That gating logic is the crux of the change; a small test would be well spent.

@maggiehays maggiehays added pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed needs-review Label for PRs that need review from a maintainer. labels Jul 8, 2026

@sgomezvillamor sgomezvillamor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The import is at module scope now, the StatusPatchBuilder is a much cleaner way to express the patch than reaching into _add_patch directly, and the version-gating logic is well covered by the new tests.


Generated by Claude Code

@chriscollins3456
chriscollins3456 merged commit 7ef7e2d into master Jul 9, 2026
73 checks passed
@chriscollins3456
chriscollins3456 deleted the cc--support-status-patch branch July 9, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ingestion PR or Issue related to the ingestion of metadata pending-submitter-response Issue/request has been reviewed but requires a response from the submitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants