Skip to content

Introspection#385

Merged
frodesundby merged 21 commits intomainfrom
introspection
Apr 15, 2026
Merged

Introspection#385
frodesundby merged 21 commits intomainfrom
introspection

Conversation

@frodesundby
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds “instance group” introspection to the GraphQL API so clients can inspect ReplicaSet-backed rollout revisions, including env vars, mounted files, instances (pods), and recent K8s events.

Changes:

  • Introduces instancegroup workload package (models, queries, event translation, dataloader + ReplicaSet watcher).
  • Extends GraphQL schema and resolvers to expose Application.instanceGroups and InstanceGroup details.
  • Adjusts Pod transformer to retain metadata.ownerReferences so pods can be matched to ReplicaSets.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/workload/instancegroup/queries.go Core listing + introspection logic for env vars, mounts, and instance (pod) membership
internal/workload/instancegroup/events.go Fetches and translates K8s events for ReplicaSets/pods into user-friendly messages
internal/workload/instancegroup/models.go Defines InstanceGroup and related GraphQL-facing models/enums
internal/workload/instancegroup/dataloader.go Adds loaders + ReplicaSet transformer + environment->dynamic client lookup
internal/workload/instancegroup/node.go Registers InstanceGroup as a Node ident type
internal/workload/dataloader.go Keeps Pod ownerReferences in cached pods to enable ReplicaSet ownership matching
internal/kubernetes/watchers/watchers.go Wires a new ReplicaSet watcher into the global watcher set
internal/graph/schema/instancegroup.graphqls Adds GraphQL types/fields for instance groups and related types
internal/graph/instancegroup.resolvers.go Implements resolvers for instanceGroups, env vars, mounts, instances, events
internal/cmd/api/http.go Injects instancegroup loader context into Graph request pipeline
.configs/gqlgen.yaml Adds instancegroup package to gqlgen autobind
internal/graph/gengql/applications.generated.go gqlgen output wiring Application.instanceGroups
internal/graph/gengql/instancegroup.generated.go gqlgen output for InstanceGroup types/resolvers
internal/graph/gengql/schema.generated.go gqlgen output: Node type switch + schema inclusion
internal/graph/gengql/root_.generated.go gqlgen output: resolver root + complexity hooks
internal/graph/gengql/teams.generated.go gqlgen output: Application field context updates
internal/graph/gengql/issues.generated.go gqlgen output: Application field context updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/workload/instancegroup/queries.go
Comment thread internal/workload/instancegroup/queries.go
Comment thread internal/workload/instancegroup/events.go Outdated
Comment thread internal/workload/instancegroup/events.go Outdated
Comment thread internal/workload/instancegroup/dataloader.go
Lua integration tests covering:
- Application with instance groups (ReplicaSet filtering)
- Instance group with instances (Pod listing)
- Instance group with environment variables (env, configMapKeyRef, secretKeyRef, envFrom)
- Instance group with mounted files (ConfigMap/Secret volume mounts)

Also includes dataloader transformer idempotency unit test.
Include image name, container name, pod name, and rescale size
in translated event messages instead of dropping them. Also remove
nais.yaml tips from scheduling failure messages.
…ss, and last termination info

Extend ApplicationInstanceStatus with ready, lastExitReason, and lastExitCode
fields to give users actionable insight into instance health. Replace raw
Kubernetes reason strings with human-readable messages. Add TERMINATED state
for containers that exited successfully. Fix State() to use classifyWaiting
so benign startup states no longer incorrectly report Application as NOT_RUNNING.
…atterns

- Replace benignWaiting map[string]struct{} with slices.Contains
- Separate benign and problem message maps, remove redundant switch
- Replace sort.Slice with slices.SortFunc using time.Compare
- Replace sort.Strings with slices.Sorted(maps.Keys(...))
- Replace IsValid() switch statements with slices.Contains
@frodesundby frodesundby marked this pull request as ready for review April 14, 2026 13:58
@frodesundby frodesundby requested a review from a team as a code owner April 14, 2026 13:58
Comment thread internal/graph/schema/instancegroup.graphqls Outdated
Comment thread internal/graph/schema/instancegroup.graphqls Outdated
Comment thread internal/graph/schema/instancegroup.graphqls Outdated
Comment thread internal/graph/schema/instancegroup.graphqls Outdated
@frodesundby frodesundby merged commit 7a36229 into main Apr 15, 2026
10 checks passed
@frodesundby frodesundby deleted the introspection branch April 15, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants