Skip to content

feat(routines): align with azure-rest-api-specs PR #43498#8430

Merged
trangevi merged 4 commits into
mainfrom
huimiu/routines-api-updates
May 28, 2026
Merged

feat(routines): align with azure-rest-api-specs PR #43498#8430
trangevi merged 4 commits into
mainfrom
huimiu/routines-api-updates

Conversation

@huimiu
Copy link
Copy Markdown
Member

@huimiu huimiu commented May 28, 2026

Summary

Refresh the azure.ai.routines extension to match the Foundry Routines TypeSpec from azure-rest-api-specs PR #43498. The spec PR touches models.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

  • Triggers
    • github_issue: assigneeowner; new required issue_event (opened/closed).
    • New custom trigger (provider, event_name, parameters: map<string,any>).
    • timer no longer carries time_zone (still valid on schedule).
  • Actions
    • conversation_idconversation (wire field only — CLI flag stays --conversation-id).
    • Both invoke_agent_responses_api and invoke_agent_invocations_api now share agent_name? / agent_endpoint_id? (mutually exclusive) and a new static input?: any.
  • RoutineRun gained trigger_name, agent_id, agent_endpoint_id, conversation_id, session_id, scheduled_fire_at, and error_status_code. The legacy diagnostics block is gone.
  • Routines list response: nextLinkcontinuationToken. Run-history list stays on nextPageToken but the client now sends limit/after (was maxResults/pageToken) to match the spec.
  • Dispatch payload input widened from string to any JSON value.

CLI surface

  • routine create / routine update: new triggers exposed via flags
    • --trigger github-issue with --connection-id, --owner, --repository, --issue-event.
    • --trigger custom with --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

  • All renames are wire-only; user-facing CLI flag names (e.g. --conversation-id) are preserved.
  • Manifest files (--file) with the new github_issue / custom shapes round-trip cleanly through merge/overwrite.

Validation

  • go build ./...
  • go test ./... (existing tests updated + new tests for PagedRoutine.continuationToken, dispatch input: any, new RoutineRun fields, github-issue / custom CLI paths, and parseDispatchInput cases)
  • go vet ./...
  • golangci-lint run ./...
  • cspell (no new warnings)
  • Bumped extension.yaml and version.txt to 0.0.2-preview; added a CHANGELOG.md entry.
  • Refreshed AGENTS.md to point at PR #43498 and reflect the updated divergence story.

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
@github-actions github-actions Bot added the ext-agents azure.ai.{agents,connections,inspector,projects,routines,skills,toolboxes} extensions label May 28, 2026
@huimiu huimiu requested a review from Copilot May 28, 2026 12:28
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

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 routines package models (triggers, actions, paging, run record) and renamed wire fields (conversation_idconversation, nextLinkcontinuationToken).
  • Reworked client pagination to use limit/after; removed validateSameOrigin since pagination URLs are now built locally.
  • Reorganized create/update CLI flags and validation around the new github-issue and custom triggers; dispatch --input now 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.

@huimiu huimiu marked this pull request as ready for review May 28, 2026 12:54
@huimiu huimiu changed the title feat(ext/routines): align with azure-rest-api-specs PR #43498 feat(routines): align with azure-rest-api-specs PR #43498 May 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Review may take a bit longer — reach out to @rajeshkamal5050 or @kristenwomack if you'd like to discuss prioritization.

huimiu added 2 commits May 28, 2026 20:57
…-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.
@github-actions
Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Review may take a bit longer — reach out to @rajeshkamal5050 or @kristenwomack if you'd like to discuss prioritization.

Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi
Copy link
Copy Markdown
Member

/check-enforcer override

@trangevi trangevi enabled auto-merge (squash) May 28, 2026 17:10
@trangevi trangevi merged commit 1e9fb34 into main May 28, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.{agents,connections,inspector,projects,routines,skills,toolboxes} extensions

Projects

None yet

4 participants