Repository: microsoft/onefuzz
File: src/ApiService/ApiService/onefuzzlib/notifications/GithubIssues.cs (C#)

Code before:
﻿using Microsoft.Extensions.Logging;
using Octokit;
namespace Microsoft.OneFuzz.Service;

public interface IGithubIssues {
    Async.Task GithubIssue(GithubIssuesTemplate config, Container container, IReport reportable, Guid notificationId, Uri instanceUrl);
}

public class GithubIssues : NotificationsBase, IGithubIssues {

    public GithubIssues(ILogger<GithubIssues> logTracer, IOnefuzzContext context)
    : base(logTracer, context) { }

    public async Async.Task GithubIssue(GithubIssuesTemplate config, Container container, IReport reportable, Guid notificationId, Uri instanceUrl) {
        var filename = reportable.FileName();

        if (reportable is RegressionReport) {
            _logTracer.LogInformation("github issue integration does not support regression reports. {Container} - {Filename}", container, filename);
            return;
        }

        var report = (Report)reportable;

        try {
            await Process(config, container, filename, config.Title, report, instanceUrl);
        } catch (ApiException e) {
            await LogFailedNotification(report, e, notificationId);
        }
    }

    public static async Async.Task<OneFuzzResultVoid> Validate(GithubIssuesTemplate config) {
        // Validate PAT is valid
        GitHubClient gh;
        if (config.Auth.Secret is SecretValue<GithubAuth> auth) {
            try {
                gh = GetGitHubClient(auth.Value.User, auth.Value.PersonalAccessToken);
                var _ = await gh.User.Get(auth.Value.User);
            } catch (Exception e) {
                return OneFuzzResultVoid.Error(ErrorCode.GITHUB_VALIDATION_INVALID_PAT, new string[] {

Review comment (suggestion):
You have access to `_context` in this function so we don't need to change the signature. You can get the isntanceUrl the same way you got it in notificationoperations by doing `_context.Creds.GetInstanceUrl()`

Code after:
﻿using Microsoft.Extensions.Logging;
using Octokit;
namespace Microsoft.OneFuzz.Service;

public interface IGithubIssues {
    Async.Task GithubIssue(GithubIssuesTemplate config, Container container, IReport reportable, Guid notificationId);
}

public class GithubIssues : NotificationsBase, IGithubIssues {

    public GithubIssues(ILogger<GithubIssues> logTracer, IOnefuzzContext context)
    : base(logTracer, context) { }

    public async Async.Task GithubIssue(GithubIssuesTemplate config, Container container, IReport reportable, Guid notificationId) {
        var filename = reportable.FileName();

        if (reportable is RegressionReport) {
            _logTracer.LogInformation("github issue integration does not support regression reports. {Container} - {Filename}", container, filename);
            return;
        }

        var report = (Report)reportable;

        try {
            await Process(config, container, filename, config.Title, report, _context.Creds.GetInstanceUrl());
        } catch (ApiException e) {
            await LogFailedNotification(report, e, notificationId);
        }
    }

    public static async Async.Task<OneFuzzResultVoid> Validate(GithubIssuesTemplate config) {
        // Validate PAT is valid
        GitHubClient gh;
        if (config.Auth.Secret is SecretValue<GithubAuth> auth) {
            try {
                gh = GetGitHubClient(auth.Value.User, auth.Value.PersonalAccessToken);
                var _ = await gh.User.Get(auth.Value.User);
            } catch (Exception e) {
                return OneFuzzResultVoid.Error(ErrorCode.GITHUB_VALIDATION_INVALID_PAT, new string[] {