Skip to content

Conversation

@FragmentedPacket
Copy link
Contributor

@FragmentedPacket FragmentedPacket commented Jan 12, 2026

Reimplements #732 but only casting if the peer schema has an HFID defined.

Relevant CI runs in Infrahub: opsmill/infrahub#8096

Summary by CodeRabbit

  • New Features

    • Human-friendly ID (HFID) support for relationships: peers now expose HFID info and reference values are normalized during node creation when applicable.
  • Tests

    • Expanded unit tests covering HFID normalization, object loading with HFIDs, and related-node payload generation.
  • Schema

    • Test fixtures updated to include human_friendly_id on sample nodes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Walkthrough

Adds HFID normalization utilities normalize_hfid_reference and normalize_hfid_references and imports is_valid_uuid. Extends RelationshipInfo with peer_human_friendly_id: list[str] | None and peer_has_hfid property; get_relationship_info now assigns info.peer_human_friendly_id from the peer schema. create_node applies HFID normalization for ONE_REF and MANY_REF when the peer exposes HFID. Test fixtures add human_friendly_id to GraphQLQuery and Tag, and unit tests were added for HFID normalization and RelatedNode GraphQL payloads.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: re-implementing HFID casting with conditional logic based on peer schema definitions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61cc694 and bb46a8f.

📒 Files selected for processing (1)
  • tests/unit/sdk/spec/test_object.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification

Files:

  • tests/unit/sdk/spec/test_object.py
tests/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

tests/**/*.py: Use httpx_mock fixture for HTTP mocking in tests instead of making real HTTP requests
Do not add @pytest.mark.asyncio decorator to async test functions (async auto-mode is globally enabled)

Files:

  • tests/unit/sdk/spec/test_object.py
tests/unit/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

Unit tests must be fast, mocked, and have no external dependencies

Files:

  • tests/unit/sdk/spec/test_object.py
🧠 Learnings (1)
📚 Learning: 2025-11-25T13:23:15.190Z
Learnt from: wvandeun
Repo: opsmill/infrahub-sdk-python PR: 637
File: infrahub_sdk/operation.py:74-76
Timestamp: 2025-11-25T13:23:15.190Z
Learning: In infrahub_sdk/operation.py, the recursive=True parameter in _process_relationships is a temporary workaround to access Proposed Changes data. This will be replaced with proper object-level metadata implementation in version 1.7.

Applied to files:

  • tests/unit/sdk/spec/test_object.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: unit-tests (3.14)
  • GitHub Check: unit-tests (3.11)
  • GitHub Check: unit-tests (3.12)
  • GitHub Check: unit-tests (3.13)
  • GitHub Check: unit-tests (3.10)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
tests/unit/sdk/spec/test_object.py (4)

3-21: Imports look correct.

The imports align with the new test functionality. The previously flagged unused RelationshipSchema import (F401) has been removed.


277-336: Well-structured test data with good coverage.

The HfidLoadTestCase dataclass and test cases cover the key HFID normalization scenarios: cardinality one/many, string/list/UUID formats, and mixed inputs. Good use of descriptive test case names.


379-396: Good isolated unit test.

This test directly validates the normalize_hfid_reference function's logic in isolation—exactly what a unit test should do. Clear test cases for each transformation path.


430-454: Test appropriately validates GraphQL payload structure.

The test correctly uses mocks and validates the actual payload generated by _generate_input_data(). Testing this private method is appropriate here since it's part of the RelatedNodeBase protocol interface and is the standard way the SDK generates GraphQL mutation payloads. The test meets all unit test requirements: it's fast, fully mocked, has no external dependencies, and includes proper type hints.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d116aa3 and 0597033.

📒 Files selected for processing (3)
  • infrahub_sdk/spec/object.py
  • tests/fixtures/schema_01.json
  • tests/unit/sdk/spec/test_object.py
🧰 Additional context used
📓 Path-based instructions (4)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification

Files:

  • infrahub_sdk/spec/object.py
  • tests/unit/sdk/spec/test_object.py
