diff --git a/.github/workflows/check-buildah-remote.yaml b/.github/workflows/check-buildah-remote.yaml index d2d2f41daa..bf9409f95c 100644 --- a/.github/workflows/check-buildah-remote.yaml +++ b/.github/workflows/check-buildah-remote.yaml @@ -11,7 +11,7 @@ jobs: - name: Install Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 with: - go-version-file: './task-generator/go.mod' + go-version-file: './task-generator/remote/go.mod' - name: Check buildah remote run: | ./hack/generate-buildah-remote.sh diff --git a/.github/workflows/checkton.yaml b/.github/workflows/checkton.yaml index 3a1ec1421c..55e155c8b7 100644 --- a/.github/workflows/checkton.yaml +++ b/.github/workflows/checkton.yaml @@ -21,7 +21,7 @@ jobs: # Set to false when re-enabling SARIF uploads fail-on-findings: true find-copies-harder: true - exclude-regex: ^ta-generator + exclude-regex: ^task-generator # Currently, code scanning alerts annoyingly stay open even if you fix them. # Don't upload SARIF until https://github.com/orgs/community/discussions/132787 is resolved. diff --git a/.github/workflows/go-ci.yaml b/.github/workflows/go-ci.yaml index d70919a0ed..44c3f7f999 100644 --- a/.github/workflows/go-ci.yaml +++ b/.github/workflows/go-ci.yaml @@ -9,8 +9,8 @@ jobs: strategy: matrix: path: - - task-generator - - ta-generator + - task-generator/remote + - task-generator/trusted-artifacts steps: - uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc - uses: actions/setup-go@b26d40294f8ad76fcc90b915dac85892322fe62d @@ -28,8 +28,8 @@ jobs: strategy: matrix: path: - - task-generator - - ta-generator + - task-generator/remote + - task-generator/trusted-artifacts steps: - uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc - name: Install Go @@ -69,8 +69,8 @@ jobs: strategy: matrix: path: - - task-generator - - ta-generator + - task-generator/remote + - task-generator/trusted-artifacts steps: - uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc - uses: actions/setup-go@b26d40294f8ad76fcc90b915dac85892322fe62d diff --git a/.gitignore b/.gitignore index fae620509e..33efb492a9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,12 @@ bundle_values.env *~ *.swp .checkton.sarif +**/vendor + +# expected and got files generated in trusted-artifacts tests when mismatch occurs +task-generator/trusted-artifacts/golden/**/expected +task-generator/trusted-artifacts/golden/**/got +# Generated binaries +task-generator/trusted-artifacts/trusted-artifacts +task-generator/remote/remote + diff --git a/hack/generate-buildah-remote.sh b/hack/generate-buildah-remote.sh index 27ea1fdcfb..b8544e1808 100755 --- a/hack/generate-buildah-remote.sh +++ b/hack/generate-buildah-remote.sh @@ -3,8 +3,8 @@ set -euo pipefail SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -cd "${SCRIPTDIR}/../task-generator" -go build -o /tmp/remote-generator ./remote/main.go +cd "${SCRIPTDIR}/../task-generator/remote" +go build -o /tmp/remote-generator main.go for version in 0.1 0.2; do /tmp/remote-generator --buildah-task="${SCRIPTDIR}/../task/buildah/${version}/buildah.yaml" \ diff --git a/hack/generate-ta-tasks.sh b/hack/generate-ta-tasks.sh index 4fd9d0e03e..25f2cb34ed 100755 --- a/hack/generate-ta-tasks.sh +++ b/hack/generate-ta-tasks.sh @@ -16,7 +16,7 @@ ROOT_DIR="$(git rev-parse --show-toplevel)" TASK_DIR="$(realpath "${ROOT_DIR}/task")" tashbin="$(mktemp --dry-run)" -GOTOOLCHAIN=auto GOSUMDB=sum.golang.org go build -C "${ROOT_DIR}/ta-generator/" -o "${tashbin}" +GOTOOLCHAIN=auto GOSUMDB=sum.golang.org go build -C "${ROOT_DIR}/task-generator/trusted-artifacts" -o "${tashbin}" trap 'rm "${tashbin}"' EXIT tash() { "${tashbin}" "$@" diff --git a/task-generator/go.mod b/task-generator/remote/go.mod similarity index 98% rename from task-generator/go.mod rename to task-generator/remote/go.mod index b6964f5486..421b83a1cb 100644 --- a/task-generator/go.mod +++ b/task-generator/remote/go.mod @@ -1,4 +1,4 @@ -module github.com/konflux-ci/build-definitions/task-generator +module github.com/konflux-ci/build-definitions/task-generator/remote go 1.22.0 diff --git a/task-generator/go.sum b/task-generator/remote/go.sum similarity index 100% rename from task-generator/go.sum rename to task-generator/remote/go.sum diff --git a/ta-generator/README.md b/task-generator/trusted-artifacts/README.md similarity index 100% rename from ta-generator/README.md rename to task-generator/trusted-artifacts/README.md diff --git a/ta-generator/expect.go b/task-generator/trusted-artifacts/expect.go similarity index 100% rename from ta-generator/expect.go rename to task-generator/trusted-artifacts/expect.go diff --git a/ta-generator/go.mod b/task-generator/trusted-artifacts/go.mod similarity index 98% rename from ta-generator/go.mod rename to task-generator/trusted-artifacts/go.mod index 85cc82a924..8b9d52f21f 100644 --- a/ta-generator/go.mod +++ b/task-generator/trusted-artifacts/go.mod @@ -1,4 +1,4 @@ -module github.com/konflux-ci/build-definitions/ta-generator +module github.com/konflux-ci/build-definitions/task-generator/trusted-artifacts go 1.22.3 diff --git a/ta-generator/go.sum b/task-generator/trusted-artifacts/go.sum similarity index 100% rename from ta-generator/go.sum rename to task-generator/trusted-artifacts/go.sum diff --git a/ta-generator/golden/buildah/base.yaml b/task-generator/trusted-artifacts/golden/buildah/base.yaml similarity index 100% rename from ta-generator/golden/buildah/base.yaml rename to task-generator/trusted-artifacts/golden/buildah/base.yaml diff --git a/ta-generator/golden/buildah/recipe.yaml b/task-generator/trusted-artifacts/golden/buildah/recipe.yaml similarity index 100% rename from ta-generator/golden/buildah/recipe.yaml rename to task-generator/trusted-artifacts/golden/buildah/recipe.yaml diff --git a/ta-generator/golden/buildah/ta.yaml b/task-generator/trusted-artifacts/golden/buildah/ta.yaml similarity index 100% rename from ta-generator/golden/buildah/ta.yaml rename to task-generator/trusted-artifacts/golden/buildah/ta.yaml diff --git a/ta-generator/golden/git-clone/base.yaml b/task-generator/trusted-artifacts/golden/git-clone/base.yaml similarity index 100% rename from ta-generator/golden/git-clone/base.yaml rename to task-generator/trusted-artifacts/golden/git-clone/base.yaml diff --git a/ta-generator/golden/git-clone/recipe.yaml b/task-generator/trusted-artifacts/golden/git-clone/recipe.yaml similarity index 100% rename from ta-generator/golden/git-clone/recipe.yaml rename to task-generator/trusted-artifacts/golden/git-clone/recipe.yaml diff --git a/ta-generator/golden/git-clone/ta.yaml b/task-generator/trusted-artifacts/golden/git-clone/ta.yaml similarity index 100% rename from ta-generator/golden/git-clone/ta.yaml rename to task-generator/trusted-artifacts/golden/git-clone/ta.yaml diff --git a/ta-generator/golden/prefetch-dependencies/base.yaml b/task-generator/trusted-artifacts/golden/prefetch-dependencies/base.yaml similarity index 100% rename from ta-generator/golden/prefetch-dependencies/base.yaml rename to task-generator/trusted-artifacts/golden/prefetch-dependencies/base.yaml diff --git a/ta-generator/golden/prefetch-dependencies/recipe.yaml b/task-generator/trusted-artifacts/golden/prefetch-dependencies/recipe.yaml similarity index 100% rename from ta-generator/golden/prefetch-dependencies/recipe.yaml rename to task-generator/trusted-artifacts/golden/prefetch-dependencies/recipe.yaml diff --git a/ta-generator/golden/prefetch-dependencies/ta.yaml b/task-generator/trusted-artifacts/golden/prefetch-dependencies/ta.yaml similarity index 100% rename from ta-generator/golden/prefetch-dependencies/ta.yaml rename to task-generator/trusted-artifacts/golden/prefetch-dependencies/ta.yaml diff --git a/ta-generator/golden/sast-snyk-check/base.yaml b/task-generator/trusted-artifacts/golden/sast-snyk-check/base.yaml similarity index 100% rename from ta-generator/golden/sast-snyk-check/base.yaml rename to task-generator/trusted-artifacts/golden/sast-snyk-check/base.yaml diff --git a/ta-generator/golden/sast-snyk-check/recipe.yaml b/task-generator/trusted-artifacts/golden/sast-snyk-check/recipe.yaml similarity index 100% rename from ta-generator/golden/sast-snyk-check/recipe.yaml rename to task-generator/trusted-artifacts/golden/sast-snyk-check/recipe.yaml diff --git a/ta-generator/golden/sast-snyk-check/ta.yaml b/task-generator/trusted-artifacts/golden/sast-snyk-check/ta.yaml similarity index 100% rename from ta-generator/golden/sast-snyk-check/ta.yaml rename to task-generator/trusted-artifacts/golden/sast-snyk-check/ta.yaml diff --git a/ta-generator/golden/source-build/base.yaml b/task-generator/trusted-artifacts/golden/source-build/base.yaml similarity index 100% rename from ta-generator/golden/source-build/base.yaml rename to task-generator/trusted-artifacts/golden/source-build/base.yaml diff --git a/ta-generator/golden/source-build/recipe.yaml b/task-generator/trusted-artifacts/golden/source-build/recipe.yaml similarity index 100% rename from ta-generator/golden/source-build/recipe.yaml rename to task-generator/trusted-artifacts/golden/source-build/recipe.yaml diff --git a/ta-generator/golden/source-build/ta.yaml b/task-generator/trusted-artifacts/golden/source-build/ta.yaml similarity index 100% rename from ta-generator/golden/source-build/ta.yaml rename to task-generator/trusted-artifacts/golden/source-build/ta.yaml diff --git a/ta-generator/main.go b/task-generator/trusted-artifacts/main.go similarity index 100% rename from ta-generator/main.go rename to task-generator/trusted-artifacts/main.go diff --git a/ta-generator/main_test.go b/task-generator/trusted-artifacts/main_test.go similarity index 100% rename from ta-generator/main_test.go rename to task-generator/trusted-artifacts/main_test.go diff --git a/ta-generator/recipe.go b/task-generator/trusted-artifacts/recipe.go similarity index 100% rename from ta-generator/recipe.go rename to task-generator/trusted-artifacts/recipe.go diff --git a/ta-generator/shell.go b/task-generator/trusted-artifacts/shell.go similarity index 100% rename from ta-generator/shell.go rename to task-generator/trusted-artifacts/shell.go diff --git a/ta-generator/ta.go b/task-generator/trusted-artifacts/ta.go similarity index 100% rename from ta-generator/ta.go rename to task-generator/trusted-artifacts/ta.go diff --git a/ta-generator/tekton.go b/task-generator/trusted-artifacts/tekton.go similarity index 100% rename from ta-generator/tekton.go rename to task-generator/trusted-artifacts/tekton.go