Skip to content

Plan for store merge#1120

Draft
ogenstad wants to merge 1 commit into
infrahub-developfrom
pog-store-merge-ihs-138
Draft

Plan for store merge#1120
ogenstad wants to merge 1 commit into
infrahub-developfrom
pog-store-merge-ihs-138

Conversation

@ogenstad

@ogenstad ogenstad commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Why

Plan to resolve #413

Closes

What changed

How to review

How to test

# Commands to validate

Impact & rollout

  • Backward compatibility:
  • Performance:
  • Config/env changes:
  • Deployment notes:

Checklist

  • Tests added/updated
  • Changelog entry added (uv run towncrier create ...)
  • External docs updated (if user-facing or ops-facing change)
  • Internal .md docs updated (internal knowledge and AI code tools knowledge)

Summary by cubic

Adds a detailed plan and decision sheet to fix IHS-138: the SDK store will merge re-fetched nodes by UUID instead of overwriting, so previously fetched attributes/relationships aren’t lost. This prevents duplicate objects and stale data in client.store.

  • Bug Fixes
    • Merge-by-field on re-fetch; keep unfetched fields; replace lists for many relations; include hierarchical relationships.
    • Add presence flags: Attribute.is_fetched and a real fetched flag on RelatedNode; reuse RelationshipManager.initialized.
    • Defaults and opt-outs: merge is default; per-call merge on get/all/filters and store.set; global Config.store_merge; store.set() defaults to replace.
    • One canonical store object per UUID; re-fetch mutates it; unsaved local edits win.
    • Tests, docs, and a clear behavior-change note planned; target SDK 1.23.0.

Written for commit 2150150. Summary will update on new commits.

Review in cubic

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2150150
Status: ✅  Deploy successful!
Preview URL: https://3f00f22c.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-store-merge-ihs-138.infrahub-sdk-python.pages.dev

View logs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="dev/specs/ihs-138-store-merge/decisions.md">

<violation number="1" location="dev/specs/ihs-138-store-merge/decisions.md:133">
P3: Stale line reference in D5: `related_node.py:189` points to `display_label`, not `initialized`. The `initialized` property is at line 182.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic


---

## D5 - Internal presence-flag naming

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Stale line reference in D5: related_node.py:189 points to display_label, not initialized. The initialized property is at line 182.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At dev/specs/ihs-138-store-merge/decisions.md, line 133:

<comment>Stale line reference in D5: `related_node.py:189` points to `display_label`, not `initialized`. The `initialized` property is at line 182.</comment>

<file context>
@@ -0,0 +1,187 @@
+
+---
+
+## D5 - Internal presence-flag naming
+
+**Question.** Name for the new "present in this response" flag on `Attribute` and
</file context>

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