From 5814da7a466fad8653d53db7a1ca53e851b56df3 Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Thu, 17 Oct 2024 13:50:03 +0530 Subject: [PATCH 01/10] chore: ci-enhancements Signed-off-by: Prateek Chandra --- .github/workflows/build.yml | 43 +++++---- .github/workflows/pull_request.yml | 66 +++++++++----- .github/workflows/release.yml | 139 ++++++++++++++++++++++++++++- 3 files changed, 201 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5b0eec8..098801b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ on: push: branches: - 'develop' - - 'v*' + - 'release/**' paths-ignore: - '**.md' - 'changelogs/**' @@ -23,6 +23,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + + - uses: cachix/install-nix-action@v22 + - uses: rrbutani/use-nix-shell-action@v1.1.0 + with: + file: shell.nix + + - name: Check if the chart follows a valid semver version + run: | + BRANCH=${{ github.ref_name }} + ./scripts/validate-chart-version.sh --branch $BRANCH + + - name: Run chart-testing lint + run: | + ct lint --config ct.yaml unit-test: # to ignore builds on release @@ -44,7 +58,7 @@ jobs: run: make verify-src - name: Upload Coverage Report - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 provisioner-localpv: runs-on: ubuntu-latest @@ -153,25 +167,8 @@ jobs: with: go-version: 1.19.13 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - version: v0.5.1 - - - name: Checkout - uses: actions/checkout@v4 - - - name: Build Image - uses: docker/build-push-action@v4 - with: - context: . - file: ./buildscripts/provisioner-localpv/provisioner-localpv.Dockerfile - push: false - load: true - platforms: linux/amd64 - tags: | - openebs/provisioner-localpv:ci + - name: Build images locally + run: make provisioner-localpv-image || exit 1; - name: Setup Minikube-Kubernetes uses: medyagh/setup-minikube@latest @@ -187,12 +184,12 @@ jobs: run: | sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r` go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 - sed -e '/openebs-provisioner-hostpath/{N;s/IfNotPresent/Never/}' deploy/kubectl/openebs-operator-lite.yaml | kubectl apply -f - + helm install localpv-provisioner ./deploy/helm/charts -n $OPENEBS_NAMESPACE --create-namespace --set localpv.image.pullPolicy=Never --set analytics.enabled=false - name: Integration test run: | make integration-test - + localpv-e2e: # to ignore builds on release AND build only if the branch is develop if: ${{ (github.event.ref_type != 'tag') && (github.ref == 'refs/heads/develop') }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 860d3ac5..56c44ad7 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,11 +5,11 @@ on: branches: # on pull requests to develop and release branches - 'develop' - - 'v*' + - 'release/**' paths-ignore: - '**.md' - 'changelogs/**' - - 'deploy/helm/**' + #- 'deploy/helm/**' - 'docs/**' - 'design/**' - 'LICENSE' @@ -21,6 +21,43 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Shellcheck + uses: reviewdog/action-shellcheck@v1 + with: + github_token: ${{ secrets.github_token }} + reporter: github-pr-review + path: "." + pattern: "*.sh" + + - uses: cachix/install-nix-action@v22 + - uses: rrbutani/use-nix-shell-action@v1.1.0 + with: + file: shell.nix + + - name: Set up Go 1.19 + uses: actions/setup-go@v5 + with: + go-version: 1.19.13 + cache: false + + - name: Lint Check + uses: golangci/golangci-lint-action@v4 + with: + version: v1.56.2 + args: -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s + + - name: Check if the chart follows a valid semver version + run: | + branch_name="${{ github.event.pull_request.base.ref }}" + ./scripts/validate-chart-version.sh --branch $branch_name + + - name: Run chart-testing lint + run: | + ct lint --config ct.yaml + unit-test: runs-on: ubuntu-latest @@ -40,7 +77,7 @@ jobs: run: make verify-src - name: Upload Coverage Report - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 provisioner-localpv: runs-on: ubuntu-latest @@ -88,25 +125,8 @@ jobs: with: go-version: 1.19.13 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - version: v0.5.1 - - - name: Checkout - uses: actions/checkout@v4 - - - name: Build Image - uses: docker/build-push-action@v4 - with: - context: . - file: ./buildscripts/provisioner-localpv/provisioner-localpv.Dockerfile - push: false - load: true - platforms: linux/amd64 - tags: | - openebs/provisioner-localpv:ci + - name: Build images locally + run: make provisioner-localpv-image || exit 1; - name: Setup Minikube-Kubernetes uses: medyagh/setup-minikube@latest @@ -122,7 +142,7 @@ jobs: run: | sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r` go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 - sed -e '/openebs-provisioner-hostpath/{N;s/IfNotPresent/Never/}' deploy/kubectl/openebs-operator-lite.yaml | kubectl apply -f - + helm install localpv-provisioner ./deploy/helm/charts -n $OPENEBS_NAMESPACE --create-namespace --set localpv.image.pullPolicy=Never --set analytics.enabled=false - name: Integration test run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 752dbb38..957484fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: release +name: Release Images and Charts on: release: @@ -20,7 +20,144 @@ on: - 'created' jobs: + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Shellcheck + uses: reviewdog/action-shellcheck@v1 + with: + github_token: ${{ secrets.github_token }} + reporter: github-pr-review + path: "." + pattern: "*.sh" + + - uses: cachix/install-nix-action@v22 + - uses: rrbutani/use-nix-shell-action@v1.1.0 + with: + file: shell.nix + + - name: Set up Go 1.19 + uses: actions/setup-go@v5 + with: + go-version: 1.19.13 + cache: false + + - name: Lint Check + uses: golangci/golangci-lint-action@v4 + with: + version: v1.56.2 + args: -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s + + - name: Check if the chart follows a valid semver version + run: | + branch_name="${{ github.event.pull_request.base.ref }}" + ./scripts/validate-chart-version.sh --branch $branch_name + + - name: Check if the chart is publishable + run: | + TAG=${{ github.event.release.tag_name }} + ./scripts/update-chart-version.sh --tag $TAG --publish-release + + - name: Run chart-testing lint + run: | + ct lint --config ct.yaml + + unit-test: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.19 + uses: actions/setup-go@v4 + with: + go-version: 1.19.13 + + - name: Checkout + uses: actions/checkout@v4 + + - name: Unit test + run: make test + + - name: Verify corrections + run: make verify-src + + - name: Upload Coverage Report + uses: codecov/codecov-action@v4 + provisioner-localpv: + runs-on: ubuntu-latest + needs: ['lint', 'unit-test'] + steps: + - name: Set up Go 1.19 + uses: actions/setup-go@v4 + with: + go-version: 1.19.13 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + with: + version: v0.5.1 + + - name: Checkout + uses: actions/checkout@v4 + + - name: Build multi-arch Image + uses: docker/build-push-action@v4 + with: + context: . + file: ./buildscripts/provisioner-localpv/provisioner-localpv.Dockerfile + push: false + load: false + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le + tags: | + openebs/provisioner-localpv:ci + + integration-test: + runs-on: ubuntu-latest + needs: ['lint', 'unit-test'] + strategy: + matrix: + kubernetes: [v1.27.2] + steps: + - name: Set up Go 1.19 + uses: actions/setup-go@v4 + with: + go-version: 1.19.13 + + - name: Build images locally + run: make provisioner-localpv-image || exit 1; + + - name: Setup Minikube-Kubernetes + uses: medyagh/setup-minikube@latest + with: + cache: false + minikube-version: 1.31.1 + driver: none + kubernetes-version: ${{ matrix.kubernetes }} + cni: calico + start-args: '--install-addons=false' + + - name: Set up infra for integration test + run: | + sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r` + go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 + helm install localpv-provisioner ./deploy/helm/charts -n $OPENEBS_NAMESPACE --create-namespace --set localpv.image.pullPolicy=Never --set analytics.enabled=false + + - name: Integration test + run: | + make integration-test + + cs-driver: if: contains(github.ref, 'tags/v') runs-on: ubuntu-latest steps: From 67a109a8d5174f4e0254195a0f7b07b381a0ae6c Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Thu, 17 Oct 2024 13:52:26 +0530 Subject: [PATCH 02/10] fix: typo Signed-off-by: Prateek Chandra --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 957484fb..fbc0493f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -157,7 +157,7 @@ jobs: run: | make integration-test - cs-driver: + csi-driver: if: contains(github.ref, 'tags/v') runs-on: ubuntu-latest steps: From c2799fd60a0a3689f3b7105afa8298f1f331d83a Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Thu, 17 Oct 2024 16:49:37 +0530 Subject: [PATCH 03/10] fix: added nix files Signed-off-by: Prateek Chandra --- ct.yaml | 3 +- nix/sources.json | 14 ++++ nix/sources.nix | 198 +++++++++++++++++++++++++++++++++++++++++++++++ shell.nix | 12 +++ 4 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 nix/sources.json create mode 100644 nix/sources.nix create mode 100644 shell.nix diff --git a/ct.yaml b/ct.yaml index 91f9bd03..86949033 100644 --- a/ct.yaml +++ b/ct.yaml @@ -4,4 +4,5 @@ target-branch: develop chart-dirs: - deploy/helm helm-extra-args: --timeout=500s -validate-maintainers: false \ No newline at end of file +validate-maintainers: false +check-version-increment: false \ No newline at end of file diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 00000000..dc4bfb25 --- /dev/null +++ b/nix/sources.json @@ -0,0 +1,14 @@ +{ + "nixpkgs": { + "branch": "release-23.05", + "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", + "homepage": "https://github.com/NixOS/nixpkgs", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", + "sha256": "0xhqjli4m9wkzv7xhs6fr1iajdjbv7xnj0bwvwldq9s6arlwkhj3", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/9a333eaa80901efe01df07eade2c16d183761fa3.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} \ No newline at end of file diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 00000000..0b645c28 --- /dev/null +++ b/nix/sources.nix @@ -0,0 +1,198 @@ +# This file has been generated by Niv. + +let + + # + # The fetchers. fetch_ fetches specs of type . + # + + fetch_file = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; name = name'; } + else + pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; + + fetch_tarball = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchTarball { name = name'; inherit (spec) url sha256; } + else + pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; + + fetch_git = name: spec: + let + ref = + spec.ref or ( + if spec ? branch then "refs/heads/${spec.branch}" else + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!" + ); + submodules = spec.submodules or false; + submoduleArg = + let + nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = + if submodules + then + builtins.trace + ( + "The niv input \"${name}\" uses submodules " + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them" + ) + { } + else { }; + in + if nixSupportsSubmodules + then { inherit submodules; } + else emptyArgWithWarning; + in + builtins.fetchGit + ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); + + fetch_local = spec: spec.path; + + fetch_builtin-tarball = name: throw + ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=tarball -a builtin=true''; + + fetch_builtin-url = name: throw + ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=file -a builtin=true''; + + # + # Various helpers + # + + # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 + sanitizeName = name: + ( + concatMapStrings (s: if builtins.isList s then "-" else s) + ( + builtins.split "[^[:alnum:]+._?=-]+" + ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) + ) + ); + + # The set of packages used when specs are fetched using non-builtins. + mkPkgs = sources: system: + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import { } + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + # The actual fetching function. + fetch = pkgs: name: spec: + + if ! builtins.hasAttr "type" spec then + abort "ERROR: niv spec ${name} does not have a 'type' attribute" + else if spec.type == "file" then fetch_file pkgs name spec + else if spec.type == "tarball" then fetch_tarball pkgs name spec + else if spec.type == "git" then fetch_git name spec + else if spec.type == "local" then fetch_local spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball name + else if spec.type == "builtin-url" then fetch_builtin-url name + else + abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + + # If the environment variable NIV_OVERRIDE_${name} is set, then use + # the path directly as opposed to the fetched source. + replace = name: drv: + let + saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; + ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; + in + if ersatz == "" then drv else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; + + # Ports of functions for older nix versions + + # a Nix version of mapAttrs if the built-in doesn't exist + mapAttrs = builtins.mapAttrs or ( + f: set: with builtins; + listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) + ); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 + range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 + stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); + concatMapStrings = f: list: concatStrings (map f list); + concatStrings = builtins.concatStringsSep ""; + + # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 + optionalAttrs = cond: as: if cond then as else { }; + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = { url, name ? null, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchTarball; + in + if lessThan nixVersion "1.12" then + fetchTarball ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = { url, name ? null, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchurl; + in + if lessThan nixVersion "1.12" then + fetchurl ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) + else + fetchurl attrs; + + # Create the final "sources" from the config + mkSources = config: + mapAttrs + ( + name: spec: + if builtins.hasAttr "outPath" spec + then + abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = replace name (fetch config.pkgs name spec); } + ) + config.sources; + + # The "config" used by the fetchers + mkConfig = + { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null + , sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile) + , system ? builtins.currentSystem + , pkgs ? mkPkgs sources system + }: rec { + # The sources, i.e. the attribute set of spec name to spec + inherit sources; + + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers + inherit pkgs; + }; + +in +mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); } \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..54f411c0 --- /dev/null +++ b/shell.nix @@ -0,0 +1,12 @@ +let + sources = import ./nix/sources.nix; + pkgs = import sources.nixpkgs {}; +in +pkgs.mkShell { + name = "scripts-shell"; + buildInputs = with pkgs; [ + semver-tool + yq-go + chart-testing + ]; +} \ No newline at end of file From 1471f9b6d6d3addd3182289b8f80f2f68661d713 Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Thu, 24 Oct 2024 14:36:11 +0530 Subject: [PATCH 04/10] fix: implemented review comments Signed-off-by: Prateek Chandra --- .github/workflows/build.yml | 35 +++------------------------ .github/workflows/pull_request.yml | 6 ++--- .github/workflows/release.yml | 38 ++---------------------------- 3 files changed, 8 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 098801b2..f8943376 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go 1.19 - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.19.13 @@ -65,7 +65,7 @@ jobs: needs: ['lint', 'unit-test'] steps: - name: Set up Go 1.19 - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.19.13 @@ -163,7 +163,7 @@ jobs: kubernetes: [v1.27.2] steps: - name: Set up Go 1.19 - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.19.13 @@ -189,33 +189,4 @@ jobs: - name: Integration test run: | make integration-test - - localpv-e2e: - # to ignore builds on release AND build only if the branch is develop - if: ${{ (github.event.ref_type != 'tag') && (github.ref == 'refs/heads/develop') }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set Image Org - # sets the default IMAGE_ORG to openebs - run: | - [ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}} - echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push the localpv-e2e image - uses: docker/build-push-action@v4 - with: - file: ./e2e-tests/Dockerfile - push: true - load: false - platforms: linux/amd64 - tags: | - ${{ env.IMAGE_ORG }}/localpv-e2e:ci diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 56c44ad7..1045d589 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go 1.19 - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.19.13 @@ -84,7 +84,7 @@ jobs: needs: ['lint', 'unit-test'] steps: - name: Set up Go 1.19 - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.19.13 @@ -121,7 +121,7 @@ jobs: kubernetes: [v1.27.2] steps: - name: Set up Go 1.19 - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.19.13 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fbc0493f..104080ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,7 +72,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go 1.19 - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.19.13 @@ -88,40 +88,6 @@ jobs: - name: Upload Coverage Report uses: codecov/codecov-action@v4 - provisioner-localpv: - runs-on: ubuntu-latest - needs: ['lint', 'unit-test'] - steps: - - name: Set up Go 1.19 - uses: actions/setup-go@v4 - with: - go-version: 1.19.13 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - version: v0.5.1 - - - name: Checkout - uses: actions/checkout@v4 - - - name: Build multi-arch Image - uses: docker/build-push-action@v4 - with: - context: . - file: ./buildscripts/provisioner-localpv/provisioner-localpv.Dockerfile - push: false - load: false - platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le - tags: | - openebs/provisioner-localpv:ci - integration-test: runs-on: ubuntu-latest needs: ['lint', 'unit-test'] @@ -130,7 +96,7 @@ jobs: kubernetes: [v1.27.2] steps: - name: Set up Go 1.19 - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.19.13 From 8be5764fcd2a1be16a259bcd19fd29ecdf5f8c36 Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Fri, 25 Oct 2024 10:08:17 +0530 Subject: [PATCH 05/10] fix: added scripts for charts Signed-off-by: Prateek Chandra --- .github/workflows/build.yml | 6 +- .github/workflows/pull_request.yml | 30 ++-- .github/workflows/release.yml | 16 ++- ct.yaml | 2 +- nix/sources.json | 2 +- nix/sources.nix | 2 +- scripts/update-chart-version.sh | 224 +++++++++++++++++++++++++++++ scripts/validate-chart-version.sh | 103 +++++++++++++ shell.nix | 2 +- 9 files changed, 357 insertions(+), 30 deletions(-) create mode 100644 scripts/update-chart-version.sh create mode 100644 scripts/validate-chart-version.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8943376..7930c9ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,6 +59,11 @@ jobs: - name: Upload Coverage Report uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.txt + name: coverage-$(date +%s) + flags: unittests provisioner-localpv: runs-on: ubuntu-latest @@ -189,4 +194,3 @@ jobs: - name: Integration test run: | make integration-test - diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1045d589..ca69278c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -43,11 +43,11 @@ jobs: go-version: 1.19.13 cache: false - - name: Lint Check - uses: golangci/golangci-lint-action@v4 - with: - version: v1.56.2 - args: -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s + # - name: Lint Check + # uses: golangci/golangci-lint-action@v4 + # with: + # version: v1.56.2 + # args: -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s - name: Check if the chart follows a valid semver version run: | @@ -78,6 +78,11 @@ jobs: - name: Upload Coverage Report uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.txt + name: coverage-$(date +%s) + flags: unittests provisioner-localpv: runs-on: ubuntu-latest @@ -148,19 +153,4 @@ jobs: run: | make integration-test - localpv-e2e: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build the localpv-e2e image - uses: docker/build-push-action@v4 - with: - file: ./e2e-tests/Dockerfile - push: false - load: false - platforms: linux/amd64 - tags: | - openebs/localpv-e2e:ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 104080ff..3a48948b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,11 +48,11 @@ jobs: go-version: 1.19.13 cache: false - - name: Lint Check - uses: golangci/golangci-lint-action@v4 - with: - version: v1.56.2 - args: -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s + # - name: Lint Check + # uses: golangci/golangci-lint-action@v4 + # with: + # version: v1.56.2 + # args: -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s - name: Check if the chart follows a valid semver version run: | @@ -87,6 +87,11 @@ jobs: - name: Upload Coverage Report uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.txt + name: coverage-$(date +%s) + flags: unittests integration-test: runs-on: ubuntu-latest @@ -208,3 +213,4 @@ jobs: DBUILD_REPO_URL=https://github.com/openebs/dynamic-localpv-provisioner DBUILD_SITE_URL=https://openebs.io RELEASE_TAG=${{ env.RELEASE_TAG }} + diff --git a/ct.yaml b/ct.yaml index 86949033..a646494f 100644 --- a/ct.yaml +++ b/ct.yaml @@ -5,4 +5,4 @@ chart-dirs: - deploy/helm helm-extra-args: --timeout=500s validate-maintainers: false -check-version-increment: false \ No newline at end of file +check-version-increment: false diff --git a/nix/sources.json b/nix/sources.json index dc4bfb25..9faedce3 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -11,4 +11,4 @@ "url": "https://github.com/NixOS/nixpkgs/archive/9a333eaa80901efe01df07eade2c16d183761fa3.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } -} \ No newline at end of file +} diff --git a/nix/sources.nix b/nix/sources.nix index 0b645c28..fe3dadf7 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -195,4 +195,4 @@ let }; in -mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); } \ No newline at end of file +mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/scripts/update-chart-version.sh b/scripts/update-chart-version.sh new file mode 100644 index 00000000..90cfb017 --- /dev/null +++ b/scripts/update-chart-version.sh @@ -0,0 +1,224 @@ +#!/usr/bin/env bash + +# Write output to error output stream. +echo_stderr() { + echo -e "${1}" >&2 +} + +die() +{ + local _return="${2:-1}" + echo_stderr "$1" + exit "${_return}" +} + +help() { + cat < Name of the target branch. + --tag Release tag. + --type Which branch to modify. + --chart-version Version of the current chart. + --publish-release To modify the charts for a release. + +Examples: + $(basename "$0") --branch release/x.y +EOF +} + +check_tag_is_valid() { + local tag="$1" + local current_chart_version="$2" + + if [[ "$(semver validate $tag)" != "valid" ]]; then + die "Tag is not a valid sevmer complaint version" + fi + + if [[ $current_chart_version != *"-prerelease" ]]; then + die "Chart version($current_chart_version) should be a prerelease format to proceed for tag creation flow" + fi + + allowed_diff=("" "patch" "prerelease") + diff="$(semver diff "$tag" "$current_chart_version")" + if ! [[ " ${allowed_diff[*]} " =~ " $diff " ]]; then + die "For release/x.y branch the current chart version($current_chart_version)'s X.Y must exactly match X.Y from tag ($tag)" + fi +} + +# yq-go eats up blank lines +# this function gets around that using diff with --ignore-blank-lines +yq_ibl() +{ + set +e + diff_out=$(diff -B <(yq '.' "$2") <(yq "$1" "$2")) + error=$? + if [ "$error" != "0" ] && [ "$error" != "1" ]; then + exit "$error" + fi + if [ -n "$diff_out" ]; then + echo "$diff_out" | patch --quiet --no-backup-if-mismatch "$2" - + fi + set -euo pipefail +} + +# RULES: This would run only when changes are pushed to a release/x.y branch. +# 1. Branch name can only be of format release/x.y +# 2. If current chart version of type develop(on branch creation), +# then version generated is of format x.y.0-prerelease if type is "release" +# 3. If current chart version of type develop(on branch creation), +# then version generated is of format x.y+1.0-develop if type is develop. +# 4. If current chart version of type prerelease(after branch creation), +# then for type release it's a no op as it's already a prerelease format. +# 5. If current chart version of type prerelease(after branch creation), +# then for type develop it's a no op as the version to be would be same as it is currently. +# 6. Let's say for somereason someone tries to create a release/x.y branch from develop but chart version +# on develop is newer than x.y, example, release/2.2 and develop chart version is 2.5.0-develop. +# In that case for type release, the version would be 2.2.0-prerelease and for type develop it would be +# a no op as develop is already newer. +create_version_from_release_branch() { + if [[ "$BRANCH_NAME" =~ ^(release/[0-9]+\.[0-9]+)$ ]]; then + local EXTRACTED_VERSION=$(echo "$BRANCH_NAME" | grep -oP '(?<=release/)\d+\.\d+') + if [[ "$TYPE" == "release" ]]; then + if [[ "$CURRENT_CHART_VERSION" == *"-develop" ]]; then + VERSION="${EXTRACTED_VERSION}.0-prerelease" + elif [[ "$CURRENT_CHART_VERSION" == *"-prerelease" ]]; then + NO_OP=1 + else + die "Current chart version doesn't match a develop or prerel format" + fi + elif [[ "$TYPE" == "develop" ]]; then + EXPECTED_VERSION="$(semver bump minor "$EXTRACTED_VERSION.0")-develop" + if [[ "$(semver compare $EXPECTED_VERSION $CURRENT_CHART_VERSION)" == 1 ]]; then + VERSION=$EXPECTED_VERSION + else + NO_OP=1 + fi + fi + else + die "Branch name($BRANCH_NAME) is not of format release/x.y" + fi +} + +# RULES: This would run only when tag is created. +# 1. Tag should be of format vX.Y.Z. +# 2. If tag is of format vX.Y.Z-rc, it would be a no op for the workflow. +# 3. The tag can only be vX.Y.Z if the current chart version is X.Y*-prerelease. Ex, v2.6.1 for v2.6.*-prerelease +# 4. For release branches if all the above holds then it bumps the patch version. Ex, v2.6.1 --> 2.6.2-prerelease +create_version_from_tag() { + if [[ "$TAG" =~ ^(v[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + local EXTRACTED_VERSION=$(echo "$TAG" | grep -oP '(?<=v)\d+\.\d+.\d+') + check_tag_is_valid "$EXTRACTED_VERSION" "$CURRENT_CHART_VERSION" + if [[ -z $PUBLISH_RELEASE ]]; then + VERSION="$(semver bump patch $EXTRACTED_VERSION)-prerelease" + if [[ -z $DRY_RUN ]]; then + echo "release/$(echo $EXTRACTED_VERSION | cut -d'.' -f1,2)" + fi + else + VERSION="$EXTRACTED_VERSION" + fi + elif [[ "$TAG" == *"-rc" ]]; then + if [[ -z $PUBLISH_RELEASE ]]; then + NO_OP=1 + else + local EXTRACTED_VERSION=$(echo "$TAG" | grep -oP '(?<=v)\d+\.\d+\.\d+(-\w+)?') + check_tag_is_valid "$EXTRACTED_VERSION" "$CURRENT_CHART_VERSION" + VERSION="$EXTRACTED_VERSION" + fi + else + die "Invalid tag format. Expected 'vX.Y.Z'" + fi +} + +update_chart_yaml() { + local VERSION=$1 + local APP_VERSION=$2 + + yq_ibl ".version = \"$VERSION\" | .appVersion = \"$APP_VERSION\"" "$CHART_YAML" + yq_ibl ".localpv.image.tag = \"$VERSION\"" "$VALUES_YAML" +} + +set -euo pipefail + +DRY_RUN= +NO_OP= +CURRENT_CHART_VERSION= +PUBLISH_RELEASE= +# Set the path to the Chart.yaml file +SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]:-"$0"}")")" +ROOT_DIR="$SCRIPT_DIR/.." +CHART_DIR="$ROOT_DIR/deploy/helm/charts" +CHART_YAML="$CHART_DIR/Chart.yaml" +VALUES_YAML="$CHART_DIR/values.yaml" + +# Final computed version to be set in this. +VERSION="" + +# Parse arguments +while [ "$#" -gt 0 ]; do + case $1 in + -d|--dry-run) + DRY_RUN=1 + shift + ;; + -h|--help) + help + exit 0 + ;; + -b|--branch) + shift + BRANCH_NAME=$1 + shift + ;; + -t|--tag) + shift + TAG=$1 + shift + ;; + --type) + shift + TYPE=$1 + shift + ;; + --chart-version) + shift + CURRENT_CHART_VERSION=$1 + shift + ;; + --publish-release) + PUBLISH_RELEASE=1 + shift + ;; + *) + help + die "Unknown option: $1" + ;; + esac +done + +if [[ -z $CURRENT_CHART_VERSION ]]; then + CURRENT_CHART_VERSION=$(yq e '.version' "$CHART_YAML") +fi + +if [[ -n "${BRANCH_NAME-}" && -n "${TYPE-}" ]]; then + create_version_from_release_branch +elif [[ -n "${TAG-}" ]]; then + create_version_from_tag +else + help + die "Either --branch and --type or --tag and must be specified." +fi + +if [[ -z $NO_OP ]]; then + if [[ -n $VERSION ]]; then + if [[ -z $DRY_RUN ]];then + update_chart_yaml "$VERSION" "$VERSION" + else + echo "$VERSION" + fi + else + die "Failed to update the chart versions" + fi +fi \ No newline at end of file diff --git a/scripts/validate-chart-version.sh b/scripts/validate-chart-version.sh new file mode 100644 index 00000000..c21fba8e --- /dev/null +++ b/scripts/validate-chart-version.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash + +# Write output to error output stream. +echo_stderr() { + echo -e "${1}" >&2 +} + +die() +{ + local _return="${2:-1}" + echo_stderr "$1" + exit "${_return}" +} + +set -euo pipefail + +# Set the path to the Chart.yaml file +SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]:-"$0"}")")" +ROOT_DIR="$SCRIPT_DIR/.." +CHART_DIR="$ROOT_DIR/deploy/helm/charts" +CHART_YAML="$CHART_DIR/Chart.yaml" + +# Check if the Chart.yaml file exists +if [ ! -f "$CHART_YAML" ]; then + die "Chart.yaml file not found in $CHART_YAML" +fi + +# Extract the chart version and app version using yq +CHART_VERSION=$(yq e '.version' "$CHART_YAML") +APP_VERSION=$(yq e '.appVersion' "$CHART_YAML") + +# Check if extraction was successful +if [ -z "$CHART_VERSION" ] || [ -z "$APP_VERSION" ]; then + die "Failed to extract versions from Chart.yaml" +fi + +# Print the extracted versions +echo "Chart Version: $CHART_VERSION" +echo "App Version: $APP_VERSION" + +# Validate that the versions are valid semver +if [ "$(semver validate "$CHART_VERSION")" != "valid" ]; then + die "Invalid chart version: $CHART_VERSION" +fi + +if [ "$(semver validate "$APP_VERSION")" != "valid" ]; then + die "Invalid app version: $APP_VERSION" +fi + +help() { + cat < Name of the branch on which this workflow is running. + +Examples: + $(basename "$0") --branch develop +EOF +} + +# Parse arguments +while [ "$#" -gt 0 ]; do + case $1 in + -b|--branch) + BRANCH_NAME=$2 + shift + ;; + -h|--help) + help + exit 0 + ;; + *) + help + die "Unknown option: $1" + ;; + esac + shift +done + +# Extract major and minor version from the branch name +extract_major_minor() { + echo "$1" | awk -F/ '{print $2}' +} + +if [[ "$BRANCH_NAME" == "develop" ]]; then + if [[ "$CHART_VERSION" != *"-develop" ]]; then + die "Chart version must include '-develop' for develop branch" + fi + if [[ "$APP_VERSION" != *"-develop" ]]; then + die "App version must include '-develop' for develop branch" + fi +elif [[ "$BRANCH_NAME" =~ ^(release/[0-9]+\.[0-9]+)$ ]]; then + RELEASE_VERSION=$(extract_major_minor "$BRANCH_NAME") + if [[ "$CHART_VERSION" != "$RELEASE_VERSION."*"-prerelease" ]]; then + die "Chart version must be in format $RELEASE_VERSION.X-prerelease for release branch" + fi + if [[ "$APP_VERSION" != "$RELEASE_VERSION."*"-prerelease" ]]; then + die "App version must be in format $RELEASE_VERSION.X-prerelease for release branch" + fi +else + die "Unknown branch name: $BRANCH_NAME" +fi diff --git a/shell.nix b/shell.nix index 54f411c0..c92c800c 100644 --- a/shell.nix +++ b/shell.nix @@ -9,4 +9,4 @@ pkgs.mkShell { yq-go chart-testing ]; -} \ No newline at end of file +} From e8c2ec71df1d570636aee5737fe856dd0563cdd1 Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Fri, 25 Oct 2024 10:41:23 +0530 Subject: [PATCH 06/10] fix: scripts permissions Signed-off-by: Prateek Chandra --- scripts/update-chart-version.sh | 0 scripts/validate-chart-version.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/update-chart-version.sh mode change 100644 => 100755 scripts/validate-chart-version.sh diff --git a/scripts/update-chart-version.sh b/scripts/update-chart-version.sh old mode 100644 new mode 100755 diff --git a/scripts/validate-chart-version.sh b/scripts/validate-chart-version.sh old mode 100644 new mode 100755 From 66f8e1044a154f8f2d69f1a5d4ad1b9573fb0bba Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Fri, 25 Oct 2024 13:49:48 +0530 Subject: [PATCH 07/10] fix: chart version and code cov Signed-off-by: Prateek Chandra --- Makefile | 2 +- deploy/helm/charts/Chart.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 075a22de..212cb582 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,7 @@ testv: format # Requires KUBECONFIG env and Ginkgo binary .PHONY: integration-test integration-test: - @cd tests && sudo -E env "PATH=${PATH}" ginkgo -v --fail-fast + @cd tests && sudo -E env "PATH=${PATH}" ginkgo -v --fail-fast -coverprofile="../coverage.txt" -covermode=atomic; .PHONY: format format: diff --git a/deploy/helm/charts/Chart.yaml b/deploy/helm/charts/Chart.yaml index e06e74a4..440359d6 100644 --- a/deploy/helm/charts/Chart.yaml +++ b/deploy/helm/charts/Chart.yaml @@ -4,10 +4,10 @@ description: Helm chart for OpenEBS Dynamic Local PV. For instructions to instal type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 4.1.1 +version: 4.2.0-develop # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 4.1.1 +appVersion: 4.2.0-develop icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png home: http://www.openebs.io/ keywords: From 3dfd9d22c7542021eaf2ec7dbc449d78e8a91183 Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Fri, 25 Oct 2024 14:34:15 +0530 Subject: [PATCH 08/10] fix: test make file target Signed-off-by: Prateek Chandra --- .github/workflows/build.yml | 2 +- .github/workflows/pull_request.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7930c9ef..e2b940b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -173,7 +173,7 @@ jobs: go-version: 1.19.13 - name: Build images locally - run: make provisioner-localpv-image || exit 1; + run: make provisioner-localpv || exit 1; - name: Setup Minikube-Kubernetes uses: medyagh/setup-minikube@latest diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ca69278c..a19badbd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -131,7 +131,7 @@ jobs: go-version: 1.19.13 - name: Build images locally - run: make provisioner-localpv-image || exit 1; + run: make provisioner-localpv || exit 1; - name: Setup Minikube-Kubernetes uses: medyagh/setup-minikube@latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a48948b..7ded5667 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,7 +106,7 @@ jobs: go-version: 1.19.13 - name: Build images locally - run: make provisioner-localpv-image || exit 1; + run: make provisioner-localpv || exit 1; - name: Setup Minikube-Kubernetes uses: medyagh/setup-minikube@latest From ef0122826a58714807c5f3248fbb411bf0acdfb3 Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Fri, 25 Oct 2024 16:13:41 +0530 Subject: [PATCH 09/10] fix: added missed step Signed-off-by: Prateek Chandra --- .github/workflows/build.yml | 5 ++++- .github/workflows/pull_request.yml | 6 ++++-- .github/workflows/release.yml | 6 ++++-- scripts/update-chart-version.sh | 2 +- scripts/validate-chart-version.sh | 1 + shell.nix | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e2b940b2..8996f673 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -172,8 +172,11 @@ jobs: with: go-version: 1.19.13 + - name: Checkout + uses: actions/checkout@v4 + - name: Build images locally - run: make provisioner-localpv || exit 1; + run: make provisioner-localpv-image || exit 1; - name: Setup Minikube-Kubernetes uses: medyagh/setup-minikube@latest diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a19badbd..9bde2119 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -130,8 +130,11 @@ jobs: with: go-version: 1.19.13 + - name: Checkout + uses: actions/checkout@v4 + - name: Build images locally - run: make provisioner-localpv || exit 1; + run: make provisioner-localpv-image || exit 1; - name: Setup Minikube-Kubernetes uses: medyagh/setup-minikube@latest @@ -153,4 +156,3 @@ jobs: run: | make integration-test - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ded5667..b6c468ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,8 +105,11 @@ jobs: with: go-version: 1.19.13 + - name: Checkout + uses: actions/checkout@v4 + - name: Build images locally - run: make provisioner-localpv || exit 1; + run: make provisioner-localpv-image || exit 1; - name: Setup Minikube-Kubernetes uses: medyagh/setup-minikube@latest @@ -213,4 +216,3 @@ jobs: DBUILD_REPO_URL=https://github.com/openebs/dynamic-localpv-provisioner DBUILD_SITE_URL=https://openebs.io RELEASE_TAG=${{ env.RELEASE_TAG }} - diff --git a/scripts/update-chart-version.sh b/scripts/update-chart-version.sh index 90cfb017..f1111574 100755 --- a/scripts/update-chart-version.sh +++ b/scripts/update-chart-version.sh @@ -221,4 +221,4 @@ if [[ -z $NO_OP ]]; then else die "Failed to update the chart versions" fi -fi \ No newline at end of file +fi diff --git a/scripts/validate-chart-version.sh b/scripts/validate-chart-version.sh index c21fba8e..5d05e5f7 100755 --- a/scripts/validate-chart-version.sh +++ b/scripts/validate-chart-version.sh @@ -101,3 +101,4 @@ elif [[ "$BRANCH_NAME" =~ ^(release/[0-9]+\.[0-9]+)$ ]]; then else die "Unknown branch name: $BRANCH_NAME" fi + diff --git a/shell.nix b/shell.nix index c92c800c..3e5dffe4 100644 --- a/shell.nix +++ b/shell.nix @@ -10,3 +10,4 @@ pkgs.mkShell { chart-testing ]; } + From e00db459c01f3679e055b66e8f9026d212cee8f6 Mon Sep 17 00:00:00 2001 From: Prateek Chandra Date: Fri, 25 Oct 2024 17:25:50 +0530 Subject: [PATCH 10/10] fix: missin namespace Signed-off-by: Prateek Chandra --- .github/workflows/build.yml | 1 + .github/workflows/pull_request.yml | 1 + .github/workflows/release.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8996f673..f61a26f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -190,6 +190,7 @@ jobs: - name: Set up infra for integration test run: | + OPENEBS_NAMESPACE="openebs" sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r` go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 helm install localpv-provisioner ./deploy/helm/charts -n $OPENEBS_NAMESPACE --create-namespace --set localpv.image.pullPolicy=Never --set analytics.enabled=false diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9bde2119..961f784f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -148,6 +148,7 @@ jobs: - name: Set up infra for integration test run: | + OPENEBS_NAMESPACE="openebs" sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r` go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 helm install localpv-provisioner ./deploy/helm/charts -n $OPENEBS_NAMESPACE --create-namespace --set localpv.image.pullPolicy=Never --set analytics.enabled=false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6c468ee..6a73b5a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -123,6 +123,7 @@ jobs: - name: Set up infra for integration test run: | + OPENEBS_NAMESPACE="openebs" sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r` go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.14.0 helm install localpv-provisioner ./deploy/helm/charts -n $OPENEBS_NAMESPACE --create-namespace --set localpv.image.pullPolicy=Never --set analytics.enabled=false