refactor: migrate GraphQL loaders + establish central/app infrastructure#19984
Draft
refactor: migrate GraphQL loaders + establish central/app infrastructure#19984
Conversation
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>
|
Skipping CI for Draft Pull Request. |
…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.
456bba3 to
c1d2c6a
Compare
The profiling changes belong in a different PR. This PR only adds GraphQL loaders.
Contributor
🚀 Build Images ReadyImages are ready for commit 6054d2f. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-646-g6054d2f9f3 |
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.
Description
Convert GraphQL loaders from package-level init() to explicit Init() and establish central/app package for component initialization.
Changes:
With busybox consolidation, GraphQL loaders were registering for all components. This change makes loader registration conditional - only central registers GraphQL loaders.
Infrastructure changes:
Expected impact:
Files changed: 68 (15 loaders + 50 resolvers + 3 central/app + main.go)
User-facing documentation
Testing and quality
Automated testing
How I validated my change
change me!