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

Only add an explicit dependency on an existing resource when the deployments engine will use the GET response #15693

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/Bicep.Cli/Rpc/CliJsonRpcServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public async Task<GetDeploymentGraphResponse> GetDeploymentGraph(GetDeploymentGr
{
var compilation = await GetCompilation(compiler, request.Path);
var model = compilation.GetEntrypointSemanticModel();
var dependenciesBySymbol = ResourceDependencyVisitor.GetResourceDependencies(model, new() { IncludeExisting = true })
var dependenciesBySymbol = ResourceDependencyVisitor.GetResourceDependencies(model)
.Where(x => !x.Key.Type.IsError())
.ToImmutableDictionary(x => x.Key, x => x.Value);

Expand All @@ -200,7 +200,7 @@ public async Task<GetDeploymentGraphResponse> GetDeploymentGraph(GetDeploymentGr
foreach (var (symbol, dependencies) in dependenciesBySymbol)
{
var source = nodesBySymbol.TryGetValue(symbol);
foreach (var dependency in dependencies.Where(d => d.Kind == ResourceDependencyKind.Primary))
foreach (var dependency in dependencies)
{
var target = nodesBySymbol.TryGetValue(dependency.Resource);
if (source is { } && target is { })
Expand Down
Loading