Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
383d447
Add support for fileSystem based br/ module aliases
SimonWahlin Apr 15, 2026
07a8148
Add baseline for emulated br alias
SimonWahlin Apr 16, 2026
9838910
Update integration tests
SimonWahlin Apr 19, 2026
ebdae41
Add check for OCI-compliant modulePath
SimonWahlin Apr 19, 2026
6eab145
Rename FileSystemModuleRegistry to OciArtifactEmulatedRegistry and ad…
SimonWahlin Apr 19, 2026
3b0268b
Require bicepconfig for feature OciEmulatedModuleAlias and only accep…
SimonWahlin Apr 20, 2026
7ec58bb
Update bicepconfig schema with fileSystem property for ModuleAlias
SimonWahlin Apr 20, 2026
2a840e4
Improve rewrite of original module alias
SimonWahlin May 3, 2026
d0cd296
Remove unused using
SimonWahlin May 3, 2026
89de8ee
Add support for absolute paths for module aliases
SimonWahlin May 4, 2026
c2a33be
Merge branch 'main' into OciArtifactEmulation
SimonWahlin May 4, 2026
ab422c1
Move configuration to ModuleAliasMock
SimonWahlin Jun 3, 2026
b5a6494
Rename anything Emulated to Mocked
SimonWahlin Jun 3, 2026
3102064
Cleanup ts: references since template specs are not supported for mocks
SimonWahlin Jun 5, 2026
f2a5dc1
Use reference to constant instead of hard-coded value.
SimonWahlin Jun 5, 2026
2a5465b
Fix serialization of moduleAliasMock outputting ts property
SimonWahlin Jun 6, 2026
52604c6
moduleAliasMock does not use modulePath, remove it from schema
SimonWahlin Jun 6, 2026
5473b5a
Add ModuleAliasMock to test configuration
SimonWahlin Jun 6, 2026
690c326
Update baselines
SimonWahlin Jun 6, 2026
9a1b981
Split ModuleAliasesMockConfiguration from ModuleAliasesConfiguration …
SimonWahlin Jun 12, 2026
db7c511
Merge branch 'main' into OciArtifactEmulation
SimonWahlin Jun 12, 2026
d5406d6
Clean up unused code
SimonWahlin Jun 13, 2026
1e62f76
Remove methods made redundant
SimonWahlin Jun 14, 2026
b5ba533
Merge branch 'main' into OciArtifactEmulation
SimonWahlin Jun 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Bicep.Core.IntegrationTests/RegistryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public async Task InvalidRootCachePathShouldProduceReasonableErrors()
var compilation = await compiler.CreateCompilation(fileUri.ToIOUri());

