refactor(core): share the query-group subscriber lookup - #10317
Merged
Conversation
gmazoyer
marked this pull request as draft
August 19, 2026 07:37
gmazoyer
force-pushed
the
gma-20260819-ifc-3016
branch
from
August 19, 2026 07:37
6f7bc3d to
39de525
Compare
Contributor
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Confidence score: 4/5
- In
backend/infrahub/config.py,INFRAHUB_COALESCE_PYTHON_RECOMPUTE_AFTER_MERGEcurrently has no effect despite its description promising enabled/disabled behavior, which could mislead operators about recomputation; document it as inactive or implement the promised behavior.
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="backend/infrahub/config.py">
<violation number="1" location="backend/infrahub/config.py:226">
P2: Custom agent: **Flag AI Slop and Fabricated Changes**
`INFRAHUB_COALESCE_PYTHON_RECOMPUTE_AFTER_MERGE` currently has no effect, but its description promises enabled and disabled behavior. Mark this setting explicitly inert until the Python coalescing pass consumes it, or wire the setting into that pass.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
Comment on lines
+226
to
+228
| description="When enabled, Python transform computed attributes are recomputed by the " | ||
| "coalesced merge and rebase pass; when disabled, they fall back to one recompute per " | ||
| "changed node.", |
Contributor
There was a problem hiding this comment.
P2: Custom agent: Flag AI Slop and Fabricated Changes
INFRAHUB_COALESCE_PYTHON_RECOMPUTE_AFTER_MERGE currently has no effect, but its description promises enabled and disabled behavior. Mark this setting explicitly inert until the Python coalescing pass consumes it, or wire the setting into that pass.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/infrahub/config.py, line 226:
<comment>`INFRAHUB_COALESCE_PYTHON_RECOMPUTE_AFTER_MERGE` currently has no effect, but its description promises enabled and disabled behavior. Mark this setting explicitly inert until the Python coalescing pass consumes it, or wire the setting into that pass.</comment>
<file context>
@@ -221,6 +221,12 @@ class MainSettings(BaseSettings):
)
+ coalesce_python_recompute_after_merge: bool = Field(
+ default=True,
+ description="When enabled, Python transform computed attributes are recomputed by the "
+ "coalesced merge and rebase pass; when disabled, they fall back to one recompute per "
+ "changed node.",
</file context>
Suggested change
| description="When enabled, Python transform computed attributes are recomputed by the " | |
| "coalesced merge and rebase pass; when disabled, they fall back to one recompute per " | |
| "changed node.", | |
| description="Reserved for the Python transform recompute pass; currently has no effect until that pass is enabled.", |
Contributor
Author
There was a problem hiding this comment.
This is intended. We will make use of it in a follow-up PR.
gmazoyer
force-pushed
the
gma-20260819-ifc-3016
branch
2 times, most recently
from
August 19, 2026 10:22
35b3c6e to
a2cff5d
Compare
gmazoyer
marked this pull request as ready for review
August 19, 2026 12:48
ajtmccarty
approved these changes
Aug 19, 2026
gmazoyer
force-pushed
the
gma-20260819-ifc-3016
branch
from
August 20, 2026 08:50
a2cff5d to
d06a0e0
Compare
The query existed in two identical copies, one in the regeneration impact resolver and one in the computed-attribute tasks. A third consumer is coming on the merge path, and importing either copy from there would close an import loop.
gmazoyer
force-pushed
the
gma-20260819-ifc-3016
branch
from
August 20, 2026 10:57
d06a0e0 to
3793828
Compare
gmazoyer
force-pushed
the
gma-20260819-ifc-3016
branch
from
August 20, 2026 12:07
3793828 to
14fc969
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The GraphQL query that resolves which nodes subscribe to a query group existed in two identical copies, one in the regeneration impact resolver and one in the computed attribute tasks. Both parsed the response the same way and then mapped it to their own type.
A third consumer is coming on the merge path, for IFC-3002, and importing either existing copy from there would close an import loop through the recompute package.
Ticket: IFC-3016.
What changed
The query and its parsing move into
backend/infrahub/core/query_group/subscribers.py, which depends on nothing but the client. Both callers map from a shared reference type.Pure refactor. No behaviour change, no new configuration, no schema or API change.
How to review
Confirm the two call sites still ask the same question and read the same answer.
How to test
Impact & rollout
Checklist