Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fixtures
specification

# unmanaged files and folders
**/*instructions.md
copilot-instructions.md
chatmodes
ISSUE_TEMPLATE
policies
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-node-install-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
using: "composite"

steps:
- uses: actions/setup-node@v6
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

Expand Down
7 changes: 1 addition & 6 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ Run [check package readiness](../eng/common/instructions/azsdk-tools/check-packa

Follow [typespec docs](../eng/common/instructions/azsdk-tools/typespec-docs.instructions.md) to get the most up-to-date documentation for TypeSpec, including best practices for writing TypeSpec for Azure.

# ARM Api Copilot Review Instructions

Follow [armapi-review.instructions.md](./instructions/armapi-review.instructions.md) and [openapi-review.instructions.md](./instructions/openapi-review.instructions.md) for instructions to review ARM API specifications. Github Code review agent must prioritize these instructions over any other instruction files while performing code reviews.


<!-- LINKS -->

[contoso-widget-manager]: ../specification/contosowidgetmanager/Contoso.WidgetManager/
Expand All @@ -42,4 +37,4 @@ Follow [armapi-review.instructions.md](./instructions/armapi-review.instructions
[ci-fix]: ../documentation/ci-fix.md
[url-type]: https://typespec.io/docs/language-basics/built-in-types#string-types
[no-enum]: https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-enum
[typespec-structure-guidelines]: ../documentation/typespec-structure-guidelines.md
[typespec-structure-guidelines]: ../documentation/typespec-structure-guidelines.md
367 changes: 107 additions & 260 deletions .github/instructions/armapi-review.instructions.md

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions .github/instructions/github-codingagent.instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
excludeAgent: "code-review"
---

# Run SDK generation using pipeline in GitHub coding agent

Run only SDK generation using pipeline and do not run SDK generation using local SDK generation tools. This is applicable only when GitHub copilot coding agent is used to generate SDK and if a Release Plan is available in the context. Run SDK generation tool even if release plan already has SDK generation pipeline URL to support regenerating SDK. Coding agent must wait until all SDK generation pipeline are in completed status and then fetch the SDK details from pipeline run. This is applicable only when a GitHub issue is assigned to GitHub coding agent to generate SDK from a TypeSpec project. This is not applicable when running Copilot from Visual Studio and VS Code.
Expand Down
4 changes: 0 additions & 4 deletions .github/instructions/language-emitter.instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
applyTo: "specification/**/tspconfig.yaml"
---

Use this guidance whenever someone needs to add language emitters to an existing `tspconfig.yaml`, or when SDK generation fails because an emitter block is missing.

- Decide whether the service is ARM or data-plane.
Expand Down
346 changes: 21 additions & 325 deletions .github/instructions/openapi-review.instructions.md

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions .github/instructions/sdk-generation.instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
excludeAgent: "code-review"
---

## Prerequisites

- run `npm ci` to install the dependencies
Expand Down
4 changes: 0 additions & 4 deletions .github/instructions/typespec-project.instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
excludeAgent: "code-review"
---

Before creating or initializing a TypeSpec project, you must know your org name, service name, and the type of service: data-plane or control-plane (ARM).

