Skip to content

[AIR Validation to Backend] Pre-flight config against ValidateConfig before submit - #6205

Open
riddhibhagwat-db wants to merge 1 commit into
air-clifrom
riddhibhagwat-db/air-validate-config-client
Open

[AIR Validation to Backend] Pre-flight config against ValidateConfig before submit#6205
riddhibhagwat-db wants to merge 1 commit into
air-clifrom
riddhibhagwat-db/air-validate-config-client

Conversation

@riddhibhagwat-db

@riddhibhagwat-db riddhibhagwat-db commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What & why

air run now pre-flights the config against the backend ValidateConfig RPC before uploading anything, so a bad config fails fast with the server's field-level errors instead of after the code snapshot is packaged and uploaded. The same rules back the submit gate, so the pre-flight can't disagree with what submission enforces.

(See 1DD: https://docs.google.com/document/d/1xWKHisVk9YbsnmWyHE1J5OOTZTIHx2DSiyrkuTNM0NA/edit?tab=t.0#heading=h.culzh2kyug09 )

How do you know it works?

validateconfig_test.go covers valid→pass, errors→blocking message (each pointing at its config field), fail-open on both FEATURE_DISABLED and 404, and the request-shape mapping (incl. omitting unset options). The submit acceptance tests (run-submit, run-submit-deps) exercise the pre-flight end-to-end: it fires, is served, and submission proceeds. go test ./experimental/air/... and the air acceptance tests pass.

How to review

  • validateconfig.go: preflightValidate builds the {task, run_options} body from runConfig, POSTs to /api/2.0/ai-training/config:validate (raw client.Do, since the SDK doesn't model AiTrainingService, matching aitraining.go), and renders any FieldErrors.
  • the endpoint is behind a SAFE flag (default off) and older workspaces lack it, so FEATURE_DISABLED / 404 / 501 skip the check and let submission proceed and only a populated error list blocks.
  • runsubmit.go the call is the first thing submitWorkload does, before token/policy resolution and any upload.
  • --dry-run is unchanged since it stays local-only and needs no workspace

`air run` now checks the config server-side before uploading anything, so a bad
config fails fast with the backend's field-level errors instead of after the
code snapshot is packaged and uploaded. The same rules back the submit gate, so
the pre-flight can't disagree with what submission enforces.

Fails open: the endpoint is behind a SAFE flag and older workspaces don't have
it, so a disabled or missing endpoint skips the check and lets submission
proceed (where the config is validated again, authoritatively). Only a populated
error list -- a config the server actively rejected -- blocks.

--dry-run stays local-only and needs no workspace; the pre-flight is on the
submit path, where it saves the wasted upload.
@riddhibhagwat-db riddhibhagwat-db changed the title [air] Pre-flight config against ValidateConfig before submit [AIR Validation to Backend] Pre-flight config against ValidateConfig before submit Aug 7, 2026
@riddhibhagwat-db
riddhibhagwat-db marked this pull request as ready for review August 7, 2026 23:43
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/experimental/air/ - needs approval

Files: acceptance/experimental/air/run-submit-deps/test.toml, acceptance/experimental/air/run-submit/test.toml
Suggested: @vinchenzo-db
Also eligible: @apeforest, @bfontain, @lu-wang-dl, @panchalhp-db, @maggiewang-db, @ben-hansen-db, @pardis-beikzadeh-db

/experimental/air/ - needs approval

4 files changed
Suggested: @vinchenzo-db
Also eligible: @apeforest, @bfontain, @lu-wang-dl, @panchalhp-db, @maggiewang-db, @ben-hansen-db, @pardis-beikzadeh-db

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 3fa0ddb

Run: 31227708272

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 291 1103 3:48
💚​ aws windows 4 4 293 1101 5:42
💚​ azure linux 4 4 290 1103 3:47
💚​ azure windows 4 4 292 1101 5:39
💚​ gcp linux 1 5 291 1103 3:46
💚​ gcp windows 1 5 293 1101 5:58
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
5:47 gcp windows TestAccept
5:31 aws windows TestAccept
5:29 azure windows TestAccept

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.

2 participants