From e7e319f5e5cfb7473dda5b3152cb2c26859a76bb Mon Sep 17 00:00:00 2001 From: Adrian Clay Lake Date: Tue, 20 Aug 2024 12:00:27 +0200 Subject: [PATCH] fix: cli-client paths --- .github/workflows/_CLI-Client.yaml | 8 ++++---- .github/workflows/_Test-OCI-Factory.yaml | 2 +- README.md | 4 ++-- tools/cli-client/README.md | 2 +- tools/cli-client/cmd/oci-factory/main.go | 4 ++-- tools/cli-client/go.mod | 2 +- tools/cli-client/internals/cli/cli_upload.go | 4 ++-- tools/cli-client/internals/cli/cli_upload_test.go | 2 +- tools/cli-client/internals/cli/validator_test.go | 2 +- tools/cli-client/internals/client/client.go | 2 +- tools/cli-client/internals/client/client_test.go | 4 ++-- tools/cli-client/internals/client/wf_dispatcher.go | 4 ++-- tools/cli-client/internals/client/wf_dispatcher_test.go | 4 ++-- tools/cli-client/internals/client/wf_poller.go | 2 +- tools/cli-client/internals/client/wf_poller_test.go | 2 +- tools/cli-client/internals/token/token.go | 2 +- tools/cli-client/internals/token/token_test.go | 2 +- tools/cli-client/internals/trigger/build_metadata.go | 2 +- tools/cli-client/internals/trigger/build_metadata_test.go | 2 +- tools/cli-client/internals/trigger/trigger.go | 2 +- tools/cli-client/internals/trigger/trigger_test.go | 2 +- 21 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/_CLI-Client.yaml b/.github/workflows/_CLI-Client.yaml index d4ee054f..e09df58f 100644 --- a/.github/workflows/_CLI-Client.yaml +++ b/.github/workflows/_CLI-Client.yaml @@ -2,10 +2,10 @@ name: CLI-Client on: push: paths: - - "src/cli-client/**" + - "tools/cli-client/**" pull_request: paths: - - "src/cli-client/**" + - "tools/cli-client/**" jobs: test: @@ -18,7 +18,7 @@ jobs: with: go-version: 1.22 - name: Test - working-directory: src/cli-client + working-directory: tools/cli-client run: | go test ./... @@ -30,7 +30,7 @@ jobs: - uses: snapcore/action-build@v1 id: snapcraft with: - path: src/cli-client + path: tools/cli-client - uses: actions/upload-artifact@v3 with: name: snap diff --git a/.github/workflows/_Test-OCI-Factory.yaml b/.github/workflows/_Test-OCI-Factory.yaml index 87f601a4..bee35e21 100644 --- a/.github/workflows/_Test-OCI-Factory.yaml +++ b/.github/workflows/_Test-OCI-Factory.yaml @@ -13,7 +13,7 @@ on: - "oci/mock*" - "src/**" - "!src/workflow-engine/**" - - "!src/cli-client/**" + - "!tools/cli-client/**" jobs: test-workflows: diff --git a/README.md b/README.md index 766cb548..10b4c170 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ multiple images; #### 2. With the CLI Client Maintainers can use the OCI Factory's CLI Client to interact with the OCI -Factory. The CLI Client is a Go module at [src/cli-client](src/cli-client). +Factory. The CLI Client is a Go module at [tools/cli-client](tools/cli-client). Here's what you should do and know before you use the CLI Client: @@ -106,7 +106,7 @@ i.e. you can ask the OCI Factory to build one version of the image, upload and release it to GHCR, Docker Hub, and ECR with different tracks, risks and EOL with a single command, but **not** multiple versions of the same image. -Further documentation regarding the CLI Client can be found [here](src/cli-client/README.md). +Further documentation regarding the CLI Client can be found [here](tools/cli-client/README.md). Refer to the diagram below to understand the oci-factory workflow: ![OCI Factory Workflow](assets/img/oci-factory-workflow.png) diff --git a/tools/cli-client/README.md b/tools/cli-client/README.md index a1f8fc16..6975e08e 100644 --- a/tools/cli-client/README.md +++ b/tools/cli-client/README.md @@ -47,7 +47,7 @@ sudo snap install go --classic #### Install the CLI client ```bash -go install github.com/canonical/oci-factory/src/cli-client/cmd/oci-factory +go install github.com/canonical/oci-factory/tools/cli-client/cmd/oci-factory ``` # Triggering workflows diff --git a/tools/cli-client/cmd/oci-factory/main.go b/tools/cli-client/cmd/oci-factory/main.go index 90eb6c42..0ccd966d 100644 --- a/tools/cli-client/cmd/oci-factory/main.go +++ b/tools/cli-client/cmd/oci-factory/main.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/canonical/oci-factory/src/cli-client/internals/cli" - "github.com/canonical/oci-factory/src/cli-client/internals/logger" + "github.com/canonical/oci-factory/tools/cli-client/internals/cli" + "github.com/canonical/oci-factory/tools/cli-client/internals/logger" ) func main() { diff --git a/tools/cli-client/go.mod b/tools/cli-client/go.mod index e03377f5..a6dba02a 100644 --- a/tools/cli-client/go.mod +++ b/tools/cli-client/go.mod @@ -1,4 +1,4 @@ -module github.com/canonical/oci-factory/src/cli-client +module github.com/canonical/oci-factory/tools/cli-client go 1.22 diff --git a/tools/cli-client/internals/cli/cli_upload.go b/tools/cli-client/internals/cli/cli_upload.go index 9e255386..81bc52c3 100644 --- a/tools/cli-client/internals/cli/cli_upload.go +++ b/tools/cli-client/internals/cli/cli_upload.go @@ -7,8 +7,8 @@ import ( "slices" "strings" - "github.com/canonical/oci-factory/src/cli-client/internals/client" - "github.com/canonical/oci-factory/src/cli-client/internals/trigger" + "github.com/canonical/oci-factory/tools/cli-client/internals/client" + "github.com/canonical/oci-factory/tools/cli-client/internals/trigger" ) type UploadRelease struct { diff --git a/tools/cli-client/internals/cli/cli_upload_test.go b/tools/cli-client/internals/cli/cli_upload_test.go index 9ab8e241..c7deaad9 100644 --- a/tools/cli-client/internals/cli/cli_upload_test.go +++ b/tools/cli-client/internals/cli/cli_upload_test.go @@ -3,7 +3,7 @@ package cli_test import ( . "gopkg.in/check.v1" - "github.com/canonical/oci-factory/src/cli-client/internals/cli" + "github.com/canonical/oci-factory/tools/cli-client/internals/cli" ) // `func Test(t *testing.T) { TestingT(t) }` defined in validator_test.go diff --git a/tools/cli-client/internals/cli/validator_test.go b/tools/cli-client/internals/cli/validator_test.go index ad641643..18fdd8fc 100644 --- a/tools/cli-client/internals/cli/validator_test.go +++ b/tools/cli-client/internals/cli/validator_test.go @@ -5,7 +5,7 @@ import ( . "gopkg.in/check.v1" - "github.com/canonical/oci-factory/src/cli-client/internals/cli" + "github.com/canonical/oci-factory/tools/cli-client/internals/cli" ) func Test(t *testing.T) { TestingT(t) } diff --git a/tools/cli-client/internals/client/client.go b/tools/cli-client/internals/client/client.go index d11b8fd8..6945979e 100644 --- a/tools/cli-client/internals/client/client.go +++ b/tools/cli-client/internals/client/client.go @@ -7,7 +7,7 @@ import ( "os" "time" - "github.com/canonical/oci-factory/src/cli-client/internals/logger" + "github.com/canonical/oci-factory/tools/cli-client/internals/logger" ) const NumRetries = 2 diff --git a/tools/cli-client/internals/client/client_test.go b/tools/cli-client/internals/client/client_test.go index fed97eeb..1d503907 100644 --- a/tools/cli-client/internals/client/client_test.go +++ b/tools/cli-client/internals/client/client_test.go @@ -8,8 +8,8 @@ import ( . "gopkg.in/check.v1" - "github.com/canonical/oci-factory/src/cli-client/internals/client" - "github.com/canonical/oci-factory/src/cli-client/internals/token" + "github.com/canonical/oci-factory/tools/cli-client/internals/client" + "github.com/canonical/oci-factory/tools/cli-client/internals/token" ) type ClientSuite struct{} diff --git a/tools/cli-client/internals/client/wf_dispatcher.go b/tools/cli-client/internals/client/wf_dispatcher.go index 951eeeb4..43a0defd 100644 --- a/tools/cli-client/internals/client/wf_dispatcher.go +++ b/tools/cli-client/internals/client/wf_dispatcher.go @@ -7,8 +7,8 @@ import ( "net/http" "time" - "github.com/canonical/oci-factory/src/cli-client/internals/logger" - "github.com/canonical/oci-factory/src/cli-client/internals/token" + "github.com/canonical/oci-factory/tools/cli-client/internals/logger" + "github.com/canonical/oci-factory/tools/cli-client/internals/token" ) var workflowDispatchURL = "https://api.github.com/repos/canonical/oci-factory/actions/workflows/Image.yaml/dispatches" diff --git a/tools/cli-client/internals/client/wf_dispatcher_test.go b/tools/cli-client/internals/client/wf_dispatcher_test.go index 3de9530c..affadcf2 100644 --- a/tools/cli-client/internals/client/wf_dispatcher_test.go +++ b/tools/cli-client/internals/client/wf_dispatcher_test.go @@ -11,8 +11,8 @@ import ( . "gopkg.in/check.v1" - "github.com/canonical/oci-factory/src/cli-client/internals/client" - "github.com/canonical/oci-factory/src/cli-client/internals/token" + "github.com/canonical/oci-factory/tools/cli-client/internals/client" + "github.com/canonical/oci-factory/tools/cli-client/internals/token" ) type DispatcherSuite struct{} diff --git a/tools/cli-client/internals/client/wf_poller.go b/tools/cli-client/internals/client/wf_poller.go index d22e362a..6496086d 100644 --- a/tools/cli-client/internals/client/wf_poller.go +++ b/tools/cli-client/internals/client/wf_poller.go @@ -9,7 +9,7 @@ import ( "time" "github.com/briandowns/spinner" - "github.com/canonical/oci-factory/src/cli-client/internals/logger" + "github.com/canonical/oci-factory/tools/cli-client/internals/logger" ) const workflowRunsURL = "https://api.github.com/repos/canonical/oci-factory/actions/workflows/Image.yaml/runs" diff --git a/tools/cli-client/internals/client/wf_poller_test.go b/tools/cli-client/internals/client/wf_poller_test.go index f4573bf7..b770f9c0 100644 --- a/tools/cli-client/internals/client/wf_poller_test.go +++ b/tools/cli-client/internals/client/wf_poller_test.go @@ -3,7 +3,7 @@ package client_test import ( . "gopkg.in/check.v1" - "github.com/canonical/oci-factory/src/cli-client/internals/client" + "github.com/canonical/oci-factory/tools/cli-client/internals/client" ) type PollerSuite struct{} diff --git a/tools/cli-client/internals/token/token.go b/tools/cli-client/internals/token/token.go index 5a868180..37412251 100644 --- a/tools/cli-client/internals/token/token.go +++ b/tools/cli-client/internals/token/token.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/canonical/oci-factory/src/cli-client/internals/logger" + "github.com/canonical/oci-factory/tools/cli-client/internals/logger" "golang.org/x/term" ) diff --git a/tools/cli-client/internals/token/token_test.go b/tools/cli-client/internals/token/token_test.go index c05e0946..5e15db13 100644 --- a/tools/cli-client/internals/token/token_test.go +++ b/tools/cli-client/internals/token/token_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/canonical/oci-factory/src/cli-client/internals/token" + "github.com/canonical/oci-factory/tools/cli-client/internals/token" ) func TestReadAccessTokenEnv(t *testing.T) { diff --git a/tools/cli-client/internals/trigger/build_metadata.go b/tools/cli-client/internals/trigger/build_metadata.go index 68bb0a77..02044f20 100644 --- a/tools/cli-client/internals/trigger/build_metadata.go +++ b/tools/cli-client/internals/trigger/build_metadata.go @@ -7,7 +7,7 @@ import ( "regexp" "strings" - "github.com/canonical/oci-factory/src/cli-client/internals/logger" + "github.com/canonical/oci-factory/tools/cli-client/internals/logger" git "github.com/go-git/go-git/v5" "gopkg.in/yaml.v3" ) diff --git a/tools/cli-client/internals/trigger/build_metadata_test.go b/tools/cli-client/internals/trigger/build_metadata_test.go index fb0563b7..427a9ec8 100644 --- a/tools/cli-client/internals/trigger/build_metadata_test.go +++ b/tools/cli-client/internals/trigger/build_metadata_test.go @@ -9,7 +9,7 @@ import ( . "gopkg.in/check.v1" - "github.com/canonical/oci-factory/src/cli-client/internals/trigger" + "github.com/canonical/oci-factory/tools/cli-client/internals/trigger" ) type BuildMetadataSuite struct { diff --git a/tools/cli-client/internals/trigger/trigger.go b/tools/cli-client/internals/trigger/trigger.go index 25ebac3d..28406dca 100644 --- a/tools/cli-client/internals/trigger/trigger.go +++ b/tools/cli-client/internals/trigger/trigger.go @@ -1,7 +1,7 @@ package trigger import ( - "github.com/canonical/oci-factory/src/cli-client/internals/logger" + "github.com/canonical/oci-factory/tools/cli-client/internals/logger" "gopkg.in/yaml.v3" ) diff --git a/tools/cli-client/internals/trigger/trigger_test.go b/tools/cli-client/internals/trigger/trigger_test.go index d3b62c46..56595818 100644 --- a/tools/cli-client/internals/trigger/trigger_test.go +++ b/tools/cli-client/internals/trigger/trigger_test.go @@ -5,7 +5,7 @@ import ( . "gopkg.in/check.v1" - "github.com/canonical/oci-factory/src/cli-client/internals/trigger" + "github.com/canonical/oci-factory/tools/cli-client/internals/trigger" "gopkg.in/yaml.v3" )