Skip to content

Commit

Permalink
CodeFix: Remove relative path prefix from types loading (#12026)
Browse files Browse the repository at this point in the history
## Description

The current implementation makes the wrong assumption that the key names
indexed in the types cache have a prefix `./`. This was the case when I
was using a dev artifact since the publishing logic wasn't ready.

Now that we have a publishing logic for the types package we can fix the
code so that it doesn't assume the `./` prefix is found in the files as
proven by
https://github.com/Azure/bicep-types-az/actions/runs/6398352791/job/17368317634.

This PR should be merged before
Azure/bicep-types-az#1553, and
Azure/bicep-types-az#1553 should be updated to
download the latest build from the `main` branch.

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/12026)

---------

Co-authored-by: Ariel Silverman <[email protected]>
  • Loading branch information
asilverman and Ariel Silverman authored Oct 4, 2023
1 parent 3b5f245 commit d62b94d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
"build",
"${file}"
],
"env": {
"BICEP_TRACING_ENABLED": "true",
// "BICEP_REGISTRY_FQDN": "your-registry-here.azurecr.io"
},
"env": {
"BICEP_TRACING_ENABLED": "true"
},
"cwd": "${workspaceFolder}/src/Bicep.Cli",
"console": "internalConsole",
"stopAtEntry": false
Expand All @@ -51,7 +50,7 @@
"${file}"
],
"env": {
"BICEP_TRACING_ENABLED": "true"
"BICEP_TRACING_ENABLED": "true",
},
"cwd": "${workspaceFolder}/src/Bicep.Cli",
"console": "internalConsole",
Expand Down
2 changes: 1 addition & 1 deletion src/Bicep.Core/TypeSystem/Az/OciAzTypeLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static OciAzTypeLoader FromTgz(string pathToGzip)

protected override Stream GetContentStreamAtPath(string path)
{
if (this.typesCache.TryGetValue($"./{path}", out var bytes))
if (this.typesCache.TryGetValue($"{path}", out var bytes))
{
return new MemoryStream(bytes);
}
Expand Down

0 comments on commit d62b94d

Please sign in to comment.