Fix infrahubctl proposed change table generation#805
Fix infrahubctl proposed change table generation#805gmazoyer merged 3 commits intoinfrahub-developfrom
Conversation
This was broken because the API server will now expose the `created_by` and `created_at` values inside the node metadata. Also add `get_node_metadata` to `CoreNodeBase` protocol.
WalkthroughA new optional protocol method 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the 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. Comment |
Deploying infrahub-sdk-python with
|
| Latest commit: |
68a1479
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cbe81a7b.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://gma-20260203-ctl-fix-pc-repo.infrahub-sdk-python.pages.dev |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## infrahub-develop #805 +/- ##
====================================================
+ Coverage 80.32% 80.46% +0.13%
====================================================
Files 115 117 +2
Lines 9867 10226 +359
Branches 1504 1547 +43
====================================================
+ Hits 7926 8228 +302
- Misses 1420 1462 +42
- Partials 521 536 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@infrahub_sdk/ctl/branch.py`:
- Around line 113-116: The current assignment of created_by from metadata (via
pc.get_node_metadata()) can yield the literal string "None" when
metadata.created_by.display_label is None; update the guard around created_by so
it checks that metadata, metadata.created_by, and
metadata.created_by.display_label are truthy and fall back to "-" otherwise
(adjust the code in the block that calls get_node_metadata(), where created_by
is computed, and keep format_timestamp usage for created_at as-is).
ogenstad
left a comment
There was a problem hiding this comment.
LGTM.
This will of course only work for installations after Infrahub 1.7. It might be that this being targeted for infrahub-develop would mean that it only gets included in an SDK version that will require Infrahub 1.8. Not related to this PR, just feels like it would be nice to have this resolved. For this version we should probably clearly state in the release notes of the SDK to highlight what release is required. Then after that we can hopefully avoid breaking changes between version.
This was broken because the API server will now expose the
created_byandcreated_atvalues inside the node metadata.Also add
get_node_metadatatoCoreNodeBaseprotocol.Summary by CodeRabbit
New Features
Improvements
Tests
Documentation