solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy

Home Page:https://docs.solo.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Homebrew tests will not pass due to glooctl version output change

jbohanon opened this issue · comments

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

#9212

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

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

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

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?