fix: validate resolved agent definition kinds#9264
Merged
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 21 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
huimiu
marked this pull request as ready for review
July 23, 2026 02:50
huimiu
requested review from
JeffreyCA,
glharper,
hund030,
therealjohn,
trangevi and
trrwilson
as code owners
July 23, 2026 02:50
|
Azure Pipelines: Successfully started running 1 pipeline(s). 21 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Validates resolved agent definition kinds through the shared validator, preventing false passes while preserving workflow support.
Changes:
- Validates non-hosted and hosted resolved definitions consistently.
- Adds inline, referenced, workflow, and doctor regression coverage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
internal/project/agent_definition.go |
Centralizes resolved definition validation. |
internal/project/agent_definition_test.go |
Covers supported and unsupported resolved kinds. |
internal/cmd/doctor/checks_project_test.go |
Verifies doctor rejects invalid inline kinds. |
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
hund030
approved these changes
Jul 23, 2026
Member
Author
|
/check-enforcer override |
huimiu
enabled auto-merge (squash)
July 23, 2026 03:17
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.
Fixes: #9268
Why
Doctor now validates agent services through the shared definition resolver. That resolver returned success for every resolved kind other than
hosted, so an inline or$refdefinition with an unsupported kind could make doctor report a false pass. Validworkflowdefinitions are supported but intentionally remain non-hosted.Approach
Validate resolved non-hosted definitions with the existing agent-definition validator before returning success, while keeping the hosted conversion and service-config validation path unchanged. This keeps supported kinds in one source of truth, preserves workflow behavior, and fixes doctor without adding separate validation logic there.
Regression coverage verifies invalid inline and referenced kinds, valid workflow handling, and doctor's failure result for an invalid inline kind.
Tests
go test ./internal/project ./internal/cmd/doctor