Skip to content

Commit 6a2e4b6

Browse files
jopemachineclaude
andcommitted
fix(BA-5830): break import cycle by lightening app_config_fragment package init
Carry the BA-5832 cycle fix through this branch: empty `app_config_fragment/__init__.py` and route schema.py through the submodule paths directly so `app_config.types.bulk_payloads` no longer re-enters a partially-initialized `app_config.types` module via the resolver. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0937ec7 commit 6a2e4b6

2 files changed

Lines changed: 13 additions & 40 deletions

File tree

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,9 @@
1-
"""AppConfigFragment GraphQL API package."""
1+
"""AppConfigFragment GraphQL API package.
22
3-
from .resolver import (
4-
admin_app_config_fragments,
5-
admin_bulk_create_app_config_fragments,
6-
admin_bulk_purge_app_config_fragments,
7-
admin_bulk_update_app_config_fragments,
8-
app_config_fragment,
9-
my_bulk_create_app_config_fragments,
10-
my_bulk_update_app_config_fragments,
11-
)
12-
from .types import (
13-
AppConfigFragmentFilterGQL,
14-
AppConfigFragmentGQL,
15-
AppConfigFragmentKeyInputGQL,
16-
AppConfigFragmentOrderByGQL,
17-
AppConfigFragmentOrderFieldGQL,
18-
AppConfigScopeTypeGQL,
19-
)
20-
21-
__all__ = [
22-
# Queries — scope-bound list belongs on DomainV2 / UserV2 child fields
23-
"app_config_fragment",
24-
"admin_app_config_fragments",
25-
# Bulk mutations
26-
"admin_bulk_create_app_config_fragments",
27-
"admin_bulk_update_app_config_fragments",
28-
"admin_bulk_purge_app_config_fragments",
29-
"my_bulk_create_app_config_fragments",
30-
"my_bulk_update_app_config_fragments",
31-
# Types
32-
"AppConfigFragmentGQL",
33-
"AppConfigScopeTypeGQL",
34-
"AppConfigFragmentFilterGQL",
35-
"AppConfigFragmentOrderByGQL",
36-
"AppConfigFragmentOrderFieldGQL",
37-
"AppConfigFragmentKeyInputGQL",
38-
]
3+
Resolver and type names are re-exported by ``schema.py`` directly via
4+
their submodules to keep this package's ``__init__`` import-light: a
5+
top-level ``from app_config_fragment import ...`` would otherwise drag
6+
in the mutation resolvers, which back-import from
7+
``app_config.types.bulk_payloads`` and form an import cycle when
8+
``AppConfigGQL`` is loading.
9+
"""

src/ai/backend/manager/api/gql/schema.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@
2020
my_app_configs,
2121
public_app_config_fragments,
2222
)
23-
from .app_config_fragment import (
24-
admin_app_config_fragments,
23+
from .app_config_fragment.resolver.mutation import (
2524
admin_bulk_create_app_config_fragments,
2625
admin_bulk_purge_app_config_fragments,
2726
admin_bulk_update_app_config_fragments,
28-
app_config_fragment,
2927
my_bulk_create_app_config_fragments,
3028
my_bulk_update_app_config_fragments,
3129
)
30+
from .app_config_fragment.resolver.query import (
31+
admin_app_config_fragments,
32+
app_config_fragment,
33+
)
3234
from .app_config_policy import (
3335
admin_bulk_create_app_config_policies,
3436
admin_bulk_purge_app_config_policies,

0 commit comments

Comments
 (0)