Skip to content

refactor(core): share the query-group subscriber lookup - #10317

Merged
gmazoyer merged 1 commit into
developfrom
gma-20260819-ifc-3016
Aug 20, 2026
Merged

refactor(core): share the query-group subscriber lookup#10317
gmazoyer merged 1 commit into
developfrom
gma-20260819-ifc-3016

Conversation

@gmazoyer

@gmazoyer gmazoyer commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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

uv run invoke backend.test-unit

Impact & rollout

  • Backward compatibility: unchanged behaviour.
  • Deployment notes: safe to deploy.

Checklist

  • Tests added/updated: none needed, the existing callers' tests cover it
  • Changelog entry added: no user-facing change
  • External docs updated: not applicable
  • Internal .md docs updated: not applicable
  • I have reviewed AI generated content

@gmazoyer
gmazoyer requested review from a team as code owners August 19, 2026 07:34
@github-actions github-actions Bot added type/documentation Improvements or additions to documentation group/backend Issue related to the backend (API Server, Git Agent) type/spec A specification for an upcoming change to the project labels Aug 19, 2026
@gmazoyer
gmazoyer marked this pull request as draft August 19, 2026 07:37
@gmazoyer
gmazoyer removed request for a team August 19, 2026 07:37
@gmazoyer
gmazoyer force-pushed the gma-20260819-ifc-3016 branch from 6f7bc3d to 39de525 Compare August 19, 2026 07:37
@github-actions github-actions Bot added the group/frontend Issue related to the frontend (React) label Aug 19, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found and verified against the latest diff

Confidence score: 4/5

  • In backend/infrahub/config.py, INFRAHUB_COALESCE_PYTHON_RECOMPUTE_AFTER_MERGE currently 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 thread backend/infrahub/config.py Outdated
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.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is intended. We will make use of it in a follow-up PR.

Comment thread dev/specs/ifc-3002-coalesce-python-recompute/research.md Outdated
Comment thread backend/infrahub/config.py Outdated
Comment thread backend/infrahub/core/merge/recompute_coalescing.py Outdated
Comment thread dev/specs/ifc-3002-coalesce-python-recompute/quickstart.md Outdated
Comment thread dev/specs/ifc-3002-coalesce-python-recompute/plan.md Outdated
Comment thread dev/specs/ifc-3002-coalesce-python-recompute/plan.md Outdated
@codspeed-hq

codspeed-hq Bot commented Aug 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 13 untouched benchmarks


Comparing gma-20260819-ifc-3016 (14fc969) with develop (00e5b35)

Open in CodSpeed

@gmazoyer
gmazoyer force-pushed the gma-20260819-ifc-3016 branch 2 times, most recently from 35b3c6e to a2cff5d Compare August 19, 2026 10:22
@gmazoyer
gmazoyer marked this pull request as ready for review August 19, 2026 12:48
@gmazoyer
gmazoyer requested a review from a team as a code owner August 19, 2026 12:48
@gmazoyer
gmazoyer removed the request for review from a team August 20, 2026 08:08
@gmazoyer
gmazoyer force-pushed the gma-20260819-ifc-3016 branch from a2cff5d to d06a0e0 Compare August 20, 2026 08:50
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
gmazoyer force-pushed the gma-20260819-ifc-3016 branch from d06a0e0 to 3793828 Compare August 20, 2026 10:57
@gmazoyer gmazoyer changed the title refactor(recompute): share the subscriber lookup and add the coalesce switch refactor(core): share the query-group subscriber lookup Aug 20, 2026
@github-actions github-actions Bot removed type/documentation Improvements or additions to documentation group/frontend Issue related to the frontend (React) type/spec A specification for an upcoming change to the project labels Aug 20, 2026
@gmazoyer
gmazoyer force-pushed the gma-20260819-ifc-3016 branch from 3793828 to 14fc969 Compare August 20, 2026 12:07
@gmazoyer
gmazoyer merged commit fddb288 into develop Aug 20, 2026
20 of 21 checks passed
@gmazoyer
gmazoyer deleted the gma-20260819-ifc-3016 branch August 20, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/backend Issue related to the backend (API Server, Git Agent)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants