Skip to content

Add agentic workflow to auto-bump TCGC for http-client-csharp#10014

Draft
Copilot wants to merge 8 commits intomainfrom
copilot/create-agentic-workflow-tcgc-upgrade
Draft

Add agentic workflow to auto-bump TCGC for http-client-csharp#10014
Copilot wants to merge 8 commits intomainfrom
copilot/create-agentic-workflow-tcgc-upgrade

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

Adds a daily GitHub Agentic Workflow that checks for new stable releases of @azure-tools/typespec-client-generator-core and opens a PR to upgrade http-client-csharp when one is found.

  • Trigger: schedule: daily with workflow_dispatch for manual runs — checks npm for the latest non-dev TCGC version
  • Duplicate PR detection: Searches for any existing open PR targeting the same TCGC version with the emitter:client:csharp label before proceeding; exits without creating a new PR if one already exists
  • No-op when current: Compares against devDependencies in packages/http-client-csharp/package.json; exits without creating a PR if already up to date
  • Upgrade delegation: Reads and follows the step-by-step migration instructions defined in .github/prompts/upgrade-tcgc.instructions.md, which handles dependency synchronization, peer resolution, build validation, and test regeneration
  • Safe outputs: Restricted to create-pull-request only with draft: true, protected-files: fallback-to-issue; read-all permissions; no explicit labels (repo applies them automatically)
  • Frontmatter format: Follows the canonical format from githubnext/agentics samples — includes name, description, network, timeout-minutes, edit:, and bash: true
  • Lock file: Includes the compiled bump-tcgc-csharp.lock.yml generated by gh aw compile, along with a .gitattributes entry marking *.lock.yml as linguist-generated=true merge=ours

This replaces the manual process of filing an issue + assigning Copilot for each TCGC patch/minor bump (e.g. commits 458f881, f3bdd60).

Original prompt

This section details on the original issue you should resolve

<issue_title>Create an Agentic Workflow to Automatically Upgrade TCGC Dependency for the http-client-csharp package</issue_title>
<issue_description>We should look into creating a new agentic workflow that automates the version bump process for tcgc. The workflow should run once a day and check if a new non-dev tcgc version is available at https://www.npmjs.com/package/@azure-tools/typespec-client-generator-core and if that version is newer than the one used in http-client-csharp. If there is no new version, no PR should be opened. If there is a new version, then a PR should be opened with the code updates. Some examples of this being done previously:

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot AI changed the title [WIP] Create agentic workflow for tcgc dependency upgrade Add agentic workflow to auto-bump TCGC for http-client-csharp Mar 12, 2026
Copilot AI requested a review from jorgerangel-msft March 12, 2026 21:16
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
@@ -0,0 +1,98 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot address the feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the compiled lock file in 03d9e23 by running gh aw compile. This also added a .gitattributes entry to mark *.lock.yml files as linguist-generated=true merge=ours.

Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot what does the gitattributes addition do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The .gitattributes entry .github/workflows/*.lock.yml linguist-generated=true merge=ours was added automatically by gh aw compile. It does two things:

  1. linguist-generated=true — tells GitHub's Linguist that lock files are machine-generated, so they won't count toward language statistics and will be collapsed by default in PR diffs.
  2. merge=ours — during git merges, always keeps "our" version of the lock file to prevent merge conflicts on the auto-generated content.

This entry was added by the gh aw compile tool itself, not manually.

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • github.github.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • github.github.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh auth status (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.57.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.57.2 --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw/releases/latest
    • Triggering command: /usr/bin/gh gh extension install github/gh-aw (http block)

If you need me to access, download, or install something from one of these locations, you can either:

timeout-minutes: 30

safe-outputs:
create-pull-request:
Copy link
Member

Choose a reason for hiding this comment

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

@jorgerangel-msft before you spend too much time on this, currently github actions in microsoft repos are not allowed to create PRs, see Timo's post in the ai discussion

Copy link
Contributor

Choose a reason for hiding this comment

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

@timotheeguerin thanks for the heads up, I wasn't aware. I'll table this for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create an Agentic Workflow to Automatically Upgrade TCGC Dependency for the http-client-csharp package

3 participants