opsmill / infrahub

Infrahub - A new approach to Infrastructure Management
https://opsmill.com/
GNU Affero General Public License v3.0
144 stars 7 forks source link

bug: branch_agnostic queries don't return correct branch on individual nodes #3719

Closed ajtmccarty closed 3 days ago

ajtmccarty commented 1 week ago

Component

API Server / GraphQL

Current Behavior

from @ogenstad in Slack

NodeManager.query supports a parameter called branch_agnostic that lets you query for nodes across branches but if you query on the main branch all Node objects returned will be associated with the main branch instead of the actual branch where the object is created. I.e. https://github.com/opsmill/infrahub/blob/develop/backend/infrahub/core/manager.py#L893

Expected Behavior

each node returned in a query should have the correct branch associated with it

Steps to Reproduce

I don't think this can be reproduced outside of a unit test right now

Additional Information

No response