Repository: microsoft/onefuzz
File: src/ApiService/ApiService/Functions/Pool.cs (C#)

Code before:
            Nodes: p.Nodes,
            Config: p.Config,
            WorkQueue: null,
            ScalesetSummary: null);

    private async Task<PoolGetResult> Populate(PoolGetResult p, bool skipSummaries = false) {
        var (queueSas, instanceId, workQueue, scalesetSummary) = await (
            _context.Queue.GetQueueSas("node-heartbeat", StorageType.Config, QueueSasPermissions.Add),
            _context.Containers.GetInstanceId(),
            skipSummaries ? Async.Task.FromResult(new List<WorkSetSummary>()) : _context.PoolOperations.GetWorkQueue(p.PoolId, p.State),
            skipSummaries ? Async.Task.FromResult(new List<ScalesetSummary>()) : _context.PoolOperations.GetScalesetSummary(p.Name));

        return p with {
            WorkQueue = workQueue,
            ScalesetSummary = scalesetSummary,
            Config =
                new AgentConfig(
                    PoolName: p.Name,
                    OneFuzzUrl: _context.Creds.GetInstanceUrl(),
                    InstanceTelemetryKey: _context.ServiceConfiguration.ApplicationInsightsInstrumentationKey,
                    MicrosoftTelemetryKey: _context.ServiceConfiguration.OneFuzzTelemetry,
                    HeartbeatQueue: queueSas,
                    InstanceId: instanceId,
                    ClientCredentials: null,
                    MultiTenantDomain: _context.ServiceConfiguration.MultiTenantDomain,
                    IsUnmanaged: !p.Managed)
        };
    }
}


Review comment (suggestion):
I know managed is our current default which is why you added IsUnmanaged but I think it'll be easier to reason about in the future if we do `IsManaged`. Specifically, to avoid the double negative with `!IsUnmanaged`.

Code after:
            Nodes: p.Nodes,
            Config: p.Config,
            WorkQueue: null,
            ScalesetSummary: null);

    private async Task<PoolGetResult> Populate(PoolGetResult p, bool skipSummaries = false) {
        var (queueSas, instanceId, workQueue, scalesetSummary) = await (
            _context.Queue.GetQueueSas("node-heartbeat", StorageType.Config, QueueSasPermissions.Add),
            _context.Containers.GetInstanceId(),
            skipSummaries ? Async.Task.FromResult(new List<WorkSetSummary>()) : _context.PoolOperations.GetWorkQueue(p.PoolId, p.State),
            skipSummaries ? Async.Task.FromResult(new List<ScalesetSummary>()) : _context.PoolOperations.GetScalesetSummary(p.Name));

        return p with {
            WorkQueue = workQueue,
            ScalesetSummary = scalesetSummary,
            Config =
                new AgentConfig(
                    PoolName: p.Name,
                    OneFuzzUrl: _context.Creds.GetInstanceUrl(),
                    InstanceTelemetryKey: _context.ServiceConfiguration.ApplicationInsightsInstrumentationKey,
                    MicrosoftTelemetryKey: _context.ServiceConfiguration.OneFuzzTelemetry,
                    HeartbeatQueue: queueSas,
                    InstanceId: instanceId,
                    ClientCredentials: null,
                    MultiTenantDomain: _context.ServiceConfiguration.MultiTenantDomain,
                    Managed: p.Managed)
        };
    }
}