Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

Set-Location and Push-Location in engineering scripts change the caller's working directory, which is not idiomatic for Rust tooling. These scripts should use path arguments instead.

Changes

eng/scripts/

  • Update-TspClients.ps1: Use --output-dir parameter for tsp-client
  • Pack-Crates.ps1: Use --manifest-path for cargo publish
  • Language-Settings.ps1: Use --manifest-path for cargo metadata
  • Test-Packages.ps1: Use --manifest-path for cargo build and cargo test

sdk/

  • identity/test-resources-post.ps1: Use full paths with [System.IO.Path]::Combine()
  • core/azure_core_amqp/Test-Setup.ps1: Use full paths for git clone, dotnet build, and dotnet exec

Example

Before:

Push-Location $RepoRoot
cargo metadata --format-version 1 --no-deps
Pop-Location

After:

cargo metadata --manifest-path '$RepoRoot/Cargo.toml' --format-version 1 --no-deps

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 0t3vsblobprodcus362.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build --framework net8.0 (dns block)
  • 4myvsblobprodcus32.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build --framework net8.0 (dns block)
  • gbsvsblobprodcus365.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build --framework net8.0 (dns block)
  • kgfvsblobprodcus314.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build --framework net8.0 (dns block)
  • pe3vsblobprodcus354.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build --framework net8.0 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>EngSys: Avoid Set-Location</issue_title>
<issue_description>It's not idiomatic Rust to be setting location on behalf of the caller. Many calls to Set-Location and Push-Location are likely not necessary to engsys and may not impact local engsys dev work if removed.

Set-Location usage: https://github.com/search?q=repo%3AAzure%2Fazure-sdk-for-rust+Set-Location+path%3A**%2F*.ps1+-path%3Aeng%2Fcommon&type=code

Push-Location usage: https://github.com/search?q=repo%3AAzure%2Fazure-sdk-for-rust+Push-Location+path%3A**%2F*.ps1+-path%3Aeng%2Fcommon&type=code</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 2, 2025 19:43
Co-authored-by: RickWinter <4430337+RickWinter@users.noreply.github.com>
…form path handling

Co-authored-by: RickWinter <4430337+RickWinter@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove unnecessary Set-Location and Push-Location calls Remove Set-Location and Push-Location usage from PowerShell scripts Dec 2, 2025
Copilot AI requested a review from RickWinter December 2, 2025 19:51
Copilot finished work on behalf of RickWinter December 2, 2025 19:51
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.

EngSys: Avoid Set-Location

2 participants