<commit_before>{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:

let generic = { channel, version, sha256, vendorSha256 }:
  buildGoModule rec {
    pname = "linkerd-${channel}";
    inherit version vendorSha256;

    src = fetchFromGitHub {
      owner = "linkerd";
      repo = "linkerd2";
      rev = "${channel}-${version}";
      inherit sha256;
    };

    subPackages = [ "cli" ];
    runVend = true;

    preBuild = ''
      env GOFLAGS="" go generate ./pkg/charts/static
      env GOFLAGS="" go generate ./jaeger/static
      env GOFLAGS="" go generate ./multicluster/static
      env GOFLAGS="" go generate ./viz/static
    '';

    tags = [
      "prod"
    ];

    ldflags = [
      "-s" "-w"
      "-X github.com/linkerd/linkerd2/pkg/version.Version=${src.rev}"
    ];

    nativeBuildInputs = [ installShellFiles ];

    postInstall = ''
      mv $out/bin/cli $out/bin/linkerd
      installShellCompletion --cmd linkerd \
        --bash <($out/bin/linkerd completion bash) \
        --zsh <($out/bin/linkerd completion zsh) \
        --fish <($out/bin/linkerd completion fish)
    '';

    doInstallCheck = true;
    installCheckPhase = ''
      $out/bin/linkerd version --client | grep ${src.rev} > /dev/null
    '';

    meta = with lib; {
      description = "A simple Kubernetes service mesh that improves security, observability and reliability";
      downloadPage = "https://github.com/linkerd/linkerd2/";
      homepage = "https://linkerd.io/";
      license = licenses.asl20;
      maintainers = with maintainers; [ Gonzih bryanasdev000 superherointj ];
    };
  };
in
  {
    stable = generic {
      channel = "stable";
      version = "2.10.2";
      sha256 = "sha256-dOD0S4FJ2lXE+1VZooi8tKvC8ndGEHAxmAvSqoWI/m0=";
      vendorSha256 = "sha256-Qb0FZOvKL9GgncfUl538PynkYbm3V8Q6lUpApUoIp5s=";
    };
    edge = generic {
      channel = "edge";
      version = "21.7.4";
      sha256 = "sha256-yorxP4SQVV6MWlx8+8l0f7qOaF7aJ1XiPfnMqKC8m/o=";
      vendorSha256 = "sha256-2ZDsBiIV9ng8P0cDURbqDqMTxFKUFcBxHsPGWp5WjPo=";
    };
  }<commit_msg>linkerd_edge: 21.7.4 -> 21.8.2<commit_after>{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:

let generic = { channel, version, sha256, vendorSha256 }:
  buildGoModule rec {
    pname = "linkerd-${channel}";
    inherit version vendorSha256;

    src = fetchFromGitHub {
      owner = "linkerd";
      repo = "linkerd2";
      rev = "${channel}-${version}";
      inherit sha256;
    };

    subPackages = [ "cli" ];
    runVend = true;

    preBuild = ''
      env GOFLAGS="" go generate ./pkg/charts/static
      env GOFLAGS="" go generate ./jaeger/static
      env GOFLAGS="" go generate ./multicluster/static
      env GOFLAGS="" go generate ./viz/static
    '';

    tags = [
      "prod"
    ];

    ldflags = [
      "-s" "-w"
      "-X github.com/linkerd/linkerd2/pkg/version.Version=${src.rev}"
    ];

    nativeBuildInputs = [ installShellFiles ];

    postInstall = ''
      mv $out/bin/cli $out/bin/linkerd
      installShellCompletion --cmd linkerd \
        --bash <($out/bin/linkerd completion bash) \
        --zsh <($out/bin/linkerd completion zsh) \
        --fish <($out/bin/linkerd completion fish)
    '';

    doInstallCheck = true;
    installCheckPhase = ''
      $out/bin/linkerd version --client | grep ${src.rev} > /dev/null
    '';

    meta = with lib; {
      description = "A simple Kubernetes service mesh that improves security, observability and reliability";
      downloadPage = "https://github.com/linkerd/linkerd2/";
      homepage = "https://linkerd.io/";
      license = licenses.asl20;
      maintainers = with maintainers; [ Gonzih bryanasdev000 superherointj ];
    };
  };
in
  {
    stable = generic {
      channel = "stable";
      version = "2.10.2";
      sha256 = "sha256-dOD0S4FJ2lXE+1VZooi8tKvC8ndGEHAxmAvSqoWI/m0=";
      vendorSha256 = "sha256-Qb0FZOvKL9GgncfUl538PynkYbm3V8Q6lUpApUoIp5s=";
    };
    edge = generic {
      channel = "edge";
      version = "21.8.2";
      sha256 = "sha256-jMYJ/mLWvuje4ZRuRbzMaqhz8kyn1bYGITJxkyw5Fyg=";
      vendorSha256 = "sha256-18QB2GOxHfnP4GQaF0aohY5kEOg0xN/c+Sp33Ww/1uQ=";
    };
  }
{'fraction_non_alphanumeric': 0.13805522208883553, 'fraction_numerical': 0.041296518607442975, 'mean_word_length': 2.5698371893744643, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 6, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '253134', 'n_tokens_mistral': 1619, 'n_tokens_neox': 1495, 'n_words': 278}