Skip to content

Add typespec sync GH action workflow to automate emitted code merge#37806

Closed
glharper wants to merge 33 commits into
mainfrom
glharper/ai-proj-sync-workflow
Closed

Add typespec sync GH action workflow to automate emitted code merge#37806
glharper wants to merge 33 commits into
mainfrom
glharper/ai-proj-sync-workflow

Conversation

@glharper
Copy link
Copy Markdown
Member

Packages impacted by this PR

Issues associated with this PR

Describe the problem that is addressed by this PR

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

Provide a list of related PRs (if any)

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

glharper and others added 18 commits March 17, 2026 12:34
…ions and related types

- Add getCredentials and pendingUpload operations to beta evaluators
- Add EvaluatorCredentialRequest model type
- Add entry_point and image_tag optional fields to CodeBasedEvaluatorDefinition
- Add merge_prompt.md script for future three-way TypeSpec merges
- Update CHANGELOG.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
### Packages impacted by this PR


### Issues associated with this PR


### Describe the problem that is addressed by this PR


### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
### Packages impacted by this PR


### Issues associated with this PR


### Describe the problem that is addressed by this PR


### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
@glharper glharper requested a review from deyaaeldeen March 24, 2026 15:46
@glharper glharper requested review from a team, bobogogo1990, dargilco and ganeshyb as code owners March 24, 2026 15:46
Copilot AI review requested due to automatic review settings March 24, 2026 15:46
Added comments to clarify workflow requirements and behavior.
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

This PR introduces automation intended to keep a TypeSpec-based SDK in sync with its upstream spec, while also updating @azure/ai-projects to include newly generated/updated API surface (notably beta evaluators and toolsets) and the associated public exports/changelog.

Changes:

  • Added a scheduled + manual GitHub Actions workflow to detect spec repo updates, regenerate the client, and push the result to a target branch.
  • Updated @azure/ai-projects public surface to include new models/operation groups (e.g., beta evaluators credentials/pending upload, beta toolsets) and refreshed generated artifacts.
  • Bumped @azure/ai-projects version and updated the changelog; enabled a previously commented-out streaming test.

Reviewed changes

Copilot reviewed 19 out of 85 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/typespec-sync.yml Adds automation to detect spec changes and regenerate/push updated emitted code.
sdk/ai/ai-projects/package.json Version bump; adds generate:client script and a new devDependency.
sdk/ai/ai-projects/CHANGELOG.md Documents new features for the new version.
sdk/ai/ai-projects/src/index.ts Exposes newly added types and beta operation option types from the public entrypoint.
sdk/ai/ai-projects/src/models/index.ts Re-exports new model types related to toolsets/evaluators.
sdk/ai/ai-projects/src/classic/** Adds beta toolsets operation group wiring and new beta evaluator operations.
sdk/ai/ai-projects/src/api/beta/** Adds new beta toolsets operations + options; extends evaluators operations/options.
sdk/ai/ai-projects/generated/** Adds/updates generated client, helpers, and operation-group implementations.
sdk/ai/ai-projects/review/ai-projects-node.api.md Updates API review surface to reflect new exports/types/operations.
sdk/ai/ai-projects/test/public/agents/bingCustomSearch.spec.ts Re-enables the streaming test case by removing the commented-out it( wrapper.

Comment thread .github/workflows/typespec-sync.yml Outdated
@glharper glharper marked this pull request as draft March 24, 2026 15:55
glharper and others added 2 commits March 24, 2026 12:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@glharper glharper marked this pull request as ready for review March 24, 2026 16:25
@glharper glharper requested review from a team and jeremymeng as code owners March 24, 2026 17:41
Comment thread .github/workflows/typespec-sync.yml Outdated
Comment thread .github/workflows/typespec-sync.yml Outdated
Comment thread .github/workflows/typespec-sync.yml Outdated
Comment thread .github/workflows/typespec-sync.yml Outdated
Comment thread .github/workflows/typespec-sync.yml
glharper and others added 3 commits March 25, 2026 10:55
Co-authored-by: Deyaa <dealmaha@microsoft.com>
Co-authored-by: Deyaa <dealmaha@microsoft.com>
Comment thread .github/workflows/typespec-sync.yml Outdated
API_URL+="&per_page=1"

echo "Querying: $API_URL"
RESPONSE=$(curl -sf "$API_URL")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GH aggressively rate limits anonymous calls to their APIs so this may fail.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's unfortunate for one curl every 24h. What would you suggest?

fetch-depth: 0
persist-credentials: true

node-version: "20.x"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GH Copilot code review told me to make it node v20.

@@ -0,0 +1,182 @@
# Workflow: TypeSpec Sync
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deyaaeldeen this looks to be scoped to just the ai projects do are there plans to do this for other sdks?

@glharper I'm also curious why we are choosing to use this approach over the usual pipeline we use to create PRs when specs change? cc @raych1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deyaaeldeen this looks to be scoped to just the ai projects do are there plans to do this for other sdks?

Not that I am aware of. I am also curious about whether the auto PR pipeline could help here but I am not familiar with it. /cc @MaryGao

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deyaaeldeen this is the JS pipeline. It's used in both the spec PR and release scenarios.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weshaggard This adds the "generate:client" step, where the emitted code is merged with existing custom code. The issue with the "push from TypeSpec repo" approach is that each language has its own approach to dealing with custom code in TypeSpec-based libs, as well as post-emitter steps (dealing with idiosyncratic lang-specific emitter behavior).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate:client step runs 'tsp-client update' which is essentially same as the command - 'tsp-client init --update-if-exists' ran in the pipeline.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we would use tsp-client update for generation and we would also run a series of necessary commands e.g code build, format, sample publish, code snippet update, customization apply etc. Let us know if there are some commands need to tweak.

@glharper glharper closed this Mar 27, 2026
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.

8 participants