Skip to content

Use net/url parsing in parseGitHubUrlNaive to handle fragments and query params#6634

Merged
trangevi merged 8 commits intotrangevi/naive-manifest-downloadfrom
copilot/sub-pr-6631
Jan 29, 2026
Merged

Use net/url parsing in parseGitHubUrlNaive to handle fragments and query params#6634
trangevi merged 8 commits intotrangevi/naive-manifest-downloadfrom
copilot/sub-pr-6631

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

  • Update parseGitHubUrlNaive to use net/url parsing instead of string operations
  • Extract path from parsedURL.Path to ignore query parameters and fragments
  • Test the changes with URLs containing fragments (e.g., #L10) and query params (e.g., ?plain=1)
  • Run existing tests to ensure no regressions
  • Request code review - no issues found
  • Run security scan - no vulnerabilities found
  • Revert unintended changes to files outside azure.ai.agents extension
  • Rebased on latest base branch (commits 3234ac1 and ba5b5cc)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 28, 2026 23:12
…ubUrlNaive

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 28, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

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:

  • code.cloudfoundry.org
    • Triggering command: /update-job-proxy /update-job-proxy -o br-02f9135cd9c8 -j DROP si_-_Surum_1.pem /opt/hostedtoolcache/go/1.25.6/xnat /bin/test by/bb7cbfdba3297/usr/bin/git thority_-_EC1.crconfig k/_temp/copilot---global test -e ot_CA_-_R4.pem k/_temp/copilot-developer-action-e est it config --glob/usr/sbin/iptables on_Authority.crt--wait ache/go/1.25.6/x-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-3a4348b0cdc2 -j DROP si_-_Surum_1.pem git /bin/test e/vcs/af686cb350/usr/bin/git test by/e73e78234ffea--global test -e ot_CA_-_R4.pem /usr/bin/git est blob ca2cd45bfbe11533--wait e/git test (dns block)
  • dario.cat
    • Triggering command: /update-job-proxy /update-job-proxy -o br-02f9135cd9c8 -j DROP si_-_Surum_1.pem /opt/hostedtoolcache/go/1.25.6/xnat /bin/test by/bb7cbfdba3297/usr/bin/git thority_-_EC1.crconfig k/_temp/copilot---global test -e ot_CA_-_R4.pem k/_temp/copilot-developer-action-e est it config --glob/usr/sbin/iptables on_Authority.crt--wait ache/go/1.25.6/x-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-3a4348b0cdc2 -j DROP si_-_Surum_1.pem git /bin/test e/vcs/af686cb350/usr/bin/git test by/e73e78234ffea--global test -e ot_CA_-_R4.pem /usr/bin/git est blob ca2cd45bfbe11533--wait e/git test (dns block)
  • go.googlesource.com
    • Triggering command: /update-job-proxy /update-job-proxy -o br-02f9135cd9c8 -j DROP si_-_Surum_1.pem /opt/hostedtoolcache/go/1.25.6/xnat /bin/test by/bb7cbfdba3297/usr/bin/git thority_-_EC1.crconfig k/_temp/copilot---global test -e ot_CA_-_R4.pem k/_temp/copilot-developer-action-e est it config --glob/usr/sbin/iptables on_Authority.crt--wait ache/go/1.25.6/x-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-3a4348b0cdc2 -j DROP si_-_Surum_1.pem git /bin/test e/vcs/af686cb350/usr/bin/git test by/e73e78234ffea--global test -e ot_CA_-_R4.pem /usr/bin/git est blob ca2cd45bfbe11533--wait e/git test (dns block)
  • go.opentelemetry.io
    • Triggering command: /update-job-proxy /update-job-proxy -o br-02f9135cd9c8 -j DROP si_-_Surum_1.pem /opt/hostedtoolcache/go/1.25.6/xnat /bin/test by/bb7cbfdba3297/usr/bin/git thority_-_EC1.crconfig k/_temp/copilot---global test -e ot_CA_-_R4.pem k/_temp/copilot-developer-action-e est it config --glob/usr/sbin/iptables on_Authority.crt--wait ache/go/1.25.6/x-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-3a4348b0cdc2 -j DROP si_-_Surum_1.pem git /bin/test e/vcs/af686cb350/usr/bin/git test by/e73e78234ffea--global test -e ot_CA_-_R4.pem /usr/bin/git est blob ca2cd45bfbe11533--wait e/git test (dns block)
  • go.uber.org
    • Triggering command: /update-job-proxy /update-job-proxy -o br-02f9135cd9c8 -j DROP si_-_Surum_1.pem /opt/hostedtoolcache/go/1.25.6/xnat /bin/test by/bb7cbfdba3297/usr/bin/git thority_-_EC1.crconfig k/_temp/copilot---global test -e ot_CA_-_R4.pem k/_temp/copilot-developer-action-e est it config --glob/usr/sbin/iptables on_Authority.crt--wait ache/go/1.25.6/x-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-3a4348b0cdc2 -j DROP si_-_Surum_1.pem git /bin/test e/vcs/af686cb350/usr/bin/git test by/e73e78234ffea--global test -e ot_CA_-_R4.pem /usr/bin/git est blob ca2cd45bfbe11533--wait e/git test (dns block)
  • google.golang.org
    • Triggering command: /update-job-proxy /update-job-proxy -o br-02f9135cd9c8 -j DROP si_-_Surum_1.pem /opt/hostedtoolcache/go/1.25.6/xnat /bin/test by/bb7cbfdba3297/usr/bin/git thority_-_EC1.crconfig k/_temp/copilot---global test -e ot_CA_-_R4.pem k/_temp/copilot-developer-action-e est it config --glob/usr/sbin/iptables on_Authority.crt--wait ache/go/1.25.6/x-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-3a4348b0cdc2 -j DROP si_-_Surum_1.pem git /bin/test e/vcs/af686cb350/usr/bin/git test by/e73e78234ffea--global test -e ot_CA_-_R4.pem /usr/bin/git est blob ca2cd45bfbe11533--wait e/git test (dns block)
  • gopkg.in
    • Triggering command: /update-job-proxy /update-job-proxy -o br-02f9135cd9c8 -j DROP si_-_Surum_1.pem /opt/hostedtoolcache/go/1.25.6/xnat /bin/test by/bb7cbfdba3297/usr/bin/git thority_-_EC1.crconfig k/_temp/copilot---global test -e ot_CA_-_R4.pem k/_temp/copilot-developer-action-e est it config --glob/usr/sbin/iptables on_Authority.crt--wait ache/go/1.25.6/x-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-3a4348b0cdc2 -j DROP si_-_Surum_1.pem git /bin/test e/vcs/af686cb350/usr/bin/git test by/e73e78234ffea--global test -e ot_CA_-_R4.pem /usr/bin/git est blob ca2cd45bfbe11533--wait e/git test (dns block)

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

Copilot AI changed the title [WIP] WIP Address feedback on manifest download implementation Use net/url parsing in parseGitHubUrlNaive to handle fragments and query params Jan 28, 2026
Copilot AI requested a review from trangevi January 28, 2026 23:19
@trangevi
Copy link
Member

@copilot only make changes under azure.ai.agents

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot only make changes under azure.ai.agents

Reverted the unintended changes to other extensions in commit 5cb480f. Now only files under azure.ai.agents are modified.

@trangevi
Copy link
Member

@copilot rebase and make sure you've taken latest updates into account

trangevi and others added 4 commits January 29, 2026 01:44
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot rebase and make sure you've taken latest updates into account

Rebased on the latest base branch in commit 7350aa0. The branch now includes commits 3234ac1 (Address PR comments) and ba5b5cc (Update download directory as well) from the base branch. All tests still pass after the rebase.

@trangevi trangevi marked this pull request as ready for review January 29, 2026 17:52
@trangevi trangevi merged commit 63b959e into trangevi/naive-manifest-download Jan 29, 2026
13 checks passed
trangevi added a commit that referenced this pull request Jan 29, 2026
* Add a naive attempt at downloading

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Use net/url parsing in parseGitHubUrlNaive to handle fragments and query params (#6634)

* Initial plan

* Use net/url parsing to handle query params and fragments in parseGitHubUrlNaive

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Final review completed

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Revert unintended changes to other extensions

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Initial plan

* Rebased on latest base branch

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Co-authored-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Jan 29, 2026
* Add a naive attempt at downloading

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Use net/url parsing in parseGitHubUrlNaive to handle fragments and query params (#6634)

* Initial plan

* Use net/url parsing to handle query params and fragments in parseGitHubUrlNaive

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Final review completed

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Revert unintended changes to other extensions

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Initial plan

* Rebased on latest base branch

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Co-authored-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Jan 29, 2026
* Add a naive attempt at downloading

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Use net/url parsing in parseGitHubUrlNaive to handle fragments and query params (#6634)

* Initial plan

* Use net/url parsing to handle query params and fragments in parseGitHubUrlNaive

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Final review completed

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Revert unintended changes to other extensions

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Initial plan

* Rebased on latest base branch

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Co-authored-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
vhvb1989 added a commit that referenced this pull request Jan 30, 2026
* fix security issue with playwright/test 1.49.1 (#6592)

* Checkpoint from VS Code for cloud agent session

* Update parameter popup border color to cyan in concurX extension

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Complete concurX parameter popup color update

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* cspell

* Remove unintended changes to azure.ai.finetune extension

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* azure.ai.agents - Set `CGO_ENABLED=0` for x64 Linux build (#6611)

* Set CGO_ENABLED=0 for x64 Linux build

* Bump version

* Bump version to 0.1.8-preview (#6613)

* Extension update fixes/enhancements (#6604)

* Clarify extension list latest version column

* Add update availability JSON property and show asterisk besides outdated extensions

* Add upgrade hints to extension list output

* Fix cooldown logic and shallow copy

* Update AGENTS.md

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>

* Fix bicep CLI uninitialized path in container app deployments (#6610)

* fix security issue with playwright/test 1.49.1 (#6592)

* Checkpoint from VS Code for cloud agent session

* Fix bicep CLI initialization by restoring EnsureInstalled calls

- Restore public EnsureInstalled() method in bicep.go
- Remove automatic installation from Build() and BuildBicepParam()
- Add explicit EnsureInstalled() calls in service_target_containerapp.go and bicep_provider.go
- Update all test files to use public EnsureInstalled() method
- Reverts incorrect changes from previous checkpoint commit

This fix follows the same pattern as PR #6593 for GitHub CLI.

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Checkpoint from VS Code for cloud agent session

---------

Co-authored-by: Victor Vazquez <vhvb1989@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Add azure.ai.agent 0.1.8-preview to registry (#6615)

* Release 1.23.2 (#6616)

* Initial plan

* Release 1.23.2

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Increment CLI version after release (#6617)

* Migrate to use new shared eng package (#6600)

* Fix VS Code extension commands failing with undefined fsPath in virtual file systems (#6601)

* Initial plan

* Add defensive checks for undefined fsPath in VS Code extension commands

This fixes the issue where provision and other commands would fail with
"The 'path' argument must be of type string. Received undefined" when
used with virtual file systems or certain VS Code contexts.

Changes:
- Added validation for selectedFile.fsPath before calling getWorkingFolder
- Provides clear error messages that include URI scheme and selectedItem type
- Suppresses automatic issue reporting since this is a user error
- Applied fix to all affected commands: provision, deploy, up, down, restore, monitor, packageCli, and pipelineConfig
- Added unit tests for the new validation logic

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Simplify provision.test.ts based on code review feedback

Removed unused stub functions that weren't actually being used.
Simplified tests to focus on the core validation logic.

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Refactor validation logic into shared utility function

Based on code review feedback:
- Extracted duplicated validation logic to validateFileSystemUri() in cmdUtil.ts
- Updated all 8 command files to use the shared function
- Simplified test assertions
- Improved code maintainability by reducing duplication

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Fix validation to use strict equality check for undefined

Changed condition from `!selectedFile.fsPath` to `selectedFile.fsPath === undefined`
to avoid incorrectly rejecting empty string paths which are valid for root directories.

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Fix l10n.t() to use single string literal instead of concatenation

The first argument to vscode.l10n.t() should be a single string literal
for proper localization tooling compatibility. Removed string concatenation
and used a single multi-line string literal instead.

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* Add missing keys to `azd config options` (#6619)

* Add missing config options

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>

* Raising for missing method type (#6628)

* adding project-endpoint to init command

* adding 12 preview release

* fixig default customization method & adding training type

* correct version

* RFT grader fixes (#6629)

* adding project-endpoint to init command

* adding 12 preview release

* fixig default customization method & adding training type

* correct version

* adding grader to cloning code

* adding missing grader functionality

* merging master

* including .14-preview to main registry (#6630)

* Add a naive attempt at downloading manifest (#6631)

* Add a naive attempt at downloading

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Use net/url parsing in parseGitHubUrlNaive to handle fragments and query params (#6634)

* Initial plan

* Use net/url parsing to handle query params and fragments in parseGitHubUrlNaive

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Final review completed

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Revert unintended changes to other extensions

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Initial plan

* Rebased on latest base branch

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Co-authored-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Dev container feature - allow installing extensions (#6460)

* Add extensions option to the azd devcontainer feature to allow specifying extensions to install

* Review updates

* Revert whitespace changes

* Address feedback on shell script. Add multiple extensions to the test config to validate

* Enable full figspec generation for extensions with metadata capability (#6620)

* Fix indentation

* Add metadata capability checks and improve error handling

* Support dynamic suggestions for `azd config` commands

* Exclude global persistent flags

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>

* Add concurX binary to gitignore

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

* lint

* Update TestAskerConsoleExternalPrompt to use new external prompt mechanism

Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Victor Vazquez <vhvb1989@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Co-authored-by: JeffreyCA <jeffreychen@microsoft.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com>
Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com>
Co-authored-by: Amit Chauhan <70937115+achauhan-scc@users.noreply.github.com>
Co-authored-by: Travis Angevine <trangevi@microsoft.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Co-authored-by: Stuart Leeks <stuartle@microsoft.com>
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.

2 participants