infrahub_sdk/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Follow async/sync dual pattern for new features in the Python SDK

Files:

  • infrahub_sdk/spec/object.py
tests/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

tests/**/*.py: Use httpx_mock fixture for HTTP mocking in tests instead of making real HTTP requests
Do not add @pytest.mark.asyncio decorator to async test functions (async auto-mode is globally enabled)

Files:

  • tests/unit/sdk/spec/test_object.py
tests/unit/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

Unit tests must be fast, mocked, and have no external dependencies

Files:

  • tests/unit/sdk/spec/test_object.py
🪛 GitHub Actions: CI
infrahub_sdk/spec/object.py

[error] 427-427: Ruff: PLR0915 Too many statements (51 > 50) in async def create_node.

🔇 Additional comments (11)
infrahub_sdk/spec/object.py (5)

10-10: LGTM!

Import of is_valid_uuid is appropriate for the UUID detection logic in the new normalization functions.


37-54: LGTM!

The normalization logic is clear and well-documented. The function correctly handles all three cases: lists (unchanged), UUIDs (unchanged), and non-UUID strings (wrapped in list for single-component HFID).


57-64: LGTM!

Simple and correct mapping of the reference normalization over a list of values.


85-85: LGTM!

The peer_has_hfid field with a conservative False default ensures normalization is only applied when explicitly determined.


153-154: LGTM!

The peer_has_hfid is correctly set after fetching the peer schema. Using bool() properly handles None, empty lists, and non-empty lists.

tests/fixtures/schema_01.json (1)

245-248: LGTM!

Adding human_friendly_id to the Tag node enables the HFID normalization tests. The BuiltinLocation schema has relationships to BuiltinTag (both tags and primary_tag), so this change properly supports testing both cardinality-one and cardinality-many HFID normalization scenarios.

Note: The AI summary mentions human_friendly_id was added to GraphQLQuery, but the actual code shows only Tag received this field. This is not an issue—the test coverage targets the BuiltinLocationBuiltinTag relationships.

tests/unit/sdk/spec/test_object.py (5)

3-20: LGTM!

Imports are appropriate for the new test infrastructure. Good use of TYPE_CHECKING for the InfrahubNode type hint.


277-336: LGTM!

Comprehensive test cases covering all HFID normalization scenarios: cardinality-one (string, list, UUID) and cardinality-many (strings, lists, mixed, UUIDs). The dataclass provides clear structure for parameterized testing.


339-376: Well-structured integration test for HFID normalization.

The test correctly:

  • Mocks InfrahubNode.save to prevent HTTP calls
  • Captures the data passed to client.create for assertion
  • Validates both cardinality-one and cardinality-many normalization

One minor suggestion: Consider using patch.object(client_with_schema_01, 'create', ...) for consistency with the patch usage for save, though the direct assignment works fine for tests.


379-469: LGTM!

Excellent unit test coverage for normalize_hfid_reference. The test cases clearly demonstrate the expected behavior difference when peer_has_hfid is True vs False, and the assertions verify both the type and value of the output.


472-529: LGTM!

Good test coverage for verifying the actual GraphQL payload structure produced by RelatedNode. While _generate_input_data() is a private method, testing it directly here is appropriate to verify the critical {"id": ...} vs {"hfid": [...]} payload distinction that the HFID normalization feature relies upon.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 12, 2026

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: bb46a8f
Status: ✅  Deploy successful!
Preview URL: https://0771f256.infrahub-sdk-python.pages.dev
Branch Preview URL: https://may-202601-hfid-object-loadi.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##           stable     #746      +/-   ##
==========================================
+ Coverage   80.30%   80.32%   +0.02%     
==========================================
  Files         115      115              
  Lines        9874     9888      +14     
  Branches     1518     1520       +2     
==========================================
+ Hits         7929     7943      +14     
  Misses       1417     1417              
  Partials      528      528              
