Skip to content

fix: add labels to NodeNotFoundError for clearer messaging#9266

Open
DharmaBytesX wants to merge 1 commit into
opsmill:developfrom
DharmaBytesX:fix/5514-better-node-not-found-error
Open

fix: add labels to NodeNotFoundError for clearer messaging#9266
DharmaBytesX wants to merge 1 commit into
opsmill:developfrom
DharmaBytesX:fix/5514-better-node-not-found-error

Conversation

@DharmaBytesX
Copy link
Copy Markdown
Contributor

@DharmaBytesX DharmaBytesX commented May 17, 2026

The error message now shows Branch:, Kind:, and Identifier: labels
instead of raw pipe-separated values, helping users understand
which branch the lookup failed on.

Before:

        Unable to find the node in the database.
        main | InfraDevice | {'name__value': 'bad-device404'}

After:

        Unable to find the node in the database.
        Branch: main | Kind: InfraDevice | Identifier: {'name__value': 'bad-device404'}

Changes

  • python_sdk submodule updated with the fix
  • Changelog entry added

Related


Summary by cubic

Improved NodeNotFoundError messaging by adding labels for Branch, Kind, and Identifier, replacing the ambiguous pipe-separated string. Pulls in the fix via the python_sdk submodule update and adds a changelog entry; fixes #5514.

Written for commit 3f21188. Summary will update on new commits. Review in cubic

The error message now shows Branch:, Kind:, and Identifier: labels
instead of raw pipe-separated values, helping users understand
which branch the lookup failed on.

Fixes opsmill#5514
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 17, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing DharmaBytesX:fix/5514-better-node-not-found-error (3f21188) with develop (46a56d6)

Open in CodSpeed

@DharmaBytesX
Copy link
Copy Markdown
Contributor Author

Hi! This updates the SDK submodule pointer and adds a changelog entry for the clearer NodeNotFoundError message (paired with opsmill/infrahub-sdk-python#1030). Would appreciate a review when you have a moment. Thanks!

@dgarros dgarros requested a review from a team May 18, 2026 06:31
@ogenstad
Copy link
Copy Markdown
Contributor

I added a comment in the SDK repo here: https://github.com/opsmill/infrahub-sdk-python/pull/1030/changes#r3256789004

It's good to see that the pipeline ran and we don't have any tests that reacts to changes in the __str__ method.

One thing to note is that for pipelines running within this project we only ever merge the PRs that update the SDK submodule commit if those commits live in the stable, develop, infrahub-release branches or if they are from a tagged release. The reason is that other branches will get deleted and as such can cause later problems within the Infrahub repo.

Once the SDK PR is updated I also think we can close this commit since the change happened in that repo, and originally the issue #5514 should have been opened in the SDK repo since it's not strictly related to the Infrahub repo. (I'd not even consider that one a bug, it's more of a user preference, but it might still be nice to update the string).

@DharmaBytesX
Copy link
Copy Markdown
Contributor Author

DharmaBytesX commented May 20, 2026

Thanks for the context on the submodule rule, that makes sense. I've pushed the rework on opsmill/infrahub-sdk-python#1030 addressing the review (required params on NodeNotFoundError, no conditional __str__, all call sites updated). Happy to either close this and re-open against a tagged/landed SDK commit, or leave it open as a tracker until #1030 merges, whatever you prefer.

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