Skip to content

feat(BA-6874): wire compute-schedule into the API handler#12841

Draft
fregataa wants to merge 3 commits into
mainfrom
BA-6874/wire-compute-schedule
Draft

feat(BA-6874): wire compute-schedule into the API handler#12841
fregataa wants to merge 3 commits into
mainfrom
BA-6874/wire-compute-schedule

Conversation

@fregataa

Copy link
Copy Markdown
Member

Summary

  • Wire the compute-schedule (dry-run) GraphQL resolver through the session adapter to the service, so callers can invoke the query end-to-end (resolver → adapter → service → scheduling controller). Previously the resolver was a schema-only stub raising ServiceUnavailable.
  • Resolve the caller's main access key server-side (in the service, from user_uuid via the user repository) instead of passing a hardcoded value from the adapter.
  • Extend the response payload to carry the full remediation breadth the internal data type already exposes: UnschedulableReasonHint.required_container_reduction / image_not_found and ComputeSchedulePayload.resource_group_reason (new GraphQL fields use gql_added_field).

Known limitation (draft)

The end-to-end path is not yet functional at runtime: the compute_schedule service builds a SessionSpecDraft whose scope.domain_id / domain_name / project_id are unset, so the shared SessionSpec finalize validation (session_spec_preparer._finalize) rejects every request with IncompleteSessionSpec before node-fitting runs. These scope fields are consumed only by the enqueue persistence path (scheduler/creators.py) and are dead weight for the DB-mutation-free dry-run. Resolving this (populate scope from the user vs. relax the validation for this path) is deferred and tracked separately; this PR lands the wiring + payload surface.

Test plan

  • pants fmt / fix / lint / check pass
  • GraphQL schema builds; new payload fields (requiredContainerReduction, imageNotFound, resourceGroupReason) exposed in SDL
  • Live GQL query reaches resolver → adapter → service → controller (verified request flow; blocked at the scope validation described above)
  • End-to-end success for admin and non-admin (blocked on the scope limitation above)

Resolves BA-6874

fregataa and others added 2 commits July 14, 2026 23:19
Connect the compute-schedule GraphQL resolver to the session service so
callers can invoke the query end-to-end (resolver -> adapter -> service ->
scheduling controller).

- Session adapter: build ComputeScheduleAction from the input DTO, resolve
  the requesting user from context, and delegate to the processor; map the
  ComputeScheduleResult back onto the response DTO.
- Resolve the caller's main access key in the service from user_uuid
  (via the user repository) instead of threading a hardcoded value.
- Extend the payload to carry the full remediation breadth the data type
  already exposes: UnschedulableReasonHint.required_container_reduction /
  image_not_found and ComputeSchedulePayload.resource_group_reason, using
  gql_added_field for the new GraphQL fields.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@github-actions github-actions Bot added size:L 100~500 LoC comp:manager Related to Manager component comp:common Related to Common component labels Jul 14, 2026
@github-actions github-actions Bot added the area:docs Documentations label Jul 14, 2026
@fregataa fregataa changed the title feat(BA-6874): wire compute-schedule (dry-run) into the API handler feat(BA-6874): wire compute-schedule into the API handler Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:common Related to Common component comp:manager Related to Manager component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant