Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 3, 2025

This PR ports changes from commit bbc5570070f792568d97eedcf5d1b6e0502cad21 which updates vulnerable dependencies and modernizes deprecated Node.js API usage.

🔒 Security & Dependency Updates

Updated the following packages to address security vulnerabilities and improve compatibility:

Package Old Version New Version
archiver 2.0.3 7.0.1
glob 7.1.2 11.0.3
shelljs 0.8.5 0.10.0
uuid 3.0.1 13.0.0

Also removed unnecessary type definition packages (@types/glob, @types/uuid) as they are now included in their respective packages.

🔄 Code Modernization

UUID Import Modernization

Updated from deprecated CommonJS-style uuid usage to modern ES6 imports:

// Before
import uuid = require("uuid");
def.id = uuid.v1();

// After
import { v1 as uuidv1 } from "uuid";
def.id = uuidv1();

URL Parsing Modernization

Replaced deprecated Node.js url.parse() with the modern URL constructor API:

// Before
import url = require("url");
this.parsedUrl = url.parse(this.serviceUrl);
const splitPath = this.parsedUrl.path.split("/");

// After
this.parsedUrl = new URL(this.serviceUrl);
const splitPath = this.parsedUrl.pathname.split("/");

Added error handling to maintain backward compatibility with invalid URLs that the old url.parse() would accept.

Glob API Update

Updated from callback-based glob API to promise-based API:

// Before
const promises = globs.map(pattern =>
    new Promise<string[]>((resolve, reject) => {
        glob(pattern, (err, matches) => {
            if (err) reject(err);
            else resolve(matches);
        });
    })
);

// After
const promises = globs.map(pattern => glob(pattern));

TypeScript Configuration

Updated TypeScript compilation target from ES2018 to ES2019 to support newer JavaScript features.

✅ Validation

  • All updated dependencies validated against GitHub Advisory Database - No vulnerabilities found
  • CodeQL security scan completed - No alerts
  • Code review completed - No issues found
  • Changes maintain backward compatibility

📝 Additional Changes

  • Fixed indentation in package.json scripts section (standardized to 4-space indentation)
  • Cleaned up trailing whitespace in test files
  • Updated package-lock.json with all transitive dependency updates
  • Version bump: Updated package version from 0.22.1 to 0.22.2

Files modified: 8 files (package.json, package-lock.json, tsconfig.json, app/exec/build/tasks/create.ts, app/exec/extension/_lib/merger.ts, app/lib/connection.ts, tests/mock-server/utils/RequestParser.ts, tests/build-server-integration-tests.ts)

Original prompt

Port changes from bbc5570 commit from forked repo into the main repo @ @microsoft/tfs-cli. The PR should be created in the main repo and the changes from coomit to be ported over that PR


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Port changes from commit bbc5570 to main repo Port changes from commit bbc5570 - Update vulnerable dependencies and modernize deprecated API usage Oct 3, 2025
@Copilot Copilot AI requested a review from tarunramsinghani October 3, 2025 07:43
Copilot finished work on behalf of tarunramsinghani October 3, 2025 07:43
@tarunramsinghani
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tarunramsinghani
Copy link
Contributor

@copilot update the patch version in the package.json

Co-authored-by: tarunramsinghani <[email protected]>
Copy link
Contributor Author

Copilot AI commented Oct 3, 2025

@copilot update the patch version in the package.json

Updated the patch version from 0.22.1 to 0.22.2 in both package.json and package-lock.json (commit 8aca3fe)

Copilot finished work on behalf of tarunramsinghani October 3, 2025 07:55
- Revert mocha from 11.7.3 to 10.2.0 for better Node.js compatibility
- Revert rimraf from 6.0.1 to 2.6.1 to maintain backward compatibility
- Update Node.js engine requirement to >=16.0.0 for modern API support
- Improve error handling in server integration tests
- All tests passing with updated dependency versions
@tarunramsinghani tarunramsinghani marked this pull request as ready for review October 3, 2025 11:13
@tarunramsinghani tarunramsinghani requested review from a team as code owners October 3, 2025 11:13
@tarunramsinghani
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tarunramsinghani tarunramsinghani merged commit ae8b325 into master Oct 3, 2025
7 checks passed
@tarunramsinghani tarunramsinghani deleted the copilot/port-changes-from-bbc5570 branch October 3, 2025 11:49
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.

3 participants