Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyze change ts #3415

Merged
merged 29 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9cc8c63
Initial
timotheeguerin May 21, 2024
5b97e83
Convert analyze to TS
timotheeguerin May 21, 2024
3a12323
Extra steps
timotheeguerin May 21, 2024
a59a8b7
Run
timotheeguerin May 21, 2024
7cb87e8
Fix
timotheeguerin May 21, 2024
13846b5
.
timotheeguerin May 21, 2024
7013d85
Std out write
timotheeguerin May 21, 2024
4c43771
test
timotheeguerin May 21, 2024
653e66b
Fix
timotheeguerin May 21, 2024
1299917
Tweaks
timotheeguerin May 21, 2024
6ff90f0
Add tests
timotheeguerin May 21, 2024
c87669a
fix
timotheeguerin May 21, 2024
3b7f1fc
Update eng/common/pipelines/ci.yml
timotheeguerin May 24, 2024
c795842
Merge branch 'main' of https://github.com/Microsoft/typespec into ana…
timotheeguerin May 24, 2024
08d63ff
Merge branch 'analyze-change-ts' of https://github.com/timotheeguerin…
timotheeguerin May 24, 2024
364a31b
Fix
timotheeguerin May 24, 2024
c6ca3f2
don't bump other deps
timotheeguerin May 24, 2024
7527bdc
fix
timotheeguerin May 24, 2024
a8b9f34
Merge branch 'main' of https://github.com/Microsoft/typespec into ana…
timotheeguerin Jul 24, 2024
d1d2c46
update
timotheeguerin Jul 25, 2024
dbf361f
update lock
timotheeguerin Jul 25, 2024
a598eb5
Move config around
timotheeguerin Jul 25, 2024
b5d6306
Merge branch 'main' of https://github.com/Microsoft/typespec into ana…
timotheeguerin Jul 25, 2024
a187dec
merge
timotheeguerin Jul 25, 2024
c3e503d
Add doc
timotheeguerin Jul 25, 2024
349b4c1
Add test and fix typo in `eng/emitter`
timotheeguerin Jul 25, 2024
cb949aa
Add more test and remove unused ps1 scripts
timotheeguerin Jul 26, 2024
96c6ea4
Merge branch 'main' into analyze-change-ts
timotheeguerin Jul 26, 2024
0f3f08d
Merge branch 'main' into analyze-change-ts
timotheeguerin Jul 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions eng/common/config/area.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { AreaLabels } from "./labels.js";

/**
* Set the paths that each area applies to.
*/
export const AreaPaths: Record<keyof typeof AreaLabels, string[]> = {
"compiler:core": ["packages/compiler/"],
"compiler:emitter-framework": [],
ide: ["packages/typespec-vscode/", "packages/typespec-vs/"],
"lib:http": ["packages/http/"],
"lib:openapi": ["packages/openapi/"],
"lib:rest": ["packages/rest/"],
"lib:versioning": ["packages/versioning/"],
"meta:blog": ["blog/"],
"meta:website": ["website/"],
tspd: ["packages/tspd/"],
"emitter:client:csharp": ["packages/http-client-csharp/"],
"emitter:client:java": ["packages/http-client-java/"],
"emitter:json-schema": ["packages/json-schema/"],
"emitter:protobuf": ["packages/protobuf/"],
"emitter:openapi3": ["packages/openapi3/"],
"openapi3:converter": ["packages/openapi3/src/cli/actions/convert/"],
"emitter:service:csharp": [],
"emitter:service:js": [],
eng: ["eng/", ".github/"],
"ui:playground": ["packages/playground/"],
"ui:type-graph-viewer": ["packages/html-program-viewer/"],
};

/**
* Path that should trigger every CI build.
*/
const all = ["eng/common/", "vitest.config.ts"];

/**
* Path that should trigger all isolated emitter builds
*/
const isolatedEmitters = ["eng/emitters/"];

export const CIRules = {
CSharp: [...all, ...isolatedEmitters, ...AreaPaths["emitter:client:csharp"], ".editorconfig"],

Core: [
"**/*",
"!.prettierignore", // Prettier is already run as its dedicated CI(via github action)
"!.prettierrc.json",
"!cspell.yaml", // CSpell is already run as its dedicated CI(via github action)
"!esling.config.json", // Eslint is already run as its dedicated CI(via github action)
...ignore(isolatedEmitters),
...ignore(AreaPaths["emitter:client:csharp"]),
],
};

function ignore(paths: string[]) {
return paths.map((x) => `!${x}`);
}
30 changes: 2 additions & 28 deletions eng/common/config/labels.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// cspell:ignore bfff
import { repo } from "../scripts/common.js";
import { defineConfig, defineLabels } from "../scripts/labels/config.js";
import { repo } from "../scripts/utils/common.js";
import { AreaPaths } from "./area.js";

/**
* Labels that are used to categorize issue for which area they belong to.
Expand Down Expand Up @@ -166,33 +167,6 @@ export const CommonLabels = {
},
};

/**
* Set the paths that each area applies to.
*/
export const AreaPaths: Record<keyof typeof AreaLabels, string[]> = {
"compiler:core": ["packages/compiler/"],
"compiler:emitter-framework": [],
ide: ["packages/typespec-vscode/", "packages/typespec-vs/"],
"lib:http": ["packages/http/"],
"lib:openapi": ["packages/openapi/"],
"lib:rest": ["packages/rest/"],
"lib:versioning": ["packages/versioning/"],
"meta:blog": ["blog/"],
"meta:website": ["website/"],
tspd: ["packages/tspd/"],
"emitter:client:csharp": ["packages/http-client-csharp/"],
"emitter:client:java": ["packages/http-client-java/"],
"emitter:json-schema": ["packages/json-schema/"],
"emitter:protobuf": ["packages/protobuf/"],
"emitter:openapi3": ["packages/openapi3/"],
"openapi3:converter": ["packages/openapi3/src/cli/actions/convert/"],
"emitter:service:csharp": [],
"emitter:service:js": [],
eng: ["eng/", ".github/"],
"ui:playground": ["packages/playground/"],
"ui:type-graph-viewer": ["packages/html-program-viewer/"],
};

export default defineConfig({
repo,
labels: {
Expand Down
16 changes: 9 additions & 7 deletions eng/common/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ extends:
- job: InitJob
displayName: Initialize
steps:
- script: |
corepack enable
corepack prepare pnpm --activate
displayName: Install pnpm

- script: pnpm install
displayName: Install JavaScript Dependencies

- script: node $(Build.SourcesDirectory)/eng/common/scripts/resolve-target-branch.js
timotheeguerin marked this conversation as resolved.
Show resolved Hide resolved
displayName: Resolve target branch

- task: PowerShell@2
- script: pnpm tsx ./eng/common/scripts/dispatch-area-triggers.ts --target-branch $(TARGET_BRANCH)
displayName: "Analyze PR changes"
name: InitStep
inputs:
pwsh: true
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Analyze-Changes.ps1
arguments: >
-TargetBranch $(TARGET_BRANCH)
workingDirectory: $(Build.SourcesDirectory)

# Run csharp stages if RunCSharp == true
- template: /packages/http-client-csharp/eng/pipeline/templates/ci-stages.yml
Expand Down
76 changes: 0 additions & 76 deletions eng/common/scripts/Analyze-Changes.Tests.ps1

This file was deleted.

181 changes: 0 additions & 181 deletions eng/common/scripts/Analyze-Changes.ps1

This file was deleted.

Loading
Loading