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

Juntuchen/alpha4 ops #32354

Draft
wants to merge 58 commits into
base: v-durgeshs/feature/alpha4-changes
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
53562be
updated OPS outgoing call
juntuchen-msft Dec 18, 2024
340b1a5
updated
juntuchen-msft Dec 18, 2024
a8cfa52
[test creds] Fix build warnings (#32289)
deyaaeldeen Dec 18, 2024
1c2f325
[EngSys] upgrade dev dependency typescript version to 5.7.2
jeremymeng Dec 17, 2024
25f960a
[advisor] Migrate @azure/arm-advisor with @azure/dev-tool additions (…
mpodwysocki Dec 18, 2024
d08b046
[EngSys] remove dev dependency `decompress` (#32094)
jeremymeng Dec 18, 2024
7189228
[dev-tool] Fix source fixups per tsconfig changes (#32292)
mpodwysocki Dec 19, 2024
f6b7ffc
[dev-tool] fix test and linting (#32293)
jeremymeng Dec 19, 2024
c7a5e8f
[Monitor OpenTelemetry Exporter] Fix samples-dev Test Execution (#32225)
JacksonWeber Dec 19, 2024
12c49d1
[mgmt] containerservice release (#32080)
kazrael2119 Dec 19, 2024
dfefda3
[mgmt] compute release (#32157)
kazrael2119 Dec 19, 2024
c590627
[mgmt] network release (#32141)
kazrael2119 Dec 19, 2024
d330d53
[mgmt] datafactory release (#32140)
kazrael2119 Dec 19, 2024
8179e26
[mgmt] iotoperations ga (#32203)
kazrael2119 Dec 19, 2024
13e505c
[mgmt] servicefabricmanagedclusters release (#32188)
kazrael2119 Dec 19, 2024
b057083
[mgmt] cosmosdb preview release (#32295)
kazrael2119 Dec 19, 2024
340cf3a
[mgmt] deviceregistry release (#32190)
kazrael2119 Dec 19, 2024
af7626e
Merge branch 'main' into juntuchen/opsOutgoingUpdate
juntuchen-msft Dec 19, 2024
2aa1f31
[EngSys][rush-runner] refactor for test-ability (#32148)
jeremymeng Dec 19, 2024
3366272
[communication]-[sms] Fix opt out remove action (#32298)
phermanov-msft Dec 19, 2024
7e136cc
updated to fix pipeline
juntuchen-msft Dec 19, 2024
b47efec
[test-utils-vitest] Add multiversion testing to vitest (#32299)
mpodwysocki Dec 19, 2024
cbd2b87
[Event Hubs] Fix type (#32303)
deyaaeldeen Dec 19, 2024
2faafa9
Azure AI Foundary - Projects JS SDK - Agents Preview (#32301)
ganeshyb Dec 19, 2024
a65d4ad
[eslint] restore custom rules for bin scripts (#32305)
jeremymeng Dec 19, 2024
c5e8d31
[engsys] inline eslint step into analyze template (#32304)
xirzec Dec 19, 2024
b22ced0
[data-plane] refresh @azure-rest/agrifood-farming sdk (#30779)
kazrael2119 Dec 20, 2024
9588658
[data-plane] refresh communication-job-router-rest sdk (#30907)
kazrael2119 Dec 20, 2024
74033cd
[data-plane] refresh ai-content-safety-rest sdk (#30925)
kazrael2119 Dec 20, 2024
a75a229
[data-plane] refresh developer-devcenter-rest sdk (#30936)
kazrael2119 Dec 20, 2024
6c6d444
[data-plane] refresh ai-document-translator-rest sdk (#30967)
kazrael2119 Dec 20, 2024
21ffeee
[data-plane] refresh purview-administration-rest sdk (#31263)
kazrael2119 Dec 20, 2024
9a80672
[data-plane] refresh purview-datamap-rest sdk (#31356)
kazrael2119 Dec 20, 2024
5e59a73
[data-plane] refresh purview-sharing-rest (#31620)
kazrael2119 Dec 20, 2024
f301c0f
[data-plane] refresh purview-workflow-rest (#31621)
kazrael2119 Dec 20, 2024
c1bde46
[data-plane] refresh synapse-access-control-rest (#31636)
kazrael2119 Dec 20, 2024
7ab722d
[data-plane] refresh ai-translation-text-rest (#31637)
kazrael2119 Dec 20, 2024
0da67e9
[data-plane] refresh iot-device-update-rest sdk (#30963)
kazrael2119 Dec 20, 2024
bf36b8f
Post release automated changes for ai releases (#32308)
azure-sdk Dec 20, 2024
b05f996
Refresh agent samples and utilities for improved functionality (#32307)
ganeshyb Dec 20, 2024
19e6da3
Post release automated changes for ai releases (#32310)
azure-sdk Dec 20, 2024
f290943
Update tsp-location.yaml (#32312)
kazrael2119 Dec 20, 2024
43e2b91
Update changelog for Maps Timezone (#32311)
Lakicar95 Dec 20, 2024
04745da
fix(playwrighttesting): handling other attachments (#31950)
kashish2508 Dec 20, 2024
73fa688
[mgmt] playwrighttesting ga (#32199)
kazrael2119 Dec 20, 2024
0b747e3
fix(playwrighttesting): handling OS name and browser name (#32048)
kashish2508 Dec 20, 2024
5689aff
Post release automated changes for communication releases (#32302)
azure-sdk Dec 20, 2024
8eb51af
[mgmt] cognitiveservice release (#32317)
kazrael2119 Dec 20, 2024
18b489e
support Generate-code-from-TypeSpec doc in js sdk repo and update cus…
kazrael2119 Dec 20, 2024
2737208
[data-plane] refresh confidential-ledger-rest (#32236)
kazrael2119 Dec 20, 2024
183b89c
Update @azure-tools/typespec-client-generator-cli version for tsp-cli…
wanlwanl Dec 20, 2024
7f2785f
Make timezone visible for the release pipeline (#32329)
Lakicar95 Dec 21, 2024
6330370
[EngSys] automatic rush update --full (#32336)
azure-sdk Dec 23, 2024
a2634bd
Adding inline image example to readme (#32290)
natekimball-msft Dec 24, 2024
618a9ef
Merge branch 'main' into v-durgeshs/feature/alpha4-changes
juntuchen-msft Dec 24, 2024
0ca954d
updated to alpha 4 swagger
juntuchen-msft Dec 24, 2024
61d605a
Merge branch 'juntuchen/opsOutgoingUpdate' into juntuchen/alpha4-ops
juntuchen-msft Dec 24, 2024
081ee4b
updated api
juntuchen-msft Dec 24, 2024
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
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

# PRLabel: %Communication - Email
# ServiceLabel: %Communication - Email
/sdk/communication/communication-email/ @yogeshmo
/sdk/communication/communication-email/ @yogeshmo @natekimball-msft @kagbakpem

# PRLabel: %Communication - Job Router
# ServiceLabel: %Communication - Job Router
Expand Down
2 changes: 1 addition & 1 deletion .scripts/automation_init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
npm install -g @azure-tools/typespec-client-generator-cli
npm install -g @azure-tools/typespec-client-generator-cli@0.14.1
npm install -g @microsoft/[email protected]
npm install -g @azure-tools/js-sdk-release-tools
4,967 changes: 2,553 additions & 2,414 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions common/tools/dev-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@rollup/plugin-node-resolve": "^15.2.3",
"chalk": "^4.1.1",
"concurrently": "^8.2.2",
"decompress": "^4.2.1",
"dotenv": "^16.0.0",
"env-paths": "^2.2.1",
"express": "^4.19.2",
Expand All @@ -74,12 +73,13 @@
"tsx": "^4.0.0",
"typescript": "~5.6.2",
"yaml": "^2.3.4",
"@arethetypeswrong/cli": "^0.17.0"
"@arethetypeswrong/cli": "^0.17.0",
"tar": "^7.4.3",
"unzipper": "~0.12.3"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@types/archiver": "^6.0.2",
"@types/decompress": "^4.2.7",
"@types/express": "^4.17.21",
"@types/express-serve-static-core": "^4.19.0",
"@types/fs-extra": "^11.0.4",
Expand All @@ -95,6 +95,7 @@
"rimraf": "^5.0.5",
"typescript-eslint": "~8.16.0",
"uglify-js": "^3.4.9",
"vitest": "^2.0.5"
"vitest": "^2.0.5",
"@types/unzipper": "~0.10.10"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export default leafCommand(commandInfo, async (options) => {
let id = options.name ?? (await prompt("Migration Id: "));
let migrationFile = path.resolve(__dirname, "..", "..", "migrations", ...id.split("/")) + ".ts";
// Need to check that the id is a simple identifier that only contains alphanumeric characters, underscores, dashes, and slashes.
// eslint-disable-next-line no-constant-condition
while (true) {
let failed = false;
if (!/^[a-zA-Z0-9_\-/]+$/.test(id)) {
Expand Down
158 changes: 116 additions & 42 deletions common/tools/dev-tool/src/commands/admin/migrate-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default leafCommand(commandInfo, async ({ "package-name": packageName, br

async function prepareFiles(projectFolder: string, options: { browser: boolean }): Promise<void> {
log.info("Migrating package.json, tsconfig.json, and api-extractor.json");
await upgradePackageJson(projectFolder, resolve(projectFolder, "package.json"));
await upgradePackageJson(projectFolder, resolve(projectFolder, "package.json"), options);
await upgradeTypeScriptConfig(resolve(projectFolder, "tsconfig.json"));
await fixApiExtractorConfig(resolve(projectFolder, "api-extractor.json"));
await commitChanges(projectFolder, "Update package.json, tsconfig.json, and api-extractor.json");
Expand All @@ -110,6 +110,7 @@ async function prepareFiles(projectFolder: string, options: { browser: boolean }
await writeBrowserTestConfig(projectFolder);
await writeFile(resolve(projectFolder, "vitest.browser.config.ts"), VITEST_BROWSER_CONFIG);
}
await writeFile(resolve(projectFolder, "vitest.esm.config.ts"), VITEST_ESM_CONFIG);
await writeFile(resolve(projectFolder, "vitest.config.ts"), VITEST_CONFIG);
await commitChanges(projectFolder, "Update test config");

Expand All @@ -121,13 +122,24 @@ async function prepareFiles(projectFolder: string, options: { browser: boolean }
async function applyCodemods(projectFolder: string): Promise<void> {
const project = new Project({ tsConfigFilePath: resolve(projectFolder, "tsconfig.json") });

const skipPatterns = [/^vitest.*\.config\.ts$/];

// Apply the codemods, one at a time, to all source files in the project.
// Commit the changes after each codemod is applied for ease of reviewing.
// For more information on the codemods and how to contribute, see the `codemods` directory.
for (const mod of codemods) {
log.info(`Applying codemod: ${mod.name}`);
for (const sourceFile of project.getSourceFiles()) {
// Skip config files
if (skipPatterns.some((pattern) => pattern.test(sourceFile.getBaseName()))) {
continue;
}

mod(sourceFile);

// Clean up source file after applying the codemod
sourceFile.fixUnusedIdentifiers();

await sourceFile.save();
}
await commitChanges(projectFolder, `Apply codemod: "${mod.name}"`);
Expand All @@ -138,17 +150,9 @@ const VITEST_CONFIG = `
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { defineConfig, mergeConfig } from "vitest/config";
import viteConfig from "../../../vitest.shared.config.ts";

export default mergeConfig(
viteConfig,
defineConfig({
test: {
include: ["test/**/*.spec.ts"],
},
}),
);
export default viteConfig;
`;

const VITEST_BROWSER_CONFIG = `
Expand All @@ -170,6 +174,20 @@ export default mergeConfig(
);
`;

const VITEST_ESM_CONFIG = `
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { mergeConfig } from "vitest/config";
import vitestConfig from "./vitest.config.ts";
import vitestEsmConfig from "../../../vitest.esm.shared.config.ts";

export default mergeConfig(
vitestConfig,
vitestEsmConfig
);
`;

async function writeBrowserTestConfig(packageFolder: string): Promise<void> {
const testConfig = {
extends: "./.tshy/build.json",
Expand Down Expand Up @@ -217,30 +235,55 @@ async function cleanupFiles(projectFolder: string): Promise<void> {
}

async function upgradeTypeScriptConfig(tsconfigPath: string): Promise<void> {
const tsConfig = JSON.parse(await readFile(tsconfigPath, "utf-8"));

// Set module resolution
tsConfig.compilerOptions.module = "NodeNext";
tsConfig.compilerOptions.moduleResolution = "NodeNext";
tsConfig.compilerOptions.rootDir = ".";
tsConfig.include = [
"src/**/*.ts",
"src/**/*.mts",
"src/**/*.cts",
"samples-dev/**/*.ts", // TODO: Check if samples-dev is needed
"test/**/*.ts",
"test/**/*.mts",
"test/**/*.cts",
];
const packageJson = JSON.parse(
await readFile(resolve(dirname(tsconfigPath), "package.json"), "utf-8"),
);

// Remove old options
delete tsConfig.compilerOptions.outDir;
delete tsConfig.compilerOptions.declarationDir;
const tsConfig = {
references: [
{
path: "./tsconfig.src.json",
},
{
path: "./tsconfig.samples.json",
},
{
path: "./tsconfig.test.json",
},
],
};

await saveJson(tsconfigPath, tsConfig);

const tsSamplesConfig = {
extends: "../../../tsconfig.samples.base.json",
compilerOptions: {
paths: {
[`${packageJson.name}`]: ["./dist/esm"],
},
},
};

await saveJson(resolve(dirname(tsconfigPath), "tsconfig.samples.json"), tsSamplesConfig);

const tsConfigSrc = {
extends: "../../../tsconfig.lib.json",
};

await saveJson(resolve(dirname(tsconfigPath), "tsconfig.src.json"), tsConfigSrc);

const tsConfigTest = {
extends: ["./tsconfig.src.json", "../../../tsconfig.test.base.json"],
};

await saveJson(resolve(dirname(tsconfigPath), "tsconfig.test.json"), tsConfigTest);
}

async function upgradePackageJson(projectFolder: string, packageJsonPath: string): Promise<void> {
async function upgradePackageJson(
projectFolder: string,
packageJsonPath: string,
options: { browser: boolean },
): Promise<void> {
const packageJson = JSON.parse(await readFile(packageJsonPath, "utf-8"));

// Change the module type to ESM
Expand All @@ -250,37 +293,56 @@ async function upgradePackageJson(projectFolder: string, packageJsonPath: string
removeLegacyPackages(packageJson);

// Add the new packages
await addNewPackages(packageJson);
await addNewPackages(packageJson, options);

// Sort the devDependencies
sortPackage(packageJson);

// Add tshy
addTypeScriptHybridizer(packageJson);
addTypeScriptHybridizer(packageJson, options);

// Set files
setFilesSection(packageJson);

// Set scripts
setScriptsSection(packageJson.scripts);
setScriptsSection(packageJson.scripts, {
...options,
isArm: packageJson.name.includes("@azure/arm-"),
});

// Rename files and rewrite browser field
await renameFieldFiles("browser", "browser", projectFolder, packageJson);
await renameFieldFiles("react-native", "native", projectFolder, packageJson);
packageJson.browser = "./dist/browser/index.js";
delete packageJson["react-native"];
packageJson["react-native"] = "./dist/react-native/index.js";

if (!options.browser) {
packageJson.browser = undefined;
packageJson["react-native"] = undefined;
}

// Save the updated package.json
await saveJson(packageJsonPath, packageJson);
}

function setScriptsSection(scripts: PackageJson["scripts"]): void {
scripts["build"] = "npm run clean && dev-tool run build-package && dev-tool run extract-api";
function setScriptsSection(
scripts: PackageJson["scripts"],
options: { browser: boolean; isArm: boolean },
): void {
scripts["build"] =
"npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api";

if (options.browser) {
scripts["unit-test:browser"] =
"npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser";
}

scripts["unit-test:browser"] =
"npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser";
scripts["unit-test:node"] = "dev-tool run test:vitest";

if (options.isArm) {
scripts["integration-test:node"] = "dev-tool run test:vitest --esm";
}

for (const script of Object.keys(scripts)) {
if (scripts[script].includes("tsc -p .")) {
log.info(`Replacing usage of "tsc -p ." with "dev-tool run build-package" in ${script}`);
Expand All @@ -292,11 +354,15 @@ function setScriptsSection(scripts: PackageJson["scripts"]): void {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setFilesSection(packageJson: any): void {
packageJson.files = ["dist/", "README.md", "LICENSE"];
if (packageJson.name.includes("@azure/arm-")) {
packageJson.files.push("review/", "CHANGELOG.md");
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function addTypeScriptHybridizer(packageJson: any): void {
function addTypeScriptHybridizer(packageJson: any, options: { browser: boolean }): void {
packageJson["tshy"] = {
project: "./tsconfig.src.json",
exports: {
"./package.json": "./package.json",
".": "./src/index.ts",
Expand All @@ -306,6 +372,11 @@ function addTypeScriptHybridizer(packageJson: any): void {
selfLink: false,
};

// Remove the esmDialects for arm packages since we don't support ARM in the browser
if (!options.browser) {
delete packageJson["tshy"].esmDialects;
}

// Check if there are subpath exports
if (packageJson.exports) {
for (const key of Object.keys(packageJson.exports)) {
Expand All @@ -318,15 +389,18 @@ function addTypeScriptHybridizer(packageJson: any): void {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function addNewPackages(packageJson: any): Promise<void> {
const newPackages = {
async function addNewPackages(packageJson: any, options: { browser: boolean }): Promise<void> {
const newPackages: Record<string, string | undefined> = {
"@azure-tools/test-utils-vitest": "1.0.0",
"@vitest/browser": undefined,
"@vitest/coverage-istanbul": undefined,
playwright: undefined,
vitest: undefined,
};

if (options.browser) {
newPackages["@vitest/browser"] = undefined;
newPackages["playwright"] = undefined;
}

for (const [newPackage, desiredMinVersion] of Object.entries(newPackages)) {
let latestVersion = desiredMinVersion;
if (!latestVersion) {
Expand Down
15 changes: 6 additions & 9 deletions common/tools/dev-tool/src/commands/admin/migrate-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,15 @@ export default leafCommand(commandInfo, async ({ "package-name": packageName })

const projectFile = resolve(projectFolder, "tsconfig.json");

const projectFileContents = await readFile(projectFile, "utf-8");
const projectFileJSON = JSON.parse(projectFileContents);
const module = projectFileJSON.compilerOptions.module;
const moduleResolution = projectFileJSON.compilerOptions.moduleResolution;

if (module !== "NodeNext" || moduleResolution !== "NodeNext") {
log.info("Package does not use NodeNext module resolution. Skipping.");
return true;
}
const skipPatterns = [/^vitest.*\.config\.ts$/];

const tsProject = new Project({ tsConfigFilePath: projectFile });
for (const sourceFile of tsProject.getSourceFiles()) {
// Skip config files
if (skipPatterns.some((pattern) => pattern.test(sourceFile.getBaseName()))) {
continue;
}

fixSourceFile(sourceFile);
await sourceFile.save();
}
Expand Down
9 changes: 3 additions & 6 deletions common/tools/dev-tool/src/commands/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ async function runMigrations(pending: Migration[], project: ProjectInfo): Promis
async function onMigrationSuccess(
project: ProjectInfo,
migration: Migration,
quiet: boolean = false, // eslint-disable-line @typescript-eslint/no-inferrable-types
quiet: boolean = false,
): Promise<void> {
await updateMigrationDate(project, migration);

Expand All @@ -372,7 +372,7 @@ async function onMigrationSuccess(
async function onMigrationSkipped(
project: ProjectInfo,
migration: Migration,
quiet: boolean = false, // eslint-disable-line @typescript-eslint/no-inferrable-types
quiet: boolean = false,
): Promise<void> {
await updateMigrationDate(project, migration);

Expand Down Expand Up @@ -451,10 +451,7 @@ function printMigrationSuspendedWarning(migration: Migration, status: MigrationS
* @param project - the working project
* @returns true on success, otherwise false
*/
async function abortMigration(
project: ProjectInfo,
quiet: boolean = false, // eslint-disable-line @typescript-eslint/no-inferrable-types
): Promise<boolean> {
async function abortMigration(project: ProjectInfo, quiet: boolean = false): Promise<boolean> {
const suspendedMigration = await validateSuspendedState(project);
if (!suspendedMigration) return false;

Expand Down
1 change: 0 additions & 1 deletion common/tools/dev-tool/src/config/rollup.base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ export function sourcemaps() {
debug("no map for file ", id);
return { code, map: null };
} catch (e) {
// eslint-disable-next-line no-inner-declarations
function toString(error: unknown): string {
return error instanceof Error ? (error.stack ?? error.toString()) : JSON.stringify(error);
}
Expand Down
Loading
Loading