var diagnostics = compilation.GetAllDiagnosticsByBicepFile();
diagnostics.Should().HaveCount(1);
diagnostics.Should().HaveCount(2);
var expectedErrorMessage = "Unable to restore the artifact with reference \"{0}\": Unable to create the local artifact directory \"";
diagnostics.Single().Value.ExcludingLinterDiagnostics().Should().SatisfyRespectively(
diagnostics[compilation.SourceFileGrouping.EntryPoint].ExcludingLinterDiagnostics().Should().SatisfyRespectively(
Comment thread
SimonWahlin marked this conversation as resolved.
x =>
{
x.Level.Should().Be(DiagnosticLevel.Error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"demo-two": {
"registry": "mock-registry-two.invalid",
"modulePath": "demo"
},
"mock-registry-emulated": {
"fileSystem": "Publish"
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion src/Bicep.Core.Samples/Files/baselines/Registry_LF/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
name: 'planDeploy3'
scope: rg
params: {
namePrefix: 'hello'
}
}

var websites = [
{
name: 'fancy'
Expand Down Expand Up @@ -130,4 +138,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
params: {
ipv6port: 'test'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
name: 'planDeploy3'
scope: rg
params: {
namePrefix: 'hello'
}
}

var websites = [
{
name: 'fancy'
Expand Down Expand Up @@ -132,3 +140,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
ipv6port: 'test'
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
name: 'planDeploy3'
scope: rg
params: {
namePrefix: 'hello'
}
}

var websites = [
{
name: 'fancy'
Expand Down
22 changes: 21 additions & 1 deletion src/Bicep.Core.Samples/Files/baselines/Registry_LF/main.ir.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
targetScope = 'subscription'
//@[000:2463) ProgramExpression
//@[000:2603) ProgramExpression
//@[000:0000) | └─ResourceDependencyExpression [UNPARENTED]
//@[000:0000) | └─ResourceReferenceExpression [UNPARENTED]
//@[000:0000) | └─ResourceDependencyExpression [UNPARENTED]
//@[000:0000) | └─ResourceReferenceExpression [UNPARENTED]
//@[000:0000) | └─ResourceDependencyExpression [UNPARENTED]
Expand Down Expand Up @@ -74,6 +76,23 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
//@[000:0137) ├─DeclaredModuleExpression
//@[060:0137) | ├─ObjectExpression
name: 'planDeploy3'
//@[002:0021) | | └─ObjectPropertyExpression
//@[002:0006) | | ├─StringLiteralExpression { Value = name }
//@[008:0021) | | └─StringLiteralExpression { Value = planDeploy3 }
scope: rg
params: {
//@[010:0039) | ├─ObjectExpression
namePrefix: 'hello'
//@[004:0023) | | └─ObjectPropertyExpression
//@[004:0014) | | ├─StringLiteralExpression { Value = namePrefix }
//@[016:0023) | | └─StringLiteralExpression { Value = hello }
}
}

var websites = [
//@[000:0110) ├─DeclaredVariableExpression { Name = websites }
//@[015:0110) | └─ArrayExpression
Expand Down Expand Up @@ -374,3 +393,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
//@[014:0020) | | └─StringLiteralExpression { Value = test }
}
}

63 changes: 62 additions & 1 deletion src/Bicep.Core.Samples/Files/baselines/Registry_LF/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "16097344762357511977"
"templateHash": "11340138247578714789"
}
},
"variables": {
Expand Down Expand Up @@ -159,6 +159,67 @@
"[subscriptionResourceId('Microsoft.Resources/resourceGroups', 'adotfrank-rg')]"
]
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2025-04-01",
"name": "planDeploy3",
"resourceGroup": "adotfrank-rg",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"namePrefix": {
"value": "hello"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "15019246960605065046"
}
},
"parameters": {
"namePrefix": {
"type": "string"
},
"sku": {
"type": "string",
"defaultValue": "B1"
}
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-06-01",
"name": "[format('{0}appPlan', parameters('namePrefix'))]",
"location": "[resourceGroup().location]",
"kind": "linux",
"sku": {
"name": "[parameters('sku')]"
},
"properties": {
"reserved": true
}
}
],
"outputs": {
"planId": {
"type": "string",
"value": "[resourceId('Microsoft.Web/serverfarms', format('{0}appPlan', parameters('namePrefix')))]"
}
}
}
},
"dependsOn": [
"[subscriptionResourceId('Microsoft.Resources/resourceGroups', 'adotfrank-rg')]"
]
},
{
"copy": {
"name": "siteDeploy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,75 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
//@ {
//@ "type": "Microsoft.Resources/deployments",
//@ "apiVersion": "2025-04-01",
//@ "resourceGroup": "adotfrank-rg",
//@ "properties": {
//@ "expressionEvaluationOptions": {
//@ "scope": "inner"
//@ },
//@ "mode": "Incremental",
//@ "template": {
//@ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
//@ "contentVersion": "1.0.0.0",
//@ "metadata": {
//@ "_generator": {
//@ "name": "bicep",
//@ "version": "dev",
//@ "templateHash": "15019246960605065046"
//@ }
//@ },
//@ "parameters": {
//@ "namePrefix": {
//@ "type": "string"
//@ },
//@ "sku": {
//@ "type": "string",
//@ "defaultValue": "B1"
//@ }
//@ },
//@ "resources": [
//@ {
//@ "type": "Microsoft.Web/serverfarms",
//@ "apiVersion": "2020-06-01",
//@ "name": "[format('{0}appPlan', parameters('namePrefix'))]",
//@ "location": "[resourceGroup().location]",
//@ "kind": "linux",
//@ "sku": {
//@ "name": "[parameters('sku')]"
//@ },
//@ "properties": {
//@ "reserved": true
//@ }
//@ }
//@ ],
//@ "outputs": {
//@ "planId": {
//@ "type": "string",
//@ "value": "[resourceId('Microsoft.Web/serverfarms', format('{0}appPlan', parameters('namePrefix')))]"
//@ }
//@ }
//@ }
//@ },
//@ "dependsOn": [
//@ "[subscriptionResourceId('Microsoft.Resources/resourceGroups', 'adotfrank-rg')]"
//@ ]
//@ },
name: 'planDeploy3'
//@ "name": "planDeploy3",
scope: rg
params: {
//@ "parameters": {
//@ },
namePrefix: 'hello'
//@ "namePrefix": {
//@ "value": "hello"
//@ }
}
}

var websites = [
//@ "websites": [
//@ ],
Expand Down Expand Up @@ -780,3 +849,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
//@ }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "3717084932040700305"
"templateHash": "17302964314594708830"
}
},
"variables": {
Expand Down Expand Up @@ -162,6 +162,68 @@
"rg"
]
},
"appPlanDeploy3": {
"type": "Microsoft.Resources/deployments",
"apiVersion": "2025-04-01",
"name": "planDeploy3",
"resourceGroup": "adotfrank-rg",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"namePrefix": {
"value": "hello"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"languageVersion": "2.0",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "13508561622047952911"
}
},
"parameters": {
"namePrefix": {
"type": "string"
},
"sku": {
"type": "string",
"defaultValue": "B1"
}
},
"resources": {
"appPlan": {
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-06-01",
"name": "[format('{0}appPlan', parameters('namePrefix'))]",
"location": "[resourceGroup().location]",
"kind": "linux",
"sku": {
"name": "[parameters('sku')]"
},
"properties": {
"reserved": true
}
}
},
"outputs": {
"planId": {
"type": "string",
"value": "[resourceId('Microsoft.Web/serverfarms', format('{0}appPlan', parameters('namePrefix')))]"
}
}
}
},
"dependsOn": [
"rg"
]
},
"siteDeploy": {
"copy": {
"name": "siteDeploy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
//@[07:21) Module appPlanDeploy3. Type: module. Declaration start char: 0, length: 137
name: 'planDeploy3'
scope: rg
params: {
namePrefix: 'hello'
}
}

var websites = [
//@[04:12) Variable websites. Type: [object, object]. Declaration start char: 0, length: 110
{
Expand Down Expand Up @@ -152,3 +161,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
ipv6port: 'test'
}
}

Loading
Loading