Skip to content

refactor: migrate GraphQL loaders + establish central/app infrastructure#19984

Draft
janisz wants to merge 3 commits intomasterfrom
master-init-migration-graphql-foundation
Draft

refactor: migrate GraphQL loaders + establish central/app infrastructure#19984
janisz wants to merge 3 commits intomasterfrom
master-init-migration-graphql-foundation

Conversation

@janisz
Copy link
Copy Markdown
Contributor

@janisz janisz commented Apr 14, 2026

Description

Convert GraphQL loaders from package-level init() to explicit Init() and establish central/app package for component initialization.

Changes:

  • central/graphql/resolvers/loaders/: 15+ loader files init() → Register()
  • central/graphql/resolvers/*: ~50 resolver files with import updates
  • central/app/app.go: create Run() with component-specific initialization
  • central/app/init.go: create initGraphQL(), initCompliance() stubs
  • central/main.go: add profiling.SetComponentLabel(binaryName) in dispatcher
  • central/main.go: call app.Run() before CentralRun()

With busybox consolidation, GraphQL loaders were registering for all components. This change makes loader registration conditional - only central registers GraphQL loaders.

Infrastructure changes:

  • Establishes central/app pattern for explicit initialization
  • Centralizes profiling component labeling in main dispatcher
  • Removes proxy initialization from init() to app logic

Expected impact:

  • Prevents 15+ GraphQL loader registrations in non-central components
  • Proper component labeling in heap/CPU profiles (central, sensor, etc.)
  • Foundation for future init() migrations

Files changed: 68 (15 loaders + 50 resolvers + 3 central/app + main.go)

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

change me!

Convert GraphQL loaders from package-level init() to explicit Init() and
establish central/app package for component initialization.

Changes:
- central/graphql/resolvers/loaders/*: 15+ loader files init() → Register*()
- central/graphql/resolvers/*: ~50 resolver files with import updates
- central/app/app.go: create Run() with component-specific initialization
- central/app/init.go: create initGraphQL(), initCompliance() stubs
- central/main.go: add profiling.SetComponentLabel(binaryName) in dispatcher
- central/main.go: call app.Run() before CentralRun()

With busybox consolidation, GraphQL loaders were registering for all components.
This change makes loader registration conditional - only central registers GraphQL loaders.

Infrastructure changes:
- Establishes central/app pattern for explicit initialization
- Centralizes profiling component labeling in main dispatcher
- Removes proxy initialization from init() to app logic

Expected impact:
- Prevents 15+ GraphQL loader registrations in non-central components
- Proper component labeling in heap/CPU profiles (central, sensor, etc.)
- Foundation for future init() migrations

Files changed: 68 (15 loaders + 50 resolvers + 3 central/app + main.go)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 14, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

…changes)

- Remove metrics.Init() (belongs in metrics PR)
- Remove compliance, notifiers, backup Init() calls (belong in other PRs)
- Remove initComponentLogic (belongs in remaining PR)
- Remove central/app/init.go (belongs in remaining PR)

This PR only introduces GraphQL loaders infrastructure.
@janisz janisz force-pushed the master-init-migration-graphql-foundation branch from 456bba3 to c1d2c6a Compare April 14, 2026 15:16
The profiling changes belong in a different PR. This PR only adds GraphQL loaders.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

🚀 Build Images Ready

Images are ready for commit 6054d2f. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-646-g6054d2f9f3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant