Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a85a74c
Go emitter migrate to typespec-azure repo
Jun 15, 2026
318d074
fix lint
Jun 15, 2026
9766f31
Merge remote-tracking branch 'origin/main' into go-migration
Jun 15, 2026
f9acb87
fix(ci-go): quote command substitutions to satisfy shellcheck SC2086
Jun 15, 2026
3c03b63
fix(typespec-go): fix spelling typos and configure cspell
Jun 15, 2026
ff41435
fix(cspell): lowercase Go emitter words for case-insensitive matching
Jun 15, 2026
22d28c5
chore: sync labels for emitter:go
Jun 15, 2026
f184a20
fix(ci-go): use full pnpm install for unit/docs jobs
Jun 15, 2026
2bec532
fix(typespec-go): un-ignore test fixtures required by regenerate
Jun 15, 2026
cbd0588
chore: re-sync labels to align emitter order with eng/config/labels.ts
Jun 15, 2026
8913669
update
Jun 15, 2026
db99e1a
chore: sync CONTRIBUTING.md banner with sync-labels script output
Jun 15, 2026
788114b
feat(typespec-go): auto-sync generated tests with azure-sdk-assets ba…
Jun 15, 2026
dd74d9a
docs(typespec-go): document syncBaseline conflict semantics
Jun 15, 2026
c0e06fa
build: add go to mise tools
Jun 15, 2026
52b6d86
update
Jun 15, 2026
33fbf2f
update lock file
Jun 15, 2026
f521ecb
fix(typespec-go): drop stale source-map-support import
Jun 15, 2026
c92d47b
docs(typespec-go): add development guide
Jun 16, 2026
881fb8f
docs(typespec-go): build via turbo, not tsc directly
Jun 16, 2026
5fd74f2
docs(typespec-go): document installing golangci-lint and shadow locally
Jun 16, 2026
e471cb6
refine doc
Jun 16, 2026
f07167b
update cspell
Jun 16, 2026
81707a2
test(typespec-go): run go tests across local, http-specs, azure-http-…
Jun 16, 2026
8bfba84
fix(typespec-go): discover go tests by module to skip disabled specs
Jun 16, 2026
f1af5c6
test(typespec-go): lint all test roots; drop redundant test-file filter
Jun 16, 2026
9511cbe
refine doc
Jun 16, 2026
f59b155
Use adapted type when adapting a literal enum value
Jun 22, 2026
955ce9a
Merge remote-tracking branch 'origin/main' into go-migration
Jun 25, 2026
992ed89
Merge remote-tracking branch 'origin/main' into go-migration
Jul 1, 2026
483ca99
build: update pnpm-lock.yaml for merged core submodule
Jul 1, 2026
8904cd8
format
Jul 1, 2026
3759486
fix(typespec-go): resolve lint failures (deprecation warnings + OOM)
Jul 1, 2026
8a84128
revert
tadelesh Jul 2, 2026
35af6d2
Merge branch 'main' into go-migration
tadelesh Jul 2, 2026
538e211
fix merge issue
tadelesh Jul 2, 2026
d9cd537
chore: regenerate label policy files via sync-labels
Jul 2, 2026
298a2f7
test(typespec-go): disable armcognitiveservices regen (TCGC override …
Jul 2, 2026
12e847f
Merge remote-tracking branch 'origin/main' into go-migration
Jul 6, 2026
86dd12d
remove all arm tests
Jul 7, 2026
6300d67
ci: migrate sdk-regenerate pipeline from autorest.go
Jul 7, 2026
f63d29b
Revert "ci: migrate sdk-regenerate pipeline from autorest.go"
Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

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.

doesn't need to be part of this PR if the emitter wasn't built to handle it nicely but did you try to add it to the playground as well?

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.

do you mean let playground could review go emitted code? that's not the goal for this pr. we just want to do the migration first before deprecate autorest.go.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@azure-tools/typespec-go"
---

Move `@azure-tools/typespec-go` from `Azure/autorest.go` into `Azure/typespec-azure`. The previously-private workspace packages `@azure-tools/codegen.go`, `@azure-tools/codemodel.go`, and `@azure-tools/naming.go` are now inlined into `src/codegen`, `src/codemodel`, and `src/naming` respectively. No behavior changes for emitter consumers.
21 changes: 21 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup Go
Comment thread
tadelesh marked this conversation as resolved.
description: Setup Go for typespec-go package development and CI
inputs:
go-version:
required: false
description: Go version for setup-go
default: "1.26.1"

runs:
using: composite

steps:
- name: Setup Go ${{ inputs.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
cache: false

- name: Log Go version
shell: bash
run: go version
16 changes: 8 additions & 8 deletions .github/policies/issues.triage.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ configuration:
label: emitter:autorest
- hasLabel:
label: emitter:python
- hasLabel:
label: emitter:typescript
- hasLabel:
label: emitter:go
- hasLabel:
label: emitter:typescript
- hasLabel:
label: emitter:java
- hasLabel:
Expand Down Expand Up @@ -69,10 +69,10 @@ configuration:
label: emitter:autorest
- labelAdded:
label: emitter:python
- labelAdded:
label: emitter:typescript
- labelAdded:
label: emitter:go
- labelAdded:
label: emitter:typescript
- labelAdded:
label: emitter:java
- labelAdded:
Expand Down Expand Up @@ -110,10 +110,10 @@ configuration:
label: emitter:autorest
- labelRemoved:
label: emitter:python
- labelRemoved:
label: emitter:typescript
- labelRemoved:
label: emitter:go
- labelRemoved:
label: emitter:typescript
- labelRemoved:
label: emitter:java
- labelRemoved:
Expand Down Expand Up @@ -142,10 +142,10 @@ configuration:
label: emitter:autorest
- hasLabel:
label: emitter:python
- hasLabel:
label: emitter:typescript
- hasLabel:
label: emitter:go
- hasLabel:
label: emitter:typescript
- hasLabel:
label: emitter:java
- hasLabel:
Expand Down
9 changes: 5 additions & 4 deletions .github/policies/prs.triage.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ configuration:
- if:
- includesModifiedFiles:
files:
- packages/typespec-ts/**/*
- packages/typespec-go/**/*
then:
- addLabel:
label: emitter:typescript
label: emitter:go
- if:
- includesModifiedFiles:
files: []
files:
- packages/typespec-ts/**/*
then:
- addLabel:
label: emitter:go
label: emitter:typescript
- if:
- includesModifiedFiles:
files:
Expand Down
129 changes: 129 additions & 0 deletions .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: "go / test e2e"
Comment thread
tadelesh marked this conversation as resolved.

on:
pull_request:
branches:
- main
- release/*
paths:
- "packages/typespec-go/**"
- ".github/workflows/ci-go.yml"
- ".github/actions/setup-go/**"
merge_group:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: ./.github/actions/setup

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm turbo run --filter "@azure-tools/typespec-go..." build

test:
name: "Mock API Tests (Go ${{ matrix.go-version }})"
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ["1.26.1", "1.25.8"]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: ./.github/actions/setup

- uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.go-version }}

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm turbo run --filter "@azure-tools/typespec-go..." build

- name: Build spector and specs
run: |
pnpm turbo run --filter "@typespec/spector..." build
pnpm --filter "@typespec/http-specs" exec tsc -p ./tsconfig.build.json
pnpm --filter "@azure-tools/azure-http-specs" exec tsc -p ./tsconfig.build.json

- name: Install Go lint tools
run: |
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v2.11.4
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"

- name: Regenerate
run: pnpm run regenerate
working-directory: packages/typespec-go
env:
TYPESPEC_GO_SKIP_BASELINE: "1"

- name: Lint
run: pnpm run lint:go
working-directory: packages/typespec-go

- name: Run Go e2e tests against spector
run: pnpm run test:go:e2e
working-directory: packages/typespec-go

unit:
name: "Unit Tests"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: ./.github/actions/setup

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm turbo run --filter "@azure-tools/typespec-go..." build

- name: Test
run: pnpm run test:ci
working-directory: packages/typespec-go

docs:
name: "Docs Validation"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: ./.github/actions/setup

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm turbo run --filter "@azure-tools/typespec-go..." build

- name: Regenerate emitter docs
run: pnpm run regen-docs
working-directory: packages/typespec-go
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ packages/samples/test/output/azure/templates-contoso/setup.*
packages/typespec-python/tests/generated/**
packages/typespec-python/alpha

# go emitter
packages/typespec-go/test/**/zz_*.go
packages/typespec-go/test/**/go.mod
packages/typespec-go/test/**/go.sum
packages/typespec-go/test/**/LICENSE.txt
packages/typespec-go/test/**/testdata
!packages/typespec-go/test/local/nooptionalbody/testdata/generate/transforms.go
!packages/typespec-go/test/local/rawjson/go.mod
!packages/typespec-go/test/local/rawjson/go.sum
# java emitter
# Emitter TS sources copied from core/packages/http-client-java/emitter at build
# time (only src/options.ts is committed).
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ Area of the codebase
| `lib:azure-http-specs` | #c7aee6 | For issues/prs related to the @azure-tools/typespec-azure-http-specs package |
| `emitter:autorest` | #957300 | Issues for @azure-tools/typespec-autorest emitter |
| `emitter:python` | #957300 | Issues for @azure-tools/typespec-python emitter |
| `emitter:typescript` | #957300 | Issues for @azure-tools/typespec-ts emitter |
| `emitter:go` | #957300 | Issues for @azure-tools/typespec-go emitter |
| `emitter:typescript` | #957300 | Issues for @azure-tools/typespec-ts emitter |
| `emitter:java` | #0096c7 | Issues for @azure-tools/typespec-java emitter |
| `emitter:client:all` | #957300 | General client emitter issues that do not involve TCGC or typespec-azure-http-specs |
| `eng` | #65bfff | |
Expand Down
41 changes: 41 additions & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ ignorePaths:
- "*.lock.yml"
# temp ignore typespec-ts while repo move is inflight
- packages/typespec-ts/**
# Go emitter generated test outputs, synced upstream specs, and build scripts
# contain many Go package / Azure service names that aren't worth maintaining
# in the global dictionary.
- packages/typespec-go/test/**
- packages/typespec-go/temp/**
- packages/typespec-go/.scripts/**
# typespec-java specs and hand-written tests are synced verbatim from
# core / autorest.java; don't spell-check upstream-sourced content.
- packages/typespec-java/emitter-tests/tsp/**
Expand Down Expand Up @@ -115,3 +121,38 @@ words:
- petstoreopgrp
- pypi
- Tsps
# Go emitter
- addl
- azfake
- azidentity
- errorf
- fatalf
- gomod
- gopath
- polymorphics
- respr
- retriable
- unmarshaller
- unmarshallers
- unmarshalling
- unpopulate
- ervices
- lient
- onfig
- ossible
- pchars
- sliceof
- tcgcadapter
- uninstantiable
- unmarshalled
- cmplx
- fcgi
- flate
- gofmt
- golangci
- gomodtidy
- gosym
- iotest
- mbcs
- msan
- pkix
10 changes: 5 additions & 5 deletions eng/config/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ export const AreaLabels = defineLabels({
color: "957300",
description: "Issues for @azure-tools/typespec-python emitter",
},
"emitter:typescript": {
color: "957300",
description: "Issues for @azure-tools/typespec-ts emitter",
},
"emitter:go": {
color: "957300",
description: "Issues for @azure-tools/typespec-go emitter",
},
"emitter:typescript": {
color: "957300",
description: "Issues for @azure-tools/typespec-ts emitter",
},
"emitter:java": {
color: "0096c7",
description: "Issues for @azure-tools/typespec-java emitter",
Expand Down Expand Up @@ -79,8 +79,8 @@ export const AreaPaths: Record<keyof typeof AreaLabels, string[]> = {
"lib:azure-resource-manager": ["packages/typespec-azure-resource-manager/"],
"emitter:autorest": ["packages/typespec-autorest/"],
"emitter:python": ["packages/typespec-python/"],
"emitter:go": ["packages/typespec-go/"],
"emitter:typescript": ["packages/typespec-ts/"],
"emitter:go": [],
"emitter:java": ["packages/typespec-java/"],
"lib:tcgc": ["packages/typespec-client-generator-core/"],
"lib:azure-http-specs": ["packages/azure-http-specs/"],
Expand Down
20 changes: 20 additions & 0 deletions eng/pipelines/jobs/build-for-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,25 @@ jobs:
PackagePath: packages/typespec-python
GeneratorName: "@azure-tools/typespec-python"

# Go e2e tests and spector coverage upload
- task: GoTool@0
displayName: "Use Go 1.26.1"
inputs:
version: "1.26.1"

- script: pnpm run regenerate
displayName: "Regenerate Go test code"
workingDirectory: packages/typespec-go

- script: pnpm run test:go:e2e
displayName: "Run Go e2e tests"
workingDirectory: packages/typespec-go

- template: /eng/pipelines/templates/upload-spector-coverage.yml
parameters:
PackagePath: packages/typespec-go
GeneratorName: "@azure-tools/typespec-go"

# Java e2e tests and spector coverage upload. The emitter-tests project is a
# standalone npm+Maven project (not in the pnpm workspace). The emitter + its
# dependencies are already built by the repo-wide `pnpm build` above, so pass
Expand All @@ -59,6 +78,7 @@ jobs:
parameters:
PackagePath: packages/typespec-java/emitter-tests
GeneratorName: "@azure-tools/typespec-java"

# TypeScript (typespec-ts) e2e tests and spector coverage upload.
# The emitter was migrated here from Azure/autorest.typescript; this replaces
# the coverage upload that previously ran in that (now deprecated) repo.
Expand Down
1 change: 1 addition & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tools]
python = "3.12"
uv = "latest"
go = "1.26.1"
java = "microsoft-11"
maven = "3.9.16"
Loading
Loading