Skip to content

Commit 32da2e2

Browse files
Updated as per review suggestions
1 parent a08a1fa commit 32da2e2

12 files changed

Lines changed: 29 additions & 44 deletions

File tree

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ permissions:
2020
contents: read
2121

2222
jobs:
23-
releasePlanTests:
24-
name: Check release-plan
23+
release-plan:
2524
uses: ./.github/workflows/_reusable-eng-tools-test.yaml
2625
with:
2726
package: release-plan

eng/pipelines/release-plan.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,24 @@ stages:
3333
- checkout: self
3434
fetchDepth: 2
3535

36-
- template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml
37-
parameters:
38-
npmrcPath: $(Agent.TempDirectory)/gen-sdk/.npmrc
39-
4036
- template: /eng/common/pipelines/templates/steps/login-to-github.yml
4137

4238
- task: UseNode@1
4339
displayName: "Install Node.js"
4440
inputs:
4541
version: $(NodeVersion)
4642

47-
- script: |
48-
set -euo pipefail
49-
npm install
50-
npm run build
51-
displayName: "Install and build release-plan tool"
52-
workingDirectory: $(Build.SourcesDirectory)/eng/tools/release-plan
53-
env:
54-
npm_config_userconfig: "$(Agent.TempDirectory)/gen-sdk/.npmrc"
43+
- template: /eng/pipelines/templates/steps/npm-install.yml
44+
parameters:
45+
workingDirectory: $(Build.SourcesDirectory)/eng/tools/release-plan
5546

5647
- template: /eng/common/pipelines/templates/steps/install-azsdk-cli.yml
5748

5849
- task: AzureCLI@2
5950
displayName: "Get Release Plan details"
6051
condition: succeeded()
6152
continueOnError: true
53+
workingDirectory: $(Build.SourcesDirectory)/eng/tools/release-plan
6254
env:
6355
GH_TOKEN: $(GH_TOKEN)
6456
inputs:
@@ -98,7 +90,7 @@ stages:
9890
$nodeArgs += @("--commit-sha", $commitSha)
9991
}
10092
101-
node eng/tools/release-plan/cmd/release-plan.js @nodeArgs
93+
npm exec --no -- release-plan @nodeArgs
10294
10395
- pwsh: |
10496
$outputPath = "$(Build.ArtifactStagingDirectory)/release-plan/release-plan.json"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
import { main } from "../dist/src/index.js";
3+
import { main } from "../src/index.ts";
44

55
await main();

