Skip to content

Conversation

@azure-sdk
Copy link
Collaborator

Post release automated changes for azure-ai-projects

Copilot AI review requested due to automatic review settings December 3, 2025 04:29
Copilot finished reviewing on behalf of azure-sdk December 3, 2025 04:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This is an automated post-release PR that bumps the version from 2.0.0-beta.2 to 2.0.0-beta.3 and includes several maintenance changes. However, the automated changes have introduced critical bugs in JavaScript samples by attempting to use ES module syntax (import.meta.url) in CommonJS files.

Key Changes:

  • Version bump to 2.0.0-beta.3 in package.json and constants
  • Dependency update: @azure/identity from ^4.11.1 to ^4.13.0
  • Bug fixes: Removed incorrect await keywords before listVersions() calls (correct change)
  • Bug introduction: Added import.meta.url usage in JavaScript CommonJS files (incorrect change)
  • Documentation updates to README files
  • Deleted TypeScript training data file

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
sdk/ai/ai-projects/src/constants.ts Updates SDK version constant from 2.0.0-beta.2 to 2.0.0-beta.3
sdk/ai/ai-projects/package.json Bumps package version to 2.0.0-beta.3
sdk/ai/ai-projects/CHANGELOG.md Adds template for 2.0.0-beta.3 release notes
sdk/ai/ai-projects/samples/v2-beta/typescript/package.json Updates @azure/identity dependency to ^4.13.0
sdk/ai/ai-projects/samples/v2-beta/typescript/src/datasets/datasetsBasics.ts Fixes incorrect await usage before listVersions() call
sdk/ai/ai-projects/samples/v2-beta/typescript/src/files/data/training_set.jsonl Deletes training data file (may break filesBasic.ts sample)
sdk/ai/ai-projects/samples/v2-beta/typescript/README.md Updates documentation table structure
sdk/ai/ai-projects/samples/v2-beta/javascript/package.json Updates @azure/identity dependency to ^4.13.0
sdk/ai/ai-projects/samples/v2-beta/javascript/datasets/datasetsBasics.js Fixes incorrect await usage and incorrectly adds import.meta.url to CommonJS
sdk/ai/ai-projects/samples/v2-beta/javascript/files/filesBasic.js Incorrectly adds import.meta.url to CommonJS file
sdk/ai/ai-projects/samples/v2-beta/javascript/agents/tools/computerUseUtil.js Incorrectly adds import.meta.url to CommonJS file
sdk/ai/ai-projects/samples/v2-beta/javascript/agents/tools/agentImageGeneration.js Incorrectly adds import.meta.url to CommonJS file
sdk/ai/ai-projects/samples/v2-beta/javascript/agents/tools/agentFileSearch.js Incorrectly adds import.meta.url to CommonJS file
sdk/ai/ai-projects/samples/v2-beta/javascript/agents/agentFileSearch.js Incorrectly adds import.meta.url to CommonJS file
sdk/ai/ai-projects/samples/v2-beta/javascript/README.md Updates documentation table

Comment on lines +14 to +19
const { fileURLToPath } = require("url");
require("dotenv/config");

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using import.meta.url in CommonJS modules will cause a runtime error. Since this package uses CommonJS (no "type": "module" in package.json), use __dirname directly instead, which is available natively in CommonJS.

Remove these lines:

const { fileURLToPath } = require("url");
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

And use __dirname directly since it's already available in CommonJS.

Suggested change
const { fileURLToPath } = require("url");
require("dotenv/config");
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
require("dotenv/config");

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +14
const { fileURLToPath } = require("url");

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using import.meta.url in CommonJS modules will cause a runtime error. Since this package uses CommonJS (no "type": "module" in package.json), use __dirname directly instead, which is available natively in CommonJS.

Remove these lines:

const { fileURLToPath } = require("url");
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

And use __dirname directly since it's already available in CommonJS.

Suggested change
const { fileURLToPath } = require("url");
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +67
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using import.meta.url in CommonJS modules will cause a runtime error. Since this package uses CommonJS (no "type": "module" in package.json), use __dirname directly instead, which is available natively in CommonJS.

Remove these lines:

const { fileURLToPath } = require("url");
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

And use __dirname directly since it's already available in CommonJS.

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +25
const { fileURLToPath } = require("url");
require("dotenv/config");

const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint>";
const deploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "<model deployment name>";

async function main() {
// Load the file to be indexed for search
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using import.meta.url in CommonJS modules will cause a runtime error. Since this package uses CommonJS (no "type": "module" in package.json), use __dirname directly instead, which is available natively in CommonJS.

Remove line 19:

const { fileURLToPath } = require("url");

And instead of:

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

Use __dirname directly since it's already available in CommonJS.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +22
const { fileURLToPath } = require("url");
require("dotenv/config");

const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint>";
const deploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "<model deployment name>";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using import.meta.url in CommonJS modules will cause a runtime error. Since this package uses CommonJS (no "type": "module" in package.json), use __dirname directly instead, which is available natively in CommonJS.

Remove these lines:

const { fileURLToPath } = require("url");
const __dirname = path.dirname(fileURLToPath(import.meta.url));

And use __dirname directly since it's already available in CommonJS.

Suggested change
const { fileURLToPath } = require("url");
require("dotenv/config");
const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint>";
const deploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "<model deployment name>";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
require("dotenv/config");
const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint>";
const deploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "<model deployment name>";

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +19
const { fileURLToPath } = require("url");
const fs = require("fs");
const path = require("path");
require("dotenv/config");

const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint string>";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using import.meta.url in CommonJS modules will cause a runtime error. Since this package uses CommonJS (no "type": "module" in package.json), use __dirname directly instead, which is available natively in CommonJS.

Remove these lines:

const { fileURLToPath } = require("url");
const __dirname = path.dirname(fileURLToPath(import.meta.url));

And use __dirname directly since it's already available in CommonJS:

const filePath = path.join(__dirname, "data", "training_set.jsonl");
Suggested change
const { fileURLToPath } = require("url");
const fs = require("fs");
const path = require("path");
require("dotenv/config");
const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint string>";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const fs = require("fs");
const path = require("path");
require("dotenv/config");
const projectEndpoint = process.env["AZURE_AI_PROJECT_ENDPOINT"] || "<project endpoint string>";

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant