Skip to content

Commit 5cbc14d

Browse files
Merge pull request #1405 from microsoftgraph/feature/remove-deprecated-node-versions-from-pipeline
Remove unsupported node versions(12 & 14) from the pipeline Update required status checks
2 parents 9f88829 + 60fd771 commit 5cbc14d

File tree

10 files changed

+43
-26
lines changed

10 files changed

+43
-26
lines changed

.azure-pipelines/ci-build-production.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ stages:
2020
vmImage: windows-latest
2121
strategy:
2222
matrix:
23-
Node 12:
24-
NODE_VERSION: '12.x'
25-
Node 14:
26-
NODE_VERSION: '14.x'
2723
Node 16:
2824
NODE_VERSION: '16.x'
25+
Node 18:
26+
NODE_VERSION: '18.x'
27+
Node 20:
28+
NODE_VERSION: '20.x'
2929
maxParallel: 2
3030
steps:
3131
- template: ./common-templates/security-pre-checks.yml

.github/policies/msgraph-sdk-javascript-branch-protection.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ configuration:
3535
requiresLinearHistory: false
3636
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
3737
requiredStatusChecks:
38-
- build (12.x)
39-
- build (14.x)
4038
- build (16.x)
39+
- build (18.x)
40+
- build (20.x)
4141
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
4242
requiresStrictStatusChecks: true
4343
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
@@ -71,6 +71,9 @@ configuration:
7171
requiresLinearHistory: false
7272
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
7373
requiredStatusChecks:
74+
- build (16.x)
75+
- build (18.x)
76+
- build (20.x)
7477
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
7578
requiresStrictStatusChecks: true
7679
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
@@ -98,6 +101,11 @@ configuration:
98101
requiresConversationResolution: false
99102
# Are merge commits prohibited from being pushed to this branch. boolean
100103
requiresLinearHistory: false
104+
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
105+
requiredStatusChecks:
106+
- build (16.x)
107+
- build (18.x)
108+
- build (20.x)
101109
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
102110
requiresStrictStatusChecks: true
103111
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
@@ -129,6 +137,11 @@ configuration:
129137
requiresConversationResolution: false
130138
# Are merge commits prohibited from being pushed to this branch. boolean
131139
requiresLinearHistory: false
140+
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
141+
requiredStatusChecks:
142+
- build (16.x)
143+
- build (18.x)
144+
- build (20.x)
132145
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
133146
requiresStrictStatusChecks: true
134147
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
@@ -162,6 +175,9 @@ configuration:
162175
requiresLinearHistory: false
163176
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
164177
requiredStatusChecks:
178+
- build (16.x)
179+
- build (18.x)
180+
- build (20.x)
165181
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
166182
requiresStrictStatusChecks: false
167183
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
@@ -195,9 +211,9 @@ configuration:
195211
requiresLinearHistory: false
196212
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
197213
requiredStatusChecks:
198-
- build (14.x)
199214
- build (16.x)
200-
- build (12.x)
215+
- build (18.x)
216+
- build (20.x)
201217
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
202218
requiresStrictStatusChecks: true
203219
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.

.github/workflows/ci_validation.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [12.x, 14.x, 16.x]
15+
node-version: [16.x, 18.x, 20.x]
1616
steps:
1717
- uses: actions/checkout@v3
1818
- name: Use Node.js ${{ matrix.node-version }}
@@ -22,19 +22,13 @@ jobs:
2222
- name: Install dependencies
2323
run: npm ci
2424

25-
- name: Build for node 14 and 16
26-
if: matrix.node-version != '12.x'
27-
run: npm run build --if-present
28-
29-
- name: Build for node 12
30-
if: matrix.node-version == '12.x'
31-
run: npm run build:cjs && npm run build:es
25+
- name: Build for node 16, 18 & 20
26+
run: npm run build
3227

3328
- name: Run unit tests
3429
run: npm test
3530

3631
- name: Verify ESM compatibility
37-
if: matrix.node-version == '16.x'
3832
working-directory: './test-esm'
3933
run: |
4034
npm ci

test/common/content/BatchRequestContent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import "isomorphic-fetch";
1010
import { assert } from "chai";
1111

1212
import { BatchRequestContent, BatchRequestStep } from "../../../src/content/BatchRequestContent";
13-
import { randomString } from "../../test-helper";
13+
import { DUMMY_BASE_URL, randomString } from "../../test-helper";
1414

1515
const folderName = randomString();
1616
const folderDetails = {
1717
name: folderName,
1818
folder: {},
1919
};
2020