eng/tools/release-plan/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"name": "@azure-tools/release-plan",
33
"private": true,
44
"type": "module",
5-
"main": "dist/src/index.js",
5+
"main": "src/index.ts",
66
"bin": {
77
"release-plan": "cmd/release-plan.js"
88
},
99
"scripts": {
10-
"build": "tsc --build",
10+
"build": "tsc --noEmit",
1111
"check": "npm run build && npm run lint && npm run format:check && npm run test:ci",
12+
"clean": "rm -rf dist && rm -rf node_modules",
1213
"format": "prettier . --ignore-path ../.prettierignore --write",
1314
"format:check": "prettier . --ignore-path ../.prettierignore --check",
1415
"format:check:ci": "prettier . --ignore-path ../.prettierignore --check --log-level debug",

eng/tools/release-plan/src/args.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from "node:path";
22
import process from "node:process";
33
import { parseArgs, type ParseArgsConfig } from "node:util";
4-
import type { CliArguments } from "./types.js";
4+
import type { CliArguments } from "./types.ts";
55

66
/**
77
* Parse command line arguments for release plan tool.

eng/tools/release-plan/src/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { mkdirSync, writeFileSync } from "node:fs";
22
import path from "node:path";
33
import process from "node:process";
4-
import { parseCliArguments } from "./args.js";
5-
import { postReleasePlanComment } from "./pr-comment.js";
4+
import { parseCliArguments } from "./args.ts";
5+
import { postReleasePlanComment } from "./pr-comment.ts";
66
import {
77
createAzdskRunner,
88
ensureReleasePlan,
99
getApiReleaseType,
1010
getNextMonthTarget,
1111
getSdkReleaseType,
12-
} from "./release-plan.js";
13-
import type { TypeSpecProjectInfo } from "./types.js";
12+
} from "./release-plan.ts";
13+
import type { TypeSpecProjectInfo } from "./types.ts";
1414
import {
1515
checkNewApiVersionLabel,
1616
createOctokit,
1717
getTypeSpecProjectInfoFromCommit,
1818
getTypeSpecProjectInfoFromPr,
19-
} from "./typespec-project.js";
19+
} from "./typespec-project.ts";
2020

2121
/**
2222
* Main CLI entry point.
@@ -143,17 +143,17 @@ export async function main(): Promise<void> {
143143
}
144144
}
145145

146-
export { parseCliArguments } from "./args.js";
147-
export { buildReleaseplanCommentBody, postReleasePlanComment } from "./pr-comment.js";
148-
export type { CommentBodyParams, PrCommentParams } from "./pr-comment.js";
146+
export { parseCliArguments } from "./args.ts";
147+
export { buildReleaseplanCommentBody, postReleasePlanComment } from "./pr-comment.ts";
148+
export type { CommentBodyParams, PrCommentParams } from "./pr-comment.ts";
149149
export {
150150
createAzdskRunner,
151151
ensureReleasePlan,
152152
getApiReleaseType,
153153
getNextMonthTarget,
154154
getSdkReleaseType,
155155
runAzdskCommand,
156-
} from "./release-plan.js";
156+
} from "./release-plan.ts";
157157
export type {
158158
ApiReleaseType,
159159
AzsdkRunner,
@@ -164,7 +164,7 @@ export type {
164164
PullRequestChangedFile,
165165
ReleasePlanCommandContext,
166166
TypeSpecProjectInfo,
167-
} from "./types.js";
167+
} from "./types.ts";
168168
export {
169169
collectTypeSpecProjectPaths,
170170
compareApiVersionsDesc,
@@ -177,4 +177,4 @@ export {
177177
getTypeSpecProjectInfoFromCommit,
178178
getTypeSpecProjectInfoFromPr,
179179
parseApiVersion,
180-
} from "./typespec-project.js";
180+
} from "./typespec-project.ts";

eng/tools/release-plan/src/release-plan.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
EnsureReleasePlanResult,
99
ReleasePlanCommandContext,
1010
ReleasePlanData,
11-
} from "./types.js";
11+
} from "./types.ts";
1212

1313
/**
1414
* Create a runner that invokes azsdk from a specific executable path.

eng/tools/release-plan/src/typespec-project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
OctokitLike,
88
PullRequestChangedFile,
99
TypeSpecProjectInfo,
10-
} from "./types.js";
10+
} from "./types.ts";
1111

1212
/**
1313
* Identifies one TypeSpec project path and selected API version from a pull request.

eng/tools/release-plan/test/pr-comment.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it, vi } from "vitest";
2-
import { buildReleaseplanCommentBody, postReleasePlanComment } from "../src/pr-comment.js";
2+
import { buildReleaseplanCommentBody, postReleasePlanComment } from "../src/pr-comment.ts";
33

44
type CreateCommentParams = {
55
owner: string;

eng/tools/release-plan/test/release-plan.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it, vi } from "vitest";
2-
import { ensureReleasePlan, getApiReleaseType, getSdkReleaseType } from "../src/release-plan.js";
3-
import type { AzsdkRunner } from "../src/types.js";
2+
import { ensureReleasePlan, getApiReleaseType, getSdkReleaseType } from "../src/release-plan.ts";
3+
import type { AzsdkRunner } from "../src/types.ts";
44

55
describe("release type helpers", () => {
66
it("sets Private Preview for private specs repo", () => {

0 commit comments

Comments
 (0)