Flag Coverage Δ
integration-tests 41.38% <88.88%> (+0.08%) ⬆️
python-3.10 51.42% <94.44%> (+0.49%) ⬆️
python-3.11 51.40% <94.44%> (+0.47%) ⬆️
python-3.12 51.40% <94.44%> (+0.49%) ⬆️
python-3.13 51.40% <94.44%> (+0.51%) ⬆️
python-3.14 53.05% <94.44%> (+0.51%) ⬆️
python-filler-3.12 23.99% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/spec/object.py 85.48% <100.00%> (+0.68%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/unit/sdk/spec/test_object.py (1)

357-377: Consider using patch.object for cleaner fixture handling.

Directly assigning client_with_schema_01.create = mock_create mutates the fixture without restoration. While function-scoped fixtures typically get recreated, using patch.object ensures consistent cleanup and is more idiomatic.

🔧 Suggested refactor using patch.object
-    client_with_schema_01.create = mock_create
-
-    with patch("infrahub_sdk.node.InfrahubNode.save", new_callable=AsyncMock):
+    with (
+        patch.object(client_with_schema_01, "create", side_effect=mock_create),
+        patch("infrahub_sdk.node.InfrahubNode.save", new_callable=AsyncMock),
+    ):
         await obj.process(client=client_with_schema_01)
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a66abc1 and e96c799.

📒 Files selected for processing (1)
  • tests/unit/sdk/spec/test_object.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification

Files:

  • tests/unit/sdk/spec/test_object.py
tests/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

tests/**/*.py: Use httpx_mock fixture for HTTP mocking in tests instead of making real HTTP requests
Do not add @pytest.mark.asyncio decorator to async test functions (async auto-mode is globally enabled)

Files:

  • tests/unit/sdk/spec/test_object.py
tests/unit/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

Unit tests must be fast, mocked, and have no external dependencies

Files:

  • tests/unit/sdk/spec/test_object.py
🧬 Code graph analysis (1)
tests/unit/sdk/spec/test_object.py (1)
infrahub_sdk/spec/object.py (9)
  • spec (676-682)
  • ObjectFile (672-700)
  • RelationshipDataFormat (67-75)
  • get_relationship_info (136-199)
  • normalize_hfid_reference (37-54)
  • validate_format (212-231)
  • validate_format (693-697)
  • process (233-246)
  • process (699-700)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: unit-tests (3.10)
  • GitHub Check: unit-tests (3.12)
  • GitHub Check: unit-tests (3.11)
  • GitHub Check: unit-tests (3.14)
  • GitHub Check: unit-tests (3.13)
  • GitHub Check: integration-tests-latest-infrahub
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (6)
tests/unit/sdk/spec/test_object.py (6)

1-21: LGTM!

Imports are well-organized with appropriate use of TYPE_CHECKING for type-hint-only imports. The new imports align with the test requirements for mocking and HFID normalization testing.


277-336: LGTM!

The HfidLoadTestCase dataclass is well-structured with proper type hints. The test cases provide comprehensive coverage including string-to-list normalization, UUID passthrough, and cardinality-many scenarios with mixed formats.


379-436: LGTM!

The GraphQLPayloadTestCase dataclass is well-documented with a clear explanation of how RelatedNode interprets data formats. The test cases provide good coverage of the normalization matrix for both HFID-enabled and non-HFID peers.


439-469: LGTM!

The synchronous test is appropriate for the sync normalize_hfid_reference function. The conditional normalization logic (based on peer_has_hfid) correctly mirrors the expected runtime behavior, and assertions include helpful error messages.


472-500: LGTM!

The RelatedNodePayloadTestCase structure is clean with appropriate test cases covering the key payload scenarios: UUID-to-id and HFID-to-hfid transformations.


503-527: No changes needed. The test appropriately verifies the GraphQL payload structure.

_generate_input_data() is the standard internal protocol for payload generation across the entire codebase and is the only way to access the combined payload structure. This method is defined in protocols_base.py as part of the contract and is used consistently in integration tests, unit tests, and core implementations. Testing this internal contract is appropriate for unit tests, and there is no public alternative API available.

Comment on lines 449 to 454
if test_case.peer_has_hfid:
# When peer has HFID, use normalization
processed_value = normalize_hfid_reference(test_case.input_value)
else:
# When peer has no HFID, pass value as-is (no normalization)
processed_value = test_case.input_value
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't actually test the logic that checks if the peer schema has an HFID defined. for that, this test probably needs to call get_relationship_info. although that looks like it will require some mocking

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/unit/sdk/spec/test_object.py (1)

507-531: Consider testing through public API instead of private method.

The test directly calls _generate_input_data() which is a private method (prefixed with _). While the test correctly verifies the GraphQL payload structure, testing private methods can be fragile as implementation details may change.

Consider whether there's a public method or integration point that could be used instead to verify this behavior, or document why testing this private method is necessary for coverage.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e96c799 and 4330c06.

📒 Files selected for processing (2)
  • infrahub_sdk/spec/object.py
  • tests/unit/sdk/spec/test_object.py
🧰 Additional context used
📓 Path-based instructions (4)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification

Files:

  • infrahub_sdk/spec/object.py
  • tests/unit/sdk/spec/test_object.py
infrahub_sdk/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Follow async/sync dual pattern for new features in the Python SDK

Files:

  • infrahub_sdk/spec/object.py
tests/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

tests/**/*.py: Use httpx_mock fixture for HTTP mocking in tests instead of making real HTTP requests
Do not add @pytest.mark.asyncio decorator to async test functions (async auto-mode is globally enabled)

Files:

  • tests/unit/sdk/spec/test_object.py
tests/unit/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

Unit tests must be fast, mocked, and have no external dependencies

Files:

  • tests/unit/sdk/spec/test_object.py
🧠 Learnings (1)
📚 Learning: 2025-11-25T13:23:15.190Z
Learnt from: wvandeun
Repo: opsmill/infrahub-sdk-python PR: 637
File: infrahub_sdk/operation.py:74-76
Timestamp: 2025-11-25T13:23:15.190Z
Learning: In infrahub_sdk/operation.py, the recursive=True parameter in _process_relationships is a temporary workaround to access Proposed Changes data. This will be replaced with proper object-level metadata implementation in version 1.7.

Applied to files:

  • infrahub_sdk/spec/object.py
🧬 Code graph analysis (2)
infrahub_sdk/spec/object.py (1)
infrahub_sdk/utils.py (1)
  • is_valid_uuid (85-91)
tests/unit/sdk/spec/test_object.py (2)
infrahub_sdk/schema/main.py (4)
  • RelationshipSchema (124-142)
  • kind (279-280)
  • get_matching_relationship (209-220)
  • get_relationship (187-191)
infrahub_sdk/spec/object.py (4)
  • spec (681-687)
  • RelationshipDataFormat (67-75)
  • get_relationship_info (141-204)
  • normalize_hfid_reference (37-54)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: unit-tests (3.12)
  • GitHub Check: unit-tests (3.10)
  • GitHub Check: unit-tests (3.11)
  • GitHub Check: unit-tests (3.13)
  • GitHub Check: unit-tests (3.14)
  • GitHub Check: integration-tests-latest-infrahub
🔇 Additional comments (11)
infrahub_sdk/spec/object.py (6)

10-10: LGTM!

The import of is_valid_uuid from ..utils is correctly added to support the HFID normalization logic.


37-54: LGTM!

The normalize_hfid_reference function is well-documented and correctly implements the normalization logic. The type hints are appropriate, and the function handles all three cases (list, UUID string, non-UUID string) correctly.


57-64: LGTM!

The normalize_hfid_references function correctly applies normalize_hfid_reference to each element in the list.


85-90: LGTM!

The new peer_human_friendly_id field and peer_has_hfid property are correctly implemented. The property correctly handles None and empty lists by returning False, and non-empty lists by returning True.


159-159: LGTM!

Correctly populates peer_human_friendly_id from the peer schema's human_friendly_id field.


485-490: LGTM!

The HFID normalization is correctly integrated into the create_node method. The conditional normalization based on peer_has_hfid ensures that references are only transformed when the peer schema defines a human-friendly ID, preserving backward compatibility for schemas without HFID.

tests/unit/sdk/spec/test_object.py (5)

3-17: LGTM!

The imports are well-organized and correctly bring in the necessary dependencies for the new tests, including dataclass for test case structures, mock utilities from unittest.mock, and the new normalize_hfid_reference function being tested.


278-337: LGTM!

The HfidLoadTestCase dataclass and HFID_NORMALIZATION_TEST_CASES provide comprehensive coverage of HFID normalization scenarios, including cardinality-one and cardinality-many cases with strings, lists, UUIDs, and mixed formats.


340-377: LGTM!

The test correctly validates HFID normalization by intercepting the create call and verifying the normalized data. The mocking approach with patch and AsyncMock follows the coding guidelines for unit tests.


380-453: LGTM!

The test_peer_has_hfid_from_schema test thoroughly verifies the peer_has_hfid property behavior with proper mocking. The test cases correctly cover all three scenarios: defined HFID, None, and empty list.


456-473: LGTM!

Excellent direct unit test for normalize_hfid_reference that covers all three code paths in isolation.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/unit/sdk/spec/test_object.py`:
- Around line 10-17: The import 'RelationshipSchema' in
tests/unit/sdk/spec/test_object.py is unused and causing F401; remove
'RelationshipSchema' from the import list (the from infrahub_sdk.schema import
... line) so the file only imports symbols actually used (RelatedNode,
ObjectFile, RelationshipDataFormat, get_relationship_info,
normalize_hfid_reference), then run the linter/tests to confirm the F401 is
resolved.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4330c06 and 61cc694.

📒 Files selected for processing (1)
  • tests/unit/sdk/spec/test_object.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification

Files:

  • tests/unit/sdk/spec/test_object.py
tests/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

tests/**/*.py: Use httpx_mock fixture for HTTP mocking in tests instead of making real HTTP requests
Do not add @pytest.mark.asyncio decorator to async test functions (async auto-mode is globally enabled)

Files:

  • tests/unit/sdk/spec/test_object.py
tests/unit/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

Unit tests must be fast, mocked, and have no external dependencies

Files:

  • tests/unit/sdk/spec/test_object.py
🧬 Code graph analysis (1)
tests/unit/sdk/spec/test_object.py (1)
infrahub_sdk/spec/object.py (9)
  • spec (681-687)
  • ObjectFile (677-705)
  • RelationshipDataFormat (67-75)
  • get_relationship_info (141-204)
  • normalize_hfid_reference (37-54)
  • validate_format (217-236)
  • validate_format (698-702)
  • process (238-251)
  • process (704-705)
🪛 GitHub Actions: CI
tests/unit/sdk/spec/test_object.py

[error] 11-11: F401: 'infrahub_sdk.schema.RelationshipSchema' imported but unused. Remove unused import: 'RelationshipSchema'. (ruff)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (3)
tests/unit/sdk/spec/test_object.py (3)

340-377: Well-structured integration-style test for HFID normalization.

This test exercises the actual normalization flow through ObjectFile.process() and client.create(), capturing the transformed data to verify HFID normalization behavior. The mocking is appropriately scoped to only prevent actual network calls while testing the real logic.


380-397: LGTM!

Clean, focused unit test that covers all three code paths in normalize_hfid_reference: non-UUID strings wrapped in lists, UUIDs returned unchanged, and lists returned unchanged.


431-455: Good unit test for RelatedNode payload generation.

The test effectively verifies that RelatedNode produces the correct GraphQL payload structure ({"id": ...} vs {"hfid": [...]}). Accessing _generate_input_data() is acceptable here for testing the internal payload generation behavior.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@FragmentedPacket FragmentedPacket merged commit 10675dc into stable Jan 14, 2026
21 checks passed
@FragmentedPacket FragmentedPacket deleted the may-202601-hfid-object-loading branch January 14, 2026 16:09
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.

3 participants