Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

[Breaking Change] Deploy with scriban only turned on #2809

Merged
merged 3 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/ApiService/ApiService/Functions/ValidateScriban.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public Async.Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymou
reportContainer,
reportFileName,
report,
_log,
task,
job,
targetUrl,
Expand Down
2 changes: 1 addition & 1 deletion src/ApiService/ApiService/onefuzzlib/notifications/Ado.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ sealed class AdoConnector {
private readonly Uri _instanceUrl;
private readonly ILogTracer _logTracer;
public static async Async.Task<AdoConnector> AdoConnectorCreator(IOnefuzzContext context, Container container, string filename, AdoTemplate config, Report report, ILogTracer logTracer, Renderer? renderer = null) {
renderer ??= await Renderer.ConstructRenderer(context, container, filename, report);
renderer ??= await Renderer.ConstructRenderer(context, container, filename, report, logTracer);
var instanceUrl = context.Creds.GetInstanceUrl();
var project = await renderer.Render(config.Project, instanceUrl);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Async.Task GithubIssue(GithubIssuesTemplate config, Container conta
}

private async Async.Task Process(GithubIssuesTemplate config, Container container, string filename, Report report) {
var renderer = await Renderer.ConstructRenderer(_context, container, filename, report);
var renderer = await Renderer.ConstructRenderer(_context, container, filename, report, _logTracer);
var handler = await GithubConnnector.GithubConnnectorCreator(config, container, filename, renderer, _context.Creds.GetInstanceUrl(), _context, _logTracer);
await handler.Process();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static async Async.Task<Renderer> ConstructRenderer(
Container container,
string filename,
Report report,
ILogTracer log,
Task? task = null,
Job? job = null,
Uri? targetUrl = null,
Expand Down Expand Up @@ -76,7 +77,10 @@ public static async Async.Task<Renderer> ConstructRenderer(
}

await context.ConfigurationRefresher.TryRefreshAsync().IgnoreResult();
var scribanOnly = scribanOnlyOverride ?? await context.FeatureManagerSnapshot.IsEnabledAsync(FeatureFlagConstants.EnableScribanOnly);
var scribanOnlyFeatureFlag = await context.FeatureManagerSnapshot.IsEnabledAsync(FeatureFlagConstants.EnableScribanOnly);
log.Info($"ScribanOnlyFeatureFlag: {scribanOnlyFeatureFlag}");

var scribanOnly = scribanOnlyOverride ?? scribanOnlyFeatureFlag;

return new Renderer(
container,
Expand Down
15 changes: 14 additions & 1 deletion src/deployment/bicep-templates/feature-flags.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,22 @@ var appConfigName = 'app-config-${suffix}'
resource featureFlags 'Microsoft.AppConfiguration/configurationStores@2022-05-01' = {
name: appConfigName
location: location
sku:{
sku: {
name: 'standard'
}
}

resource configStoreFeatureflag 'Microsoft.AppConfiguration/configurationStores/keyValues@2021-10-01-preview' = {
parent: featureFlags
name: '.appconfig.featureflag~2FEnableScribanOnly'
properties: {
value: string({
id: 'EnableScribanOnly'
description: 'Render notification templates with scriban only'
enabled: true
})
contentType: 'application/vnd.microsoft.appconfig.ff+json;charset=utf-8'
}
}

output AppConfigEndpoint string = 'https://${appConfigName}.azconfig.io'