From 16922f0ebae73c82729e17e711f379e4e2be14be Mon Sep 17 00:00:00 2001 From: Alex Plischke Date: Wed, 4 Dec 2024 07:24:34 -0800 Subject: [PATCH 1/2] fix: nil pointer in saucectl configure command --- internal/cmd/configure/cmd.go | 1 - internal/usage/client.go | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/cmd/configure/cmd.go b/internal/cmd/configure/cmd.go index 44dec2b3b..0ad1eab60 100644 --- a/internal/cmd/configure/cmd.go +++ b/internal/cmd/configure/cmd.go @@ -41,7 +41,6 @@ func Command() *cobra.Command { go func() { tracker.Collect( cmds.FullName(cmd), - nil, ) _ = tracker.Close() }() diff --git a/internal/usage/client.go b/internal/usage/client.go index be2b6564e..945815fff 100644 --- a/internal/usage/client.go +++ b/internal/usage/client.go @@ -73,7 +73,9 @@ func (c *Client) Collect(subject string, opts ...Option) { Set("ci", ci.GetProvider().Name) for _, opt := range opts { - opt(p) + if opt != nil { + opt(p) + } } userID := credentials.Get().Username From 60f6cca1a7bb8bdd34f6d734372c675c817b1384 Mon Sep 17 00:00:00 2001 From: Alex Plischke Date: Wed, 4 Dec 2024 07:34:58 -0800 Subject: [PATCH 2/2] ci: test saucectl configure e2e --- .github/workflows/test.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b56db134c..c24ec833f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -106,6 +106,25 @@ jobs: saucectl saucectl.exe + test-configure: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Download saucectl Binary + uses: actions/download-artifact@v4 + with: + name: saucectlbin + + - name: Set Permissions + run: chmod +x ./saucectl + + - name: Saucectl Configure + run: ./saucectl configure -u $SAUCE_USERNAME -a $SAUCE_ACCESS_KEY + puppeteer-replay: needs: build runs-on: ubuntu-latest