feat(routines): align with azure-rest-api-specs PR #43498#8430
Conversation
Refresh the Foundry Routines data-plane client and CLI to match the latest TypeSpec contracts from azure-rest-api-specs PR #43498. Wire model changes: - github_issue trigger: assignee -> owner, add required issue_event - New custom trigger (provider/event_name/parameters) - Drop time_zone from timer triggers (still valid for schedule) - RoutineAction: rename conversation_id -> conversation - Both action variants now share agent_name/agent_endpoint_id, plus a new static input (any JSON value) - RoutineRun: add trigger_name, agent_id, agent_endpoint_id, conversation_id, session_id, scheduled_fire_at, error_status_code; drop diagnostics - Routines list response: nextLink -> continuationToken - Run-history list: align query params with spec (maxResults -> limit, pageToken -> after) - Dispatch payload input widened to any JSON value CLI surface: - routine create/update: new --trigger github-issue (with --connection-id, --owner, --repository, --issue-event) and --trigger custom (with --provider, --event-name, --parameters) - routine dispatch --input: auto-detect JSON literals; otherwise pass through as a plain string - routine show: render the new fields in the summary table Docs: - Bump AGENTS.md spec reference to PR #43498 and update the divergence table - CHANGELOG: add 0.0.2-preview entry - Bump extension.yaml and version.txt to 0.0.2-preview
There was a problem hiding this comment.
Pull request overview
Aligns the azure.ai.routines extension with the updated Foundry Routines TypeSpec (azure-rest-api-specs PR #43498): updates wire models, paginates list APIs with limit/after, replaces the old assignee github_issue trigger with owner/issue_event, adds a new custom trigger, and exposes both via the CLI. Bumps version to 0.0.2-preview and refreshes docs/tests.
Changes:
- Updated
routinespackage models (triggers, actions, paging, run record) and renamed wire fields (conversation_id→conversation,nextLink→continuationToken). - Reworked client pagination to use
limit/after; removedvalidateSameOriginsince pagination URLs are now built locally. - Reorganized create/update CLI flags and validation around the new
github-issueandcustomtriggers; dispatch--inputnow accepts any JSON.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/pkg/routines/models.go | New trigger/action fields, Input any, continuationToken, expanded RoutineRun. |
| internal/pkg/routines/models_test.go | New tests for paging, Input any, new RoutineRun fields, github-issue and custom triggers. |
| internal/pkg/routines/client.go | Switches list paging to limit/after; removes validateSameOrigin helper. |
| internal/cmd/routine_create.go | Adds github-issue/custom triggers, agent-invoke now accepts agent-name, rejects time-zone for timer. |
| internal/cmd/routine_create_test.go | Updated/expanded create-path tests. |
| internal/cmd/routine_update.go | Switches applyUpdateFlags to struct arg; adds github-issue/custom update flags. |
| internal/cmd/routine_manifest.go | New routineUpdateChanges struct and trigger-type-aware validation/updates. |
| internal/cmd/routine_manifest_test.go | Tests for new struct-based update flow, github-issue/custom updates. |
| internal/cmd/routine_dispatch.go | Adds parseDispatchInput for JSON auto-detection on --input. |
| internal/cmd/routine_dispatch_test.go | New tests for parseDispatchInput. |
| internal/cmd/routine_helpers.go | Routine summary table renders new trigger/action fields. |
| extension.yaml, version.txt | Bump to 0.0.2-preview. |
| CHANGELOG.md, AGENTS.md | Document the spec realignment. |
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
…-map serialization
- Change RoutineTrigger.Parameters from map[string]any to *map[string]any so
that an empty map serializes as {} rather than being dropped by omitempty.
nil still omits the field for non-custom trigger types.
- Require --parameters in buildTrigger for the 'custom' case (spec field
CustomRoutineTrigger.parameters is required, not optional).
- Update applyUpdateFlags and routine_helpers display to use the pointer type.
- Add TestBuildTrigger_CustomMissingParameters test.
- Fix all test map-access sites to dereference the pointer.
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
Signed-off-by: trangevi <trangevi@microsoft.com>
|
/check-enforcer override |
Summary
Refresh the
azure.ai.routinesextension to match the Foundry Routines TypeSpec from azure-rest-api-specs PR #43498. The spec PR touchesmodels.tsp+ regenerated OpenAPI only; this PR aligns the Go data-plane client and CLI surface to the new wire shapes and also fixes pre-existing run-history pagination drift in the same pass.Wire model changes
github_issue:assignee→owner; new requiredissue_event(opened/closed).customtrigger (provider,event_name,parameters: map<string,any>).timerno longer carriestime_zone(still valid onschedule).conversation_id→conversation(wire field only — CLI flag stays--conversation-id).invoke_agent_responses_apiandinvoke_agent_invocations_apinow shareagent_name?/agent_endpoint_id?(mutually exclusive) and a new staticinput?: any.RoutineRungainedtrigger_name,agent_id,agent_endpoint_id,conversation_id,session_id,scheduled_fire_at, anderror_status_code. The legacydiagnosticsblock is gone.nextLink→continuationToken. Run-history list stays onnextPageTokenbut the client now sendslimit/after(wasmaxResults/pageToken) to match the spec.inputwidened fromstringto any JSON value.CLI surface
routine create/routine update: new triggers exposed via flags--trigger github-issuewith--connection-id,--owner,--repository,--issue-event.--trigger customwith--provider,--event-name,--parameters(JSON object literal).routine dispatch --input: auto-detect JSON — if the value parses as JSON it is forwarded as that JSON value (object/array/scalar/null); otherwise it is forwarded as a plain string. Existing scripts that pass plain text keep working.routine show: summary table now renders the new trigger and action fields.Compatibility
--conversation-id) are preserved.--file) with the newgithub_issue/customshapes round-trip cleanly through merge/overwrite.Validation
go build ./...go test ./...(existing tests updated + new tests forPagedRoutine.continuationToken, dispatchinput: any, newRoutineRunfields, github-issue / custom CLI paths, andparseDispatchInputcases)go vet ./...golangci-lint run ./...cspell(no new warnings)extension.yamlandversion.txtto0.0.2-preview; added aCHANGELOG.mdentry.AGENTS.mdto point at PR #43498 and reflect the updated divergence story.