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

Change format of requests to show module sources #12351

Merged
merged 8 commits into from
Nov 13, 2023

Conversation

StephenWeatherford
Copy link
Contributor

@StephenWeatherford StephenWeatherford commented Nov 4, 2023

Doing this because:

  1. want easier way to change the title of a source document displayed in vscode
  2. local cache file path that's currently in the URI is not needed
  3. need to be able to request a specific file from the module source zip

Old format of the URI we send to vscode to display the source of a module (unencoded):
bicep-cache:{fullyQualifiedReference}#{localCacheFullPath}

Example:
bicep-cache:br:myregistry.azurecr.io/myrepo:v1#/Users/MyUserName/.bicep/br/registry.azurecr.io/myrepo/v1$/entrypoint.bicep

New format (unencoded):
bicep-extsrc:{title-to-display-for-document}?{fullyQualifiedReference}#{source-file-to-retrieve-relative-path}

Example:
bicep-extsrc:br:myregistry.azurecr.io/myrepo:main.bicep (v1)?br:myregistry.azurecr.io/myrepo:v1#main.bicep

No fragment in URI if just requesting the main.json file

Also changed other names, like:
BicepRegistryCacheRequestHandler -> BicepExternalSourceRequestHandler

Example of source document titles (exact format still being decided):
imageimage

Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

github-actions bot commented Nov 4, 2023

Test this change out locally with the following install scripts (Action run 6856854941)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 6856854941
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 6856854941"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 6856854941
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 6856854941"

return Task.FromResult(new BicepExternalSourceResponse(contents));
}

/// <summary>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new code

@@ -0,0 +1,140 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

most of this file same as renamed file except name changes

Copy link
Contributor

github-actions bot commented Nov 4, 2023

Test Results

     132 files  ±    0       132 suites  ±0   5h 13m 9s ⏱️ - 26m 37s
10 846 tests +163  10 846 ✔️ +163  0 💤 ±0  0 ±0 
52 307 runs  +680  52 307 ✔️ +680  0 💤 ±0  0 ±0 

Results for commit 009e1d7. ± Comparison against base commit b02de2d.

♻️ This comment has been updated with latest results.

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.

None yet

2 participants