solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
https://docs.solo.io/
Apache License 2.0
4.04k stars 431 forks source link

Homebrew tests will not pass due to glooctl version output change #9301

Closed jbohanon closed 1 week ago

jbohanon commented 3 months ago

Gloo Edge Product

Open Source

Gloo Edge Version

v1.17.0

Kubernetes Version

All

Describe the bug

Glooctl will not be able to be published to homebrew once 1.17 goes stable because our formula asserts on the version output (link)

Expected Behavior

Glooctl should be published to homebrew

Steps to reproduce the bug

Clone homebrew/homebrew-core Apply patch:

diff --git a/Formula/g/glooctl.rb b/Formula/g/glooctl.rb
index 37d91cc4eab..cb324a5f876 100644
--- a/Formula/g/glooctl.rb
+++ b/Formula/g/glooctl.rb
@@ -4,15 +4,15 @@ class Glooctl < Formula
   # NOTE: Please wait until the newest stable release is finished building and
   # no longer marked as "Pre-release" before creating a PR for a new version.
   url "https://github.com/solo-io/gloo.git",
-      tag:      "v1.16.9",
-      revision: "85aea1e3b3a43bd937d0dc75c50f5f4624f9698b"
+      tag:      "v1.17.0-beta15",
+      revision: "2e96155a029243d2de6f4973e824300097f8897a"
   license "Apache-2.0"
-  head "https://github.com/solo-io/gloo.git", branch: "master"
+  head "https://github.com/solo-io/gloo.git", branch: "main"

-  livecheck do
-    url :stable
-    regex(/^v?(\d+(?:\.\d+)+)$/i)
-  end
+  # livecheck do
+  #   url :stable
+  #   regex(/^v?(\d+(?:\.\d+)+)$/i)
+  # end

   bottle do
     sha256 cellar: :any_skip_relocation, arm64_sonoma:   "ae52c4b863ead30680b4f0d75810d0ae2bab4d067a55075c5775c934839ab6fb"
brew install --HEAD -s Formula/g/glooctl.rb
brew test glooctl
==> Testing glooctl
==> /home/linuxbrew/.linuxbrew/Cellar/glooctl/HEAD-2e96155/bin/glooctl 2>&1
==> /home/linuxbrew/.linuxbrew/Cellar/glooctl/HEAD-2e96155/bin/glooctl version 2>&1
Error: glooctl: failed
An exception occurred within a child process:
  Minitest::Assertion: Expected /Client:\ \{"version":"HEAD\-2e96155"\}/ to match "Warning: Could not determine gloo server versions (is Gloo running outside of kubernetes?): invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable\nServer: version undefined, could not find any version of gloo running\n\n{\n  \"client\": {\n    \"version\": \"HEAD-2e96155\"\n  }\n}".

Additional Environment Detail

No response

Additional Context

https://github.com/solo-io/gloo/pull/9212

jbohanon commented 3 months ago

The following diff should be applied when Gloo Edge 1.17.0 is released in order to fix the string matching

diff --git a/Formula/g/glooctl.rb b/Formula/g/glooctl.rb
index 37d91cc4eab..f6e98695a42 100644
--- a/Formula/g/glooctl.rb
+++ b/Formula/g/glooctl.rb
@@ -7,7 +7,7 @@ class Glooctl < Formula
       tag:      "v1.16.9",
       revision: "85aea1e3b3a43bd937d0dc75c50f5f4624f9698b"
   license "Apache-2.0"
-  head "https://github.com/solo-io/gloo.git", branch: "master"
+  head "https://github.com/solo-io/gloo.git", branch: "main"

   livecheck do
     url :stable
@@ -35,10 +35,10 @@ class Glooctl < Formula

   test do
     run_output = shell_output("#{bin}/glooctl 2>&1")
-    assert_match "glooctl is the unified CLI for Gloo.", run_output
+    assert_match "glooctl is the unified CLI for Gloo Edge.", run_output

     version_output = shell_output("#{bin}/glooctl version 2>&1")
-    assert_match "Client: {\"version\":\"#{version}\"}", version_output
+    assert_match "\"client\": {\n    \"version\": \"#{version}\"\n  }\n}", version_output
     assert_match "Server: version undefined", version_output

     # Should error out as it needs access to a Kubernetes cluster to operate correctly
jbohanon commented 3 months ago

I have confirmed that the homebrew bumps are handled by the homebrew repo and not by our code anymore. The GitHub Action is here and glooctl is on the autobump list here

sam-heilbron commented 1 month ago

I have opened a thread with the product team (private slack ref). I'm marking it as a release-blocker until we decide, and assigning it to Duncan so it's not lost

DuncanDoyle commented 1 month ago

I'll remove the release blocker tag, mark it for release/1.17. @sam-heilbron Is there an (easy) fix for this, and if so, what's the estimated effort. Any concerns wrt supporting homebrew in the future?

jbohanon commented 1 week ago

Failing PR https://github.com/Homebrew/homebrew-core/pull/177429

with expected CI output

An exception occurred within a child process:
    Minitest::Assertion: Expected /Client:\ \{"version":"1\.17\.0"\}/ to match "Warning: Could not determine gloo server versions (is Gloo running outside of kubernetes?): invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable\nServer: version undefined, could not find any version of gloo running\n\n{\n  \"client\": {\n    \"version\": \"1.17.0\"\n  }\n}".
jbohanon commented 1 week ago

New PR https://github.com/Homebrew/homebrew-core/pull/177508

jbohanon commented 1 week ago

The linked PR is merged so this should be resolved