Then create a new project directory under the `specification/<orgName>/resource-manager/<RPNamespace>/<ServiceName>` or `specification/<orgName>/data-plane/<ServiceName>` path, following the guidelines below.
Expand Down
6 changes: 3 additions & 3 deletions .github/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .github/shared/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 3 additions & 26 deletions .github/shared/src/changed-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,13 @@ const exampleCache = new KeyedCache();
* @param {Object} [options]
* @param {string} [options.baseCommitish] Default: "HEAD^".
* @param {string} [options.cwd] Current working directory. Default: process.cwd().
* @param {string[]} [options.gitOptions] Additional git options to pass to git diff command. Example: ["--no-renames"]. Default: []
* @param {string} [options.headCommitish] Default: "HEAD".
* @param {import('./logger.js').ILogger} [options.logger]
* @param {string[]} [options.paths] Limits the diff to the named paths. If not set, includes all paths in repo. Default: []
* @returns {Promise<string[]>} List of changed files, using posix paths, relative to repo root. Example: ["specification/foo/Microsoft.Foo/main.tsp"].
*/
export async function getChangedFiles(options = {}) {
const {
baseCommitish = "HEAD^",
cwd,
gitOptions = [],
headCommitish = "HEAD",
logger,
paths = [],
} = options;
const { baseCommitish = "HEAD^", cwd, headCommitish = "HEAD", logger, paths = [] } = options;

if (paths.length > 0) {
// Use "--" to separate paths from revisions
Expand All @@ -43,13 +35,7 @@ export async function getChangedFiles(options = {}) {
// { name: "/foo/baz.js", status: Status.Renamed, previousName: "/foo/bar.js"}.
// Then add filter functions to filter based on status. This is more flexible and lets consumers
// filter based on status with a single call to `git diff`.
const result = await simpleGit(cwd).diff([
"--name-only",
...gitOptions,
baseCommitish,
headCommitish,
...paths,
]);
const result = await simpleGit(cwd).diff(["--name-only", baseCommitish, headCommitish, ...paths]);

const files = result
.trim()
Expand All @@ -73,21 +59,13 @@ export async function getChangedFiles(options = {}) {
* @param {Object} [options]
* @param {string} [options.baseCommitish] Default: "HEAD^".
* @param {string} [options.cwd] Current working directory. Default: process.cwd().
* @param {string[]} [options.gitOptions] Additional git options to pass to git diff command. Example: ["--no-renames"]. Default: []
* @param {string} [options.headCommitish] Default: "HEAD".
* @param {import('./logger.js').ILogger} [options.logger]
* @param {string[]} [options.paths] Limits the diff to the named paths. If not set, includes all paths in repo. Default: []
* @returns {Promise<{additions: string[], modifications: string[], deletions: string[], renames: {from: string, to: string}[], total: number}>}
*/
export async function getChangedFilesStatuses(options = {}) {
const {
baseCommitish = "HEAD^",
cwd,
gitOptions = [],
headCommitish = "HEAD",
logger,
paths = [],
} = options;
const { baseCommitish = "HEAD^", cwd, headCommitish = "HEAD", logger, paths = [] } = options;

if (paths.length > 0) {
// Use "--" to separate paths from revisions
Expand All @@ -96,7 +74,6 @@ export async function getChangedFilesStatuses(options = {}) {

const result = await simpleGit(cwd).diff([
"--name-status",
...gitOptions,
baseCommitish,
headCommitish,
...paths,
Expand Down
58 changes: 0 additions & 58 deletions .github/shared/test/changed-files.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,6 @@ describe("changedFiles", () => {
expect(mockDiff).toHaveBeenCalledWith(["--name-only", "HEAD^", "HEAD"]);
});

it("getChangedFiles accepts gitOptions parameter", async () => {
const files = ["file1.json", "file2.json"];
mockDiff.mockResolvedValue(files.join("\n"));

await expect(getChangedFiles({ gitOptions: ["--no-renames"] })).resolves.toEqual(files);
expect(mockDiff).toHaveBeenCalledWith(["--name-only", "--no-renames", "HEAD^", "HEAD"]);
});

it("getChangedFiles accepts multiple gitOptions", async () => {
const files = ["file1.json"];
mockDiff.mockResolvedValue(files.join("\n"));

await expect(
getChangedFiles({ gitOptions: ["--no-renames", "--find-copies"] }),
).resolves.toEqual(files);
expect(mockDiff).toHaveBeenCalledWith([
"--name-only",
"--no-renames",
"--find-copies",
"HEAD^",
"HEAD",
]);
});

const files = [
"CONTRIBUTING.MD",
"cspell.json",
Expand Down Expand Up @@ -405,39 +381,5 @@ describe("changedFiles", () => {
expect(simpleGit.simpleGit).toHaveBeenCalledWith("/custom/path");
expect(mockDiff).toHaveBeenCalledWith(["--name-status", "origin/main", "feature-branch"]);
});

it("should accept gitOptions parameter", async () => {
mockDiff.mockResolvedValue("A\tfile1.json\nM\tfile2.json");
const result = await getChangedFilesStatuses({ gitOptions: ["--no-renames"] });
expect(result).toEqual({
additions: ["file1.json"],
modifications: ["file2.json"],
deletions: [],
renames: [],
total: 2,
});
expect(mockDiff).toHaveBeenCalledWith(["--name-status", "--no-renames", "HEAD^", "HEAD"]);
});

it("should accept multiple gitOptions", async () => {
mockDiff.mockResolvedValue("A\tfile1.json");
const result = await getChangedFilesStatuses({
gitOptions: ["--no-renames", "--find-copies"],
});
expect(result).toEqual({
additions: ["file1.json"],
modifications: [],
deletions: [],
renames: [],
total: 1,
});
expect(mockDiff).toHaveBeenCalledWith([
"--name-status",
"--no-renames",
"--find-copies",
"HEAD^",
"HEAD",
]);
});
});
});
2 changes: 1 addition & 1 deletion .github/workflows/_reusable-set-check-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
((github.event.action == 'labeled' || github.event.action == 'unlabeled') &&
inputs.overriding_label && contains(inputs.overriding_label, github.event.label.name))))

runs-on: ubuntu-slim
runs-on: ubuntu-24.04

steps:
# *** IMPORTANT ***
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/arm-auto-signoff-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
github.event.label.name == 'NotReadyForARMReview' ||
github.event.label.name == 'SuppressionReviewRequired'))

runs-on: ubuntu-slim
runs-on: ubuntu-24.04

steps:
# *** IMPORTANT ***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
breaking-change-add-label-artifacts:
name: "Breaking Change - Add Label Artifacts"

runs-on: ubuntu-slim
runs-on: ubuntu-24.04

steps:
# *** IMPORTANT ***
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-apiview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
jobs:
post-apiview:
name: After APIView
runs-on: ubuntu-slim
runs-on: ubuntu-24.04
if: |
github.event.check_run.check_suite.app.name == 'Azure Pipelines' && (
contains(github.event.check_run.name, 'APIView') ||
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/protected-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
protected-files:
name: Protected Files

runs-on: ubuntu-slim
runs-on: ubuntu-24.04

steps:
# Since check is required, the job must pass instead of being skipped
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sdk-breaking-change-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
github.event.check_run.check_suite.app.name == 'Azure Pipelines' &&
contains(github.event.check_run.name, 'SDK Validation')
name: SDK Breaking Change Labels
runs-on: ubuntu-slim
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spec-gen-sdk-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
github.event.check_run.check_suite.app.name == 'Azure Pipelines' &&
contains(github.event.check_run.name, 'SDK Validation')
name: "SDK Validation Status"
runs-on: ubuntu-slim
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
jobs:
spellcheck:
name: SpellCheck
runs-on: ubuntu-slim
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
Expand Down
20 changes: 3 additions & 17 deletions .github/workflows/src/arm-auto-signoff/pr-changes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ export class PullRequestChanges {
/** @type {boolean} */
rmExamples = false;

/** @type {boolean} */
rmTypeSpec = false;

/** @type {boolean} */
rmFunctional = false;

Expand All @@ -24,7 +21,6 @@ export class PullRequestChanges {
* A PR is trivial if it contains only:
* - Documentation changes
* - Example changes
* - TypeSpec file changes (.tsp, tspconfig.yaml)
* and does NOT contain:
* - Functional spec changes
* - Other file types
Expand All @@ -33,7 +29,7 @@ export class PullRequestChanges {
*/
isTrivial() {
const hasNoBlockingChanges = !this.rmFunctional && !this.rmOther && !this.other;
const hasTrivialChanges = this.rmDocumentation || this.rmExamples || this.rmTypeSpec;
const hasTrivialChanges = this.rmDocumentation || this.rmExamples;
return hasNoBlockingChanges && hasTrivialChanges;
}

Expand All @@ -42,12 +38,7 @@ export class PullRequestChanges {
*/
isDocumentationOnly() {
return (
this.rmDocumentation &&
!this.rmExamples &&
!this.rmTypeSpec &&
!this.rmFunctional &&
!this.rmOther &&
!this.other
this.rmDocumentation && !this.rmExamples && !this.rmFunctional && !this.rmOther && !this.other
);
}

Expand All @@ -56,12 +47,7 @@ export class PullRequestChanges {
*/
isExamplesOnly() {
return (
!this.rmDocumentation &&
this.rmExamples &&
!this.rmTypeSpec &&
!this.rmFunctional &&
!this.rmOther &&
!this.other
!this.rmDocumentation && this.rmExamples && !this.rmFunctional && !this.rmOther && !this.other
);
}
}
Loading