21-
const createFolderRequest = new Request("/me/drive/root/children", {
21+
const createFolderRequest = new Request(DUMMY_BASE_URL + "/me/drive/root/children", {
2222
method: "POST",
2323
headers: {
2424
"Content-type": "application/json",

test/common/core/HTTPClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { HTTPClient } from "../../../src/HTTPClient";
1111
import { Context } from "../../../src/IContext";
1212
import { FetchOptions } from "../../../src/IFetchOptions";
1313
import { DummyHTTPMessageHandler } from "../../DummyHTTPMessageHandler";
14+
import { DUMMY_BASE_URL } from "../../test-helper";
1415

1516
describe("HTTPClient.ts", () => {
1617
const httpMessageHandler: DummyHTTPMessageHandler = new DummyHTTPMessageHandler();
@@ -63,7 +64,7 @@ describe("HTTPClient.ts", () => {
6364
});
6465

6566
it("Should execute for context object with Request instance", async () => {
66-
const request: Request = new Request("dummy_url", {
67+
const request: Request = new Request(DUMMY_BASE_URL + "/dummy_url", {
6768
method: "GET",
6869
});
6970
const context: Context = {

test/common/middleware/AuthenticationHandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { GRAPH_BASE_URL } from "../../../src/Constants";
1212
import { Context } from "../../../src/IContext";
1313
import { AuthenticationHandler } from "../../../src/middleware/AuthenticationHandler";
1414
import { DummyAuthenticationProvider } from "../../DummyAuthenticationProvider";
15+
import { DUMMY_BASE_URL } from "../../test-helper";
1516

1617
const dummyAuthProvider = new DummyAuthenticationProvider();
1718
const authHandler = new AuthenticationHandler(dummyAuthProvider);
@@ -26,7 +27,7 @@ describe("AuthenticationHandler.ts", async () => {
2627
});
2728
describe("Auth Headers", () => {
2829
it("Should delete Auth header when Request object is passed with non Graph URL", async () => {
29-
const request = new Request("test_url");
30+
const request = new Request(DUMMY_BASE_URL + "/test_url");
3031
const context: Context = {
3132
request,
3233
options: {

test/common/middleware/MiddlewareUtil.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { assert } from "chai";
99

1010
import { FetchOptions } from "../../../src/IFetchOptions";
1111
import { appendRequestHeader, generateUUID, getRequestHeader, setRequestHeader } from "../../../src/middleware/MiddlewareUtil";
12+
import { DUMMY_BASE_URL } from "../../test-helper";
1213

1314
describe("MiddlewareUtil.ts", async () => {
1415
function getMultipleValuesForHeader(headers: Headers, key: string): string[] {
@@ -23,7 +24,7 @@ describe("MiddlewareUtil.ts", async () => {
2324
describe("getRequestHeader", () => {
2425
const key = "Content-Type";
2526
const value = "application/json";
26-
const url = "dummy_url";
27+
const url = DUMMY_BASE_URL + "/dummy_url";
2728
it("Should get header from request object", () => {
2829
const request: Request = new Request(url, {
2930
method: "test",
@@ -76,7 +77,7 @@ describe("MiddlewareUtil.ts", async () => {
7677
describe("setRequestHeader", () => {
7778
const key = "Content-Type";
7879
const value = "application/json";
79-
const url = "dummy_url";
80+
const url = DUMMY_BASE_URL + "/dummy_url";
8081
it("Should set header in request object", () => {
8182
const request: Request = new Request(url, {
8283
method: "test",
@@ -179,7 +180,7 @@ describe("MiddlewareUtil.ts", async () => {
179180
const key = "Content-Type";
180181
const value = "application/json";
181182
const firstValue = "text/html";
182-
const url = "dummy_url";
183+
const url = DUMMY_BASE_URL + "/dummy_url";
183184
it("Should set header in request object if the header is not present", () => {
184185
const request: Request = new Request(url, {
185186
method: "test",

test/common/middleware/TelemetryHandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { FeatureUsageFlag, TelemetryHandlerOptions } from "../../../src/middlewa
1414
import { TelemetryHandler } from "../../../src/middleware/TelemetryHandler";
1515
import { PACKAGE_VERSION } from "../../../src/Version";
1616
import { DummyHTTPMessageHandler } from "../../DummyHTTPMessageHandler";
17+
import { DUMMY_BASE_URL } from "../../test-helper";
1718

1819
describe("TelemetryHandler.ts", () => {
1920
describe("execute", function() {
@@ -121,7 +122,7 @@ describe("TelemetryHandler.ts", () => {
121122
});
122123

123124
it("Should delete Telemetry in the header when Request object is passed with non Graph URL", async () => {
124-
const request = new Request("test_url");
125+
const request = new Request(DUMMY_BASE_URL + "/test_url");
125126
const context: Context = {
126127
request,
127128
options: {

test/node/content/BatchRequestContent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { assert } from "chai";
1111
import * as fs from "fs";
1212

1313
import { BatchRequestContent } from "../../../src/content/BatchRequestContent";
14+
import { GRAPH_BASE_URL } from "../../../src/Constants";
1415

1516
describe("BatchRequestContent.ts", () => {
1617
describe("getContent", () => {
@@ -22,7 +23,7 @@ describe("BatchRequestContent.ts", () => {
2223
}
2324
const uploadOneDriveFile = {
2425
id: "1",
25-
request: new Request(`/me/drive/root:/Documents/${fileName}:/content`, {
26+
request: new Request(`${GRAPH_BASE_URL}me/drive/root:/Documents/${fileName}:/content`, {
2627
method: "PUT",
2728
headers: {
2829
"Content-type": "image/jpg",

test/test-helper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ export function randomString() {
1919
.toString(36)
2020
.substring(7);
2121
}
22+
23+
export const DUMMY_BASE_URL = "https://localhost";

0 commit comments

Comments
 (0)