From 025471610d63df63e72bc7b837c1e13693747232 Mon Sep 17 00:00:00 2001 From: Ben Eli Date: Wed, 4 Jun 2025 22:06:06 +0200 Subject: [PATCH 01/13] Delete .github/workflows directory --- .github/workflows/Validate-package-lock.yaml | 79 --------------- .github/workflows/build-arm64-image.yaml | 88 ----------------- .github/workflows/build-ppc64le-image.yaml | 88 ----------------- .github/workflows/ceph-nsfs-s3-tests.yaml | 24 ----- .github/workflows/ceph-s3-tests.yaml | 24 ----- .github/workflows/current-ver-build.yaml | 19 ---- .github/workflows/jest-unit-tests.yaml | 21 ---- .github/workflows/manual-build-rpm.yaml | 33 ------- .github/workflows/manual-full-build.yaml | 95 ------------------- .../manual-rpm-build-and-install-test.yaml | 22 ----- .github/workflows/nc_unit.yml | 17 ---- .github/workflows/next-ver-build.yaml | 22 ----- .../nightly-rpm-build-and-install-test.yaml | 20 ---- .../workflows/nightly-rpm-master-build.yaml | 11 --- .github/workflows/nightly-tests.yaml | 18 ---- .github/workflows/postgres-unit-tests.yaml | 16 ---- .github/workflows/releaser.yaml | 46 --------- .../rpm-build-and-install-test-base.yaml | 27 ------ .../workflows/rpm-build-and-upload-flow.yaml | 63 ------------ .github/workflows/rpm-build-base.yaml | 85 ----------------- .github/workflows/sanity-ssl.yaml | 20 ---- .github/workflows/sanity.yaml | 20 ---- .github/workflows/stale.yml | 50 ---------- .github/workflows/test-aws-sdk-clients.yaml | 36 ------- .github/workflows/unit.yaml | 18 ---- .github/workflows/upload-rpm-to-aws.yaml | 29 ------ .github/workflows/warp-nc-tests.yaml | 31 ------ .github/workflows/warp-tests.yaml | 30 ------ .github/workflows/weekly-build.yaml | 17 ---- 29 files changed, 1069 deletions(-) delete mode 100644 .github/workflows/Validate-package-lock.yaml delete mode 100644 .github/workflows/build-arm64-image.yaml delete mode 100644 .github/workflows/build-ppc64le-image.yaml delete mode 100644 .github/workflows/ceph-nsfs-s3-tests.yaml delete mode 100644 .github/workflows/ceph-s3-tests.yaml delete mode 100644 .github/workflows/current-ver-build.yaml delete mode 100644 .github/workflows/jest-unit-tests.yaml delete mode 100644 .github/workflows/manual-build-rpm.yaml delete mode 100644 .github/workflows/manual-full-build.yaml delete mode 100644 .github/workflows/manual-rpm-build-and-install-test.yaml delete mode 100644 .github/workflows/nc_unit.yml delete mode 100644 .github/workflows/next-ver-build.yaml delete mode 100644 .github/workflows/nightly-rpm-build-and-install-test.yaml delete mode 100644 .github/workflows/nightly-rpm-master-build.yaml delete mode 100644 .github/workflows/nightly-tests.yaml delete mode 100644 .github/workflows/postgres-unit-tests.yaml delete mode 100644 .github/workflows/releaser.yaml delete mode 100644 .github/workflows/rpm-build-and-install-test-base.yaml delete mode 100644 .github/workflows/rpm-build-and-upload-flow.yaml delete mode 100644 .github/workflows/rpm-build-base.yaml delete mode 100644 .github/workflows/sanity-ssl.yaml delete mode 100644 .github/workflows/sanity.yaml delete mode 100644 .github/workflows/stale.yml delete mode 100644 .github/workflows/test-aws-sdk-clients.yaml delete mode 100644 .github/workflows/unit.yaml delete mode 100644 .github/workflows/upload-rpm-to-aws.yaml delete mode 100644 .github/workflows/warp-nc-tests.yaml delete mode 100644 .github/workflows/warp-tests.yaml delete mode 100644 .github/workflows/weekly-build.yaml diff --git a/.github/workflows/Validate-package-lock.yaml b/.github/workflows/Validate-package-lock.yaml deleted file mode 100644 index 3588156aec..0000000000 --- a/.github/workflows/Validate-package-lock.yaml +++ /dev/null @@ -1,79 +0,0 @@ -name: Validate package-lock.json Tests -on: [push, pull_request] - -jobs: - run-package-lock-validation: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: 22 - - - name: Backup the current package-lock.json - run: | - # Backup the current package-lock.json - mv package-lock.json package-lock-backup.json - - # Generate a new package-lock.json - npm install - - - name: Validate top-level versions in package-lock.json - run: | - # Validate the main version field - top_version_backup=$(jq -r '.version' package-lock-backup.json) - top_version_new=$(jq -r '.version' package-lock.json) - - # Define the ANSI escape code for red - RED='\033[0;31m' - NC='\033[0m' # No Color (resets the color) - - if [ "$top_version_backup" != "$top_version_new" ]; then - echo "The top-level version in package-lock.json is inconsistent." - echo -e "${RED}Original version: $top_version_backup${NC}" - echo -e "${RED}Generated version: $top_version_new${NC}" - exit 1 - fi - - - name: Validate dependencies top-level versions in package-lock.json - run: | - # Extract and validate top-level module versions - jq '.packages[""].dependencies' package-lock-backup.json > top-level-versions-backup.json - jq '.packages[""].dependencies' package-lock.json > top-level-versions-new.json - - if ! diff -q top-level-versions-backup.json top-level-versions-new.json > /dev/null; then - echo -e "${RED}Top-level module versions in package-lock.json are inconsistent.${NC}" - echo -e "${RED}Differences:${NC}" - diff top-level-versions-backup.json top-level-versions-new.json || true - exit 1 - else - echo "Top-level module versions are consistent. Validation passed." - fi - - - name: Validate devDependencies top-level versions in package-lock.json - run: | - # Extract and validate top-level module versions - jq '.packages[""].devDependencies' package-lock-backup.json > top-level-versions-backup.json - jq '.packages[""].devDependencies' package-lock.json > top-level-versions-new.json - - - # Define the ANSI escape code for red - RED='\033[0;31m' - NC='\033[0m' # No Color (resets the color) - - if ! diff -q top-level-versions-backup.json top-level-versions-new.json > /dev/null; then - echo -e "${RED}Top-level module versions in package-lock.json are inconsistent.${NC}" - echo -e "${RED}Differences:${NC}" - diff top-level-versions-backup.json top-level-versions-new.json || true - exit 1 - else - echo "Top-level module versions are consistent. Validation passed." - fi - \ No newline at end of file diff --git a/.github/workflows/build-arm64-image.yaml b/.github/workflows/build-arm64-image.yaml deleted file mode 100644 index 2b91a8dcc2..0000000000 --- a/.github/workflows/build-arm64-image.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: Build arm64 image -on: [ push, pull_request ] - -jobs: - build-arm64-image: - runs-on: ubuntu-22.04 - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - env: - # For multiplatform use list like: - # "linux/amd64,linux/arm64" - PLATFORMS: "linux/arm64" - GIT_COMMIT: ${{ github.sha }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.branch }} - - - name: Enable emulation - run: | - sudo apt-get update - sudo apt-get install -y \ - qemu qemu-user-static - sudo update-binfmts --display - echo "ℹ️ podman" - podman version - echo "ℹ️ buildah" - buildah version - echo "ℹ️ skopeo" - skopeo -v - - - name: Get Current Date - id: date - run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT - - - name: Prepare Suffix - id: suffix - if: ${{ github.event.inputs.tag != '' }} - run: echo suffix="-${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT - - - name: Prepare Tags - id: prep - run: | - DOCKER_BASE_IMAGE=noobaa/noobaa-base - DOCKER_BUILDER_IMAGE=noobaa/noobaa-builder - DOCKER_CORE_IMAGE=noobaa/noobaa-core - VERSION="${{ steps.date.outputs.date }}" - echo "::warning ${VERSION}" - BASE_TAGS="${DOCKER_BASE_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - BUILDER_TAGS="${DOCKER_BUILDER_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - CORE_TAGS="${DOCKER_CORE_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - CORE_OCS_DEV_TAG="ocs-dev/noobaa-core:${{ github.event.inputs.branch }}-latest" - echo "::warning ${CORE_TAGS}" - echo "basetags=${BASE_TAGS}" >> $GITHUB_OUTPUT - echo "buildertags=${BUILDER_TAGS}" >> $GITHUB_OUTPUT - echo "coretags=${CORE_TAGS}" >> $GITHUB_OUTPUT - echo "ocsdevlatest=${CORE_OCS_DEV_TAG}" >> $GITHUB_OUTPUT - - - name: Build Builder Images - run: | - buildah build \ - -f src/deploy/NVA_build/builder.Dockerfile \ - --platform=$PLATFORMS \ - --manifest localhost/noobaa-builder - #echo "ℹ️ Inspect noobaa-builder manifest" - #skopeo inspect --raw containers-storage:localhost/noobaa-builder - - - name: Build Base Images - run: | - buildah build \ - -f src/deploy/NVA_build/Base.Dockerfile \ - --platform=$PLATFORMS \ - --manifest localhost/noobaa-base - #echo "ℹ️ Inspect noobaa-base manifest" - #skopeo inspect --raw containers-storage:localhost/noobaa-base - - - name: Build NooBaa Images - run: | - buildah build \ - -f src/deploy/NVA_build/NooBaa.Dockerfile \ - --build-arg GIT_COMMIT=$GIT_COMMIT \ - --platform=$PLATFORMS \ - --manifest localhost/noobaa - #echo "ℹ️ Inspect noobaa manifest" - #skopeo inspect --raw containers-storage:localhost/noobaa diff --git a/.github/workflows/build-ppc64le-image.yaml b/.github/workflows/build-ppc64le-image.yaml deleted file mode 100644 index 0c3e765ae9..0000000000 --- a/.github/workflows/build-ppc64le-image.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: Build ppc64le image -on: [ push, pull_request ] - -jobs: - build-ppc64le-image: - runs-on: ubuntu-22.04 - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - env: - # For multiplatform use list like: - # "linux/amd64,linux/arm64" - PLATFORMS: "linux/ppc64le" - GIT_COMMIT: ${{ github.sha }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.branch }} - - - name: Enable emulation - run: | - sudo apt-get update - sudo apt-get install -y \ - qemu qemu-user-static - sudo update-binfmts --display - echo "ℹ️ podman" - podman version - echo "ℹ️ buildah" - buildah version - echo "ℹ️ skopeo" - skopeo -v - - - name: Get Current Date - id: date - run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT - - - name: Prepare Suffix - id: suffix - if: ${{ github.event.inputs.tag != '' }} - run: echo suffix="-${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT - - - name: Prepare Tags - id: prep - run: | - DOCKER_BASE_IMAGE=noobaa/noobaa-base - DOCKER_BUILDER_IMAGE=noobaa/noobaa-builder - DOCKER_CORE_IMAGE=noobaa/noobaa-core - VERSION="${{ steps.date.outputs.date }}" - echo "::warning ${VERSION}" - BASE_TAGS="${DOCKER_BASE_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - BUILDER_TAGS="${DOCKER_BUILDER_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - CORE_TAGS="${DOCKER_CORE_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - CORE_OCS_DEV_TAG="ocs-dev/noobaa-core:${{ github.event.inputs.branch }}-latest" - echo "::warning ${CORE_TAGS}" - echo "basetags=${BASE_TAGS}" >> $GITHUB_OUTPUT - echo "buildertags=${BUILDER_TAGS}" >> $GITHUB_OUTPUT - echo "coretags=${CORE_TAGS}" >> $GITHUB_OUTPUT - echo "ocsdevlatest=${CORE_OCS_DEV_TAG}" >> $GITHUB_OUTPUT - - - name: Build Builder Images - run: | - buildah build \ - -f src/deploy/NVA_build/builder.Dockerfile \ - --platform=$PLATFORMS \ - --manifest localhost/noobaa-builder - #echo "ℹ️ Inspect noobaa-builder manifest" - #skopeo inspect --raw containers-storage:localhost/noobaa-builder - - - name: Build Base Images - run: | - buildah build \ - -f src/deploy/NVA_build/Base.Dockerfile \ - --platform=$PLATFORMS \ - --manifest localhost/noobaa-base - #echo "ℹ️ Inspect noobaa-base manifest" - #skopeo inspect --raw containers-storage:localhost/noobaa-base - - - name: Build NooBaa Images - run: | - buildah build \ - -f src/deploy/NVA_build/NooBaa.Dockerfile \ - --build-arg GIT_COMMIT=$GIT_COMMIT \ - --platform=$PLATFORMS \ - --manifest localhost/noobaa - #echo "ℹ️ Inspect noobaa manifest" - #skopeo inspect --raw containers-storage:localhost/noobaa diff --git a/.github/workflows/ceph-nsfs-s3-tests.yaml b/.github/workflows/ceph-nsfs-s3-tests.yaml deleted file mode 100644 index 90a1a79de8..0000000000 --- a/.github/workflows/ceph-nsfs-s3-tests.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: NSFS Ceph S3 Tests -on: [push, pull_request, workflow_dispatch] - -jobs: - nsfs-ceph-s3-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout noobaa-core - uses: actions/checkout@v4 - with: - repository: 'noobaa/noobaa-core' - path: 'noobaa-core' - - - name: Run NSFS Ceph s3-tests - run: | - set -x - cd ./noobaa-core - mkdir -p logs/ceph-nsfs-test-logs - chmod 777 logs/ceph-nsfs-test-logs - make test-nsfs-cephs3 diff --git a/.github/workflows/ceph-s3-tests.yaml b/.github/workflows/ceph-s3-tests.yaml deleted file mode 100644 index acba9eb7cb..0000000000 --- a/.github/workflows/ceph-s3-tests.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Ceph S3 Tests -on: [push, pull_request, workflow_dispatch] - -jobs: - ceph-s3-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout noobaa-core - uses: actions/checkout@v4 - with: - repository: 'noobaa/noobaa-core' - path: 'noobaa-core' - - - name: Run Ceph s3-tests - run: | - set -x - cd ./noobaa-core - mkdir -p logs/ceph-test-logs - chmod 777 logs/ceph-test-logs - make test-cephs3 diff --git a/.github/workflows/current-ver-build.yaml b/.github/workflows/current-ver-build.yaml deleted file mode 100644 index e9ff8a0218..0000000000 --- a/.github/workflows/current-ver-build.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Current Version Build on Changes -# Run on Backports -on: - push: - branches: - - 5.10 - -jobs: - publish-image: - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - name: Invoke Build on Operator Repo - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: Manual Build Dispatch - repo: noobaa/noobaa-core - token: ${{ secrets.GHACCESSTOKEN }} - inputs: '{ "branch": "5.10", "tag": "" }' diff --git a/.github/workflows/jest-unit-tests.yaml b/.github/workflows/jest-unit-tests.yaml deleted file mode 100644 index e7d96732d3..0000000000 --- a/.github/workflows/jest-unit-tests.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Jest Unit Tests -on: [push, pull_request, workflow_dispatch] - -jobs: - run-jest-unit-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: Run Jest Unit Test - run: | - sudo apt-get update --fix-missing - sudo apt-get -y install nasm libcap-dev - npm install - npm run build - npm run jest diff --git a/.github/workflows/manual-build-rpm.yaml b/.github/workflows/manual-build-rpm.yaml deleted file mode 100644 index 6b64d7fb11..0000000000 --- a/.github/workflows/manual-build-rpm.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Manual RPM Build Dispatch -on: - workflow_dispatch: - inputs: - branch: - description: 'Branch to RPM Build From' - required: true - tag: - description: 'Additional tag for the build (such as alpha, beta, etc.) - Optional' - default: '' - centos_ver: - type: choice - description: 'Centos Base image (options: 8/9) - Optional, default is 9' - default: '9' - options: - - '8' - - '9' - architecture: - type: choice - description: 'Architecture (options: linux/amd64 or linux/ppc64le) - Optional, default is linux/amd64' - default: 'linux/amd64' - options: - - 'linux/amd64' - - 'linux/ppc64le' - -jobs: - call-rpm-build: - uses: ./.github/workflows/rpm-build-base.yaml - with: - branch: ${{ github.event.inputs.branch }} - centos_ver: ${{ github.event.inputs.centos_ver }} - tag: ${{ github.event.inputs.tag }} - architecture: ${{ github.event.inputs.architecture }} diff --git a/.github/workflows/manual-full-build.yaml b/.github/workflows/manual-full-build.yaml deleted file mode 100644 index c70e9b60e1..0000000000 --- a/.github/workflows/manual-full-build.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: Manual Build Dispatch -on: - workflow_dispatch: - inputs: - branch: - description: 'Branch to Build From' - required: true - tag: - description: 'Additional tag for the build (such as alpha, beta, etc.) - Optional' - default: '' - -jobs: - manual-build-and-publish-image: - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.branch }} - - - name: Get Current Date - id: date - run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT - - - name: Prepare Suffix - id: suffix - if: ${{ github.event.inputs.tag != '' }} - run: echo suffix="-${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT - - - name: Prepare Tags - id: prep - run: | - DOCKER_BASE_IMAGE=noobaa/noobaa-base - DOCKER_BUILDER_IMAGE=noobaa/noobaa-builder - DOCKER_CORE_IMAGE=noobaa/noobaa-core - VERSION="${{ steps.date.outputs.date }}" - echo "::warning ${VERSION}" - BASE_TAGS="${DOCKER_BASE_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - BUILDER_TAGS="${DOCKER_BUILDER_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - CORE_TAGS="${DOCKER_CORE_IMAGE}:${{ github.event.inputs.branch }}-${VERSION}${{ steps.suffix.outputs.suffix }}" - CORE_OCS_DEV_TAG="ocs-dev/noobaa-core:${{ github.event.inputs.branch }}-latest" - echo "::warning ${CORE_TAGS}" - echo "basetags=${BASE_TAGS}" >> $GITHUB_OUTPUT - echo "buildertags=${BUILDER_TAGS}" >> $GITHUB_OUTPUT - echo "coretags=${CORE_TAGS}" >> $GITHUB_OUTPUT - echo "ocsdevlatest=${CORE_OCS_DEV_TAG}" >> $GITHUB_OUTPUT - - - name: Login to DockerHub Registry - run: echo ${{ secrets.GHACTIONSDOCKERHUB }} | docker login -u ${{ secrets.GHACTIONSDOCKERHUBNAME }} --password-stdin - - - name: Build & Push Docker Images to DockerHub - env: - DOCKERHUB_OWNER: ${{ secrets.GHACTIONSDOCKERHUBNAME }} - run: | - make noobaa - docker tag noobaa-base ${{ steps.prep.outputs.basetags }} - docker push ${{ steps.prep.outputs.basetags }} - docker tag noobaa-builder ${{ steps.prep.outputs.buildertags }} - docker push ${{ steps.prep.outputs.buildertags }} - docker tag noobaa ${{ steps.prep.outputs.coretags }} - docker push ${{ steps.prep.outputs.coretags }} - - - name: Login to Quay Registry - run: echo ${{ secrets.GHACTIONQUAYTOKEN }} | docker login quay.io -u ${{ secrets.GHACTIONQUAYNAME }} --password-stdin - - - name: Push Docker Images to Quay - env: - DOCKERHUB_OWNER: ${{ secrets.GHACTIONQUAYNAME }} - run: | - docker tag ${{ steps.prep.outputs.coretags }} quay.io/${{ steps.prep.outputs.coretags }} - docker push quay.io/${{ steps.prep.outputs.coretags }} - - - name: Push to ocs-dev as latest - env: - DOCKERHUB_OWNER: ${{ secrets.GHACTIONQUAYNAME }} - run: | - docker login -u="${{ secrets.OCSDEVCIUSER }}" -p="${{ secrets.OCSDEVCITOKEN }}" quay.io - docker tag ${{ steps.prep.outputs.coretags }} quay.io/${{ steps.prep.outputs.ocsdevlatest }} - docker push quay.io/${{ steps.prep.outputs.ocsdevlatest }} - - - name: Sleep for 180 seconds - run: sleep 180s - shell: bash - - - name: Invoke Build on Operator Repo - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: Manual Operator Build Dispatch - repo: noobaa/noobaa-operator - token: ${{ secrets.GHACCESSTOKEN }} - inputs: '{ "branch": "${{ github.event.inputs.branch }}", "tag": "${{ github.event.inputs.tag }}" }' - - - diff --git a/.github/workflows/manual-rpm-build-and-install-test.yaml b/.github/workflows/manual-rpm-build-and-install-test.yaml deleted file mode 100644 index 8292160c40..0000000000 --- a/.github/workflows/manual-rpm-build-and-install-test.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Manual RPM Build and Install Test Dispatch -on: - workflow_dispatch: - inputs: - branch: - description: 'Branch to RPM Build and Install From' - required: true - centos_ver: - type: choice - description: 'Centos Base image (options: 8/9) - Optional, default is 9' - default: '9' - options: - - '8' - - '9' - -# Currently the only supported arch is linux/amd64 (x86_64) -jobs: - manual-build-rpm-and-install: - uses: ./.github/workflows/rpm-build-and-install-test-base.yaml - with: - branch: ${{ github.event.inputs.branch }} - centos_ver: ${{ github.event.inputs.centos_ver }} diff --git a/.github/workflows/nc_unit.yml b/.github/workflows/nc_unit.yml deleted file mode 100644 index dfe66d858e..0000000000 --- a/.github/workflows/nc_unit.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Non Containerized Unit Tests -on: [push, pull_request] - -jobs: - run-nc-unit-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: Run Non Containerized Test - run: | - make run-nc-tests diff --git a/.github/workflows/next-ver-build.yaml b/.github/workflows/next-ver-build.yaml deleted file mode 100644 index 304a08441f..0000000000 --- a/.github/workflows/next-ver-build.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Next Version Build -on: - schedule: - - cron: "0 12 * * 1" - workflow_dispatch: - inputs: - branch: - description: 'Branch to Build From - Optional' - required: false - -jobs: - publish-image: - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - name: Invoke Build on Operator Repo - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: Manual Build Dispatch - repo: noobaa/noobaa-core - token: ${{ secrets.GHACCESSTOKEN }} - inputs: '{ "branch": "5.11", "tag": "" }' diff --git a/.github/workflows/nightly-rpm-build-and-install-test.yaml b/.github/workflows/nightly-rpm-build-and-install-test.yaml deleted file mode 100644 index 8628a4886a..0000000000 --- a/.github/workflows/nightly-rpm-build-and-install-test.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Nightly RPM Build and Install Test -on: - schedule: - - cron: '0 0 * * *' - -# Currently the only supported arch is linux/amd64 (x86_64) -jobs: - call-master-rpm-build-and-install-test-centos9: - uses: ./.github/workflows/rpm-build-and-install-test-base.yaml - secrets: inherit - with: - branch: 'master' - centos_ver: '9' - - # call-master-rpm-build-and-install-test-centos8: - # uses: ./.github/workflows/rpm-build-and-install-test-base.yaml - # secrets: inherit - # with: - # branch: 'master' - # centos_ver: '8' diff --git a/.github/workflows/nightly-rpm-master-build.yaml b/.github/workflows/nightly-rpm-master-build.yaml deleted file mode 100644 index 07e0a31564..0000000000 --- a/.github/workflows/nightly-rpm-master-build.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Nightly RPM Build - Master Branch -on: - schedule: - - cron: '0 0 * * *' - -jobs: - call-master-rpm-build-and-upload: - uses: ./.github/workflows/rpm-build-and-upload-flow.yaml - secrets: inherit - with: - branch: 'master' diff --git a/.github/workflows/nightly-tests.yaml b/.github/workflows/nightly-tests.yaml deleted file mode 100644 index e41c8488b7..0000000000 --- a/.github/workflows/nightly-tests.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: Nightly Tests -on: workflow_dispatch - -jobs: - nightly-tests: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: Run Nightly Tests - run: | - make test - docker run --rm -e NEWAWSPROJKEY=${{ secrets.NEWAWSPROJKEY }} \ - -e NEWAWSPROJSECRET=${{ secrets.NEWAWSPROJSECRET }} \ - -e NEWAZUREPROJKEY=${{ secrets.NEWAZUREPROJKEY }} \ - -e NEWAZUREPROJSECRET=${{ secrets.NEWAZUREPROJSECRET }} \ - --name test1 noobaa-tester ./src/test/unit_tests/run_npm_test_on_test_container.sh -s test_s3_ops.js diff --git a/.github/workflows/postgres-unit-tests.yaml b/.github/workflows/postgres-unit-tests.yaml deleted file mode 100644 index e7e16ea408..0000000000 --- a/.github/workflows/postgres-unit-tests.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Unit Tests with Postgres -on: [push, pull_request] - -jobs: - run-unit-tests-postgres: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run Unit Tests with Postgres - run: make test-postgres diff --git a/.github/workflows/releaser.yaml b/.github/workflows/releaser.yaml deleted file mode 100644 index 59c4866d88..0000000000 --- a/.github/workflows/releaser.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: Releaser - -on: - workflow_dispatch: - inputs: - base_branch: - description: 'The base branch to release from' - required: true - sync_operator_repository: - description: "Sync operator repository" - required: false - default: "noobaa-operator" - -permissions: - contents: write - -jobs: - releaser: - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - name: Set branch - run: echo "BRANCH=${{ github.event.inputs.base_branch }}" >> $GITHUB_ENV - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ env.BRANCH }} - - name: Fetch all tags - run: git fetch --force --tags - - uses: actions/setup-node@v3 - with: - node-version-file: .nvmrc - - name: Release NooBaa Core Image - env: - GITHUB_TOKEN: ${{ secrets.GHACCESSTOKEN }} - DOCKERHUB_USERNAME: noobaa - DOCKERHUB_TOKEN: ${{ secrets.GHACTIONSDOCKERHUB }} - QUAY_USERNAME: noobaa - QUAY_TOKEN: ${{ secrets.GHACTIONQUAYTOKEN }} - OCI_ORG: noobaa - BASE_BRANCH: "${{ github.event.inputs.base_branch }}" - run: | - git config --global user.email "github-action@noobaa.io" - git config --global user.name "NooBaa GitHub Action" - - bash tools/releaser.sh --oci-org $OCI_ORG --sync-operator-repository ${{ github.event.inputs.sync_operator_repository }} --gh-org noobaa diff --git a/.github/workflows/rpm-build-and-install-test-base.yaml b/.github/workflows/rpm-build-and-install-test-base.yaml deleted file mode 100644 index abc5b7f528..0000000000 --- a/.github/workflows/rpm-build-and-install-test-base.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: RPM Build and Install Test Workflow -on: - workflow_call: - inputs: - branch: - type: string - description: 'Branch to Build RPM From' - required: true - centos_ver: - type: string - description: 'Centos Base image (options: 8/9) - Optional, default is 9' - default: '9' - -jobs: - rpm-build-and-and-install-test-base: - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ inputs.branch }} - - - name: Run Non Containerized RPM Build And Install Test - run: | - make rpm-build-and-install-test BUILD_S3SELECT=0 CENTOS_VER=${{ inputs.centos_ver }} CONTAINER_PLATFORM=linux/amd64 - diff --git a/.github/workflows/rpm-build-and-upload-flow.yaml b/.github/workflows/rpm-build-and-upload-flow.yaml deleted file mode 100644 index 500e72402f..0000000000 --- a/.github/workflows/rpm-build-and-upload-flow.yaml +++ /dev/null @@ -1,63 +0,0 @@ -name: RPM Build And Upload Flow -on: - workflow_call: - inputs: - branch: - type: string - description: 'Run rpm build and upload to aws flow' - default: 'master' - -jobs: - build-rpm-centos8: - uses: ./.github/workflows/rpm-build-base.yaml - with: - branch: ${{ inputs.branch }} - centos_ver: '8' - - build-rpm-centos9: - uses: ./.github/workflows/rpm-build-base.yaml - with: - branch: ${{ inputs.branch }} - centos_ver: '9' - - build-rpm-centos8-ppc64le: - uses: ./.github/workflows/rpm-build-base.yaml - with: - branch: ${{ inputs.branch }} - centos_ver: '8' - architecture: 'linux/ppc64le' - - build-rpm-centos9-ppc64le: - uses: ./.github/workflows/rpm-build-base.yaml - with: - branch: ${{ inputs.branch }} - centos_ver: '9' - architecture: 'linux/ppc64le' - - upload-centos8-rpm-to-aws: - needs: build-rpm-centos8 - uses: ./.github/workflows/upload-rpm-to-aws.yaml - with: - rpm_full_path: ${{ needs.build-rpm-centos8.outputs.rpm_full_path }} - secrets: inherit - - upload-centos9-rpm-to-aws: - needs: build-rpm-centos9 - uses: ./.github/workflows/upload-rpm-to-aws.yaml - with: - rpm_full_path: ${{ needs.build-rpm-centos9.outputs.rpm_full_path }} - secrets: inherit - - upload-centos8-ppc64le-rpm-to-aws: - needs: build-rpm-centos8-ppc64le - uses: ./.github/workflows/upload-rpm-to-aws.yaml - with: - rpm_full_path: ${{ needs.build-rpm-centos8-ppc64le.outputs.rpm_full_path }} - secrets: inherit - - upload-centos9-ppc64le-rpm-to-aws: - needs: build-rpm-centos9-ppc64le - uses: ./.github/workflows/upload-rpm-to-aws.yaml - with: - rpm_full_path: ${{ needs.build-rpm-centos9-ppc64le.outputs.rpm_full_path }} - secrets: inherit diff --git a/.github/workflows/rpm-build-base.yaml b/.github/workflows/rpm-build-base.yaml deleted file mode 100644 index a75de404e4..0000000000 --- a/.github/workflows/rpm-build-base.yaml +++ /dev/null @@ -1,85 +0,0 @@ -name: RPM Build Base Call Workflow -on: - workflow_call: - inputs: - branch: - type: string - description: 'Branch to Build RPM From' - required: true - tag: - type: string - description: 'Additional tag for the build (such as alpha, beta, etc.) - Optional' - default: '' - centos_ver: - type: string - description: 'Centos Base image (options: 8/9) - Optional, default is 9' - default: '9' - architecture: - type: string - description: 'Architecture (options: linux/amd64 or linux/ppc64le) - Optional, default is linux/amd64' - default: 'linux/amd64' - outputs: - rpm_full_path: - description: 'rpm full path' - value: ${{ jobs.rpm-build-and-upload-artifact.outputs.rpm_full_path }} - -jobs: - rpm-build-and-upload-artifact: - runs-on: ubuntu-latest - timeout-minutes: 90 - outputs: - rpm_full_path: ${{ steps.finalize_full_rpm_path.outputs.rpm_full_path }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ inputs.branch }} - - - name: Prepare Suffix - id: suffix - if: ${{ inputs.tag != '' }} - run: echo suffix="-${{ inputs.tag }}" >> $GITHUB_OUTPUT - - - name: Prepare CENTOS base image version - id: centos_ver - run: echo "centos_ver=${{ inputs.centos_ver }}" >> $GITHUB_OUTPUT - - - name: Prepare linux architecture - id: architecture - run: | - if [ "${{ inputs.architecture }}" == "linux/amd64" ]; then - ARCH_SUFFIX="x86_64" - echo "architecture=${ARCH_SUFFIX}" >> $GITHUB_OUTPUT - elif [ "${{ inputs.architecture }}" == "linux/ppc64le" ]; then - ARCH_SUFFIX="ppc64le" - echo "architecture=${ARCH_SUFFIX}" >> $GITHUB_OUTPUT - # enable cross-architecture builds - docker run --privileged --rm tonistiigi/binfmt --install all - fi - - - name: Build RPM - id: build_rpm - run: | - echo "Starting make rpm" - make rpm CENTOS_VER=${{ steps.centos_ver.outputs.centos_ver }} CONTAINER_PLATFORM=${{ inputs.architecture }} - echo "Make rpm completed" - - - name: Finalize RPM - id: finalize_full_rpm_path - run: | - DATE=$(date +'%Y%m%d') - VERSION=$(jq -r '.version' < ./package.json) - CENTOS_VER=${{ steps.centos_ver.outputs.centos_ver }} - ARCH=${{ steps.architecture.outputs.architecture }} - RPM_SUFFIX=el${CENTOS_VER}.${ARCH}.rpm - RPM_BASE_VERSION=noobaa-core-${VERSION}-${DATE} - RPM_FULL_PATH=${RPM_BASE_VERSION}-${{ inputs.branch }}${{ steps.suffix.outputs.suffix }}.${RPM_SUFFIX} - echo "rpm_full_path=${RPM_FULL_PATH}" - cp ./build/rpm/${RPM_BASE_VERSION}.${RPM_SUFFIX} ${RPM_FULL_PATH} - echo "rpm_full_path=${RPM_FULL_PATH}" >> $GITHUB_OUTPUT - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.finalize_full_rpm_path.outputs.rpm_full_path }} - path: ${{ steps.finalize_full_rpm_path.outputs.rpm_full_path }} diff --git a/.github/workflows/sanity-ssl.yaml b/.github/workflows/sanity-ssl.yaml deleted file mode 100644 index 427c7a88f9..0000000000 --- a/.github/workflows/sanity-ssl.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build & Sanity SSL -on: [push, pull_request] - -jobs: - run-sanity-ssl-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run Build & SSL Sanity Tests - run: | - set -x - mkdir -p logs/sanity-test-logs - chmod 777 logs/sanity-test-logs - make test-external-pg-sanity diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml deleted file mode 100644 index 11b44319b2..0000000000 --- a/.github/workflows/sanity.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build & Sanity -on: [push, pull_request] - -jobs: - run-sanity-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run Build & Sanity Tests - run: | - set -x - mkdir -p logs/sanity-test-logs - chmod 777 logs/sanity-test-logs - make test-sanity diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 1b9cf1dd53..0000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. -# -# You can adjust the behavior by modifying this file. -# For more information, see: -# https://github.com/actions/stale -name: Mark stale issues and pull requests - -on: - schedule: - - cron: '0 11 * * *' - -jobs: - stale: - - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - - steps: - # Handle non exempted issues - - uses: actions/stale@v5 - with: - exempt-issue-labels: 'Type:Enhancement, Type:Question, Type:Technical Debt' - exempt-all-milestones: true - - days-before-stale: 90 - days-before-pr-stale: 90 - days-before-issue-stale: 90 - stale-pr-message: 'This PR had no activity for too long - it will now be labeled stale. Update it to prevent it from getting closed.' - stale-issue-message: 'This issue had no activity for too long - it will now be labeled stale. Update it to prevent it from getting closed.' - - days-before-close: 30 - days-before-pr-close: 30 - days-before-issue-close: 30 - close-pr-message: 'This PR is stale and had no activity for too long - it will now be closed.' - close-issue-message: 'This issue is stale and had no activity for too long - it will now be closed.' - - # Handle exempted issues - - uses: actions/stale@v5 - with: - - days-before-stale: 180 - days-before-issue-stale: 180 - stale-issue-message: 'This issue had no activity for too long - it will now be labeled stale. Update it to prevent it from getting closed.' - - days-before-close: 30 - days-before-pr-close: 30 - days-before-issue-close: 30 - close-issue-message: 'This issue is stale and had no activity for too long - it will now be closed.' \ No newline at end of file diff --git a/.github/workflows/test-aws-sdk-clients.yaml b/.github/workflows/test-aws-sdk-clients.yaml deleted file mode 100644 index e58b614bff..0000000000 --- a/.github/workflows/test-aws-sdk-clients.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Test AWS SDK Clients -on: - schedule: - - cron: "0 1 * * *" - workflow_dispatch: - -jobs: - test-aws-sdk-clients: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - repository: 'noobaa/noobaa-core' - path: 'noobaa-core' - - - name: Run AWS SDK Clients - run: | - set -x - cd ./noobaa-core - make test-aws-sdk-clients - - - name: Message Slack Webhook - if: ${{ !success() }} - uses: slackapi/slack-github-action@v2.0.0 - with: - webhook: ${{ secrets.SLACKWEBHOOKURL }} - webhook-type: incoming-webhook - payload: | - text: "AWS SDK Clients Run result: ${{ job.status }}" - - diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml deleted file mode 100644 index d78b9e64a2..0000000000 --- a/.github/workflows/unit.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: Unit Tests -on: [push, pull_request] - -jobs: - run-unit-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: Run Test - run: | - make test - make root-perm-test diff --git a/.github/workflows/upload-rpm-to-aws.yaml b/.github/workflows/upload-rpm-to-aws.yaml deleted file mode 100644 index fcf657d72f..0000000000 --- a/.github/workflows/upload-rpm-to-aws.yaml +++ /dev/null @@ -1,29 +0,0 @@ - name: Upload RPM to AWS - on: - workflow_call: - inputs: - rpm_full_path: - type: string - description: 'RPM path to be uploaded to AWS bucket' - - - jobs: - upload-rpm-to-aws: - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: ${{ inputs.rpm_full_path }} - - - name: Setup AWS CLI - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.NEWAWSPROJKEY }} - aws-secret-access-key: ${{ secrets.NEWAWSPROJSECRET }} - aws-region: us-east-1 - - - name: Copy RPM to S3 bucket - run: | - aws s3 cp ${{ inputs.rpm_full_path }} s3://noobaa-core-rpms/ diff --git a/.github/workflows/warp-nc-tests.yaml b/.github/workflows/warp-nc-tests.yaml deleted file mode 100644 index fad18558da..0000000000 --- a/.github/workflows/warp-nc-tests.yaml +++ /dev/null @@ -1,31 +0,0 @@ - -name: Warp NC Tests -on: [push, pull_request, workflow_dispatch] - -jobs: - warp-nc-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout noobaa-core - uses: actions/checkout@v4 - with: - repository: 'noobaa/noobaa-core' - path: 'noobaa-core' - - - name: Create Warp logs directory - run: | - set -x - cd ./noobaa-core - mkdir -p logs/warp-test-logs - chmod 777 logs/warp-test-logs - - - name: Run NC Warp tests - run: | - set -x - cd ./noobaa-core - make test-nc-warp - diff --git a/.github/workflows/warp-tests.yaml b/.github/workflows/warp-tests.yaml deleted file mode 100644 index 3001e1e85b..0000000000 --- a/.github/workflows/warp-tests.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Warp Tests -on: [push, pull_request, workflow_dispatch] - -jobs: - warp-tests: - runs-on: ubuntu-latest - timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - - name: Checkout noobaa-core - uses: actions/checkout@v4 - with: - repository: 'noobaa/noobaa-core' - path: 'noobaa-core' - - - name: Create Warp logs directory - run: | - set -x - cd ./noobaa-core - mkdir -p logs/warp-test-logs - chmod 777 logs/warp-test-logs - - - name: Run Warp tests - run: | - set -x - cd ./noobaa-core - make test-warp - diff --git a/.github/workflows/weekly-build.yaml b/.github/workflows/weekly-build.yaml deleted file mode 100644 index 45b7ce99fb..0000000000 --- a/.github/workflows/weekly-build.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Weekly Build -on: - schedule: - - cron: "0 23 * * *" - -jobs: - publish-image: - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - name: Invoke Build on Operator Repo - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: Manual Build Dispatch - repo: noobaa/noobaa-core - token: ${{ secrets.GHACCESSTOKEN }} - inputs: '{ "branch": "master", "tag": "" }' From 423ffd418868b54ec125eec24a204ee153e0ffe9 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 4 Jun 2025 22:07:19 +0200 Subject: [PATCH 02/13] add autorebase workflow Signed-off-by: Ben --- .github/workflows/autorebase.yml | 107 +++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/autorebase.yml diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml new file mode 100644 index 0000000000..249bdbfd6f --- /dev/null +++ b/.github/workflows/autorebase.yml @@ -0,0 +1,107 @@ +name: Auto Rebase PRs + +on: + push: + branches: + - '**' # This will trigger on pushes to all branches + +jobs: + auto-rebase: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Find and rebase PRs + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const targetBranch = context.ref.replace('refs/heads/', ''); + console.log(`Checking PRs targeting branch: ${targetBranch}`); + + const { data: prs } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + base: targetBranch + }); + + for (const pr of prs) { + // Cancel running workflows for this PR + const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + branch: pr.head.ref, + status: 'in_progress' + }); + + for (const run of runs.workflow_runs) { + console.log(`Cancelling run ${run.id} for PR #${pr.number}`); + await github.rest.actions.cancelWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: run.id + }); + } + try { + // Skip if PR is already up to date + const { data: comparison } = await github.rest.repos.compareCommits({ + owner: context.repo.owner, + repo: context.repo.repo, + base: pr.base.sha, + head: pr.head.sha + }); + + if (comparison.behind_by === 0) { + console.log(`PR #${pr.number} is already up to date`); + continue; + } + + // Create a comment to indicate rebase attempt + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + body: `🤖 Attempting to rebase this PR onto ${targetBranch}...` + }); + + // Perform the rebase using Git commands + const { execSync } = require('child_process'); + + // Fetch the PR branch + execSync(`git fetch origin pull/${pr.number}/head:pr-${pr.number}`); + + // Checkout the PR branch + execSync(`git checkout pr-${pr.number}`); + + // Perform the rebase + execSync(`git rebase --signoff origin/${targetBranch}`); + + // Force push the rebased branch + execSync(`git push origin pr-${pr.number}:${pr.head.ref} --force-with-lease`); + + console.log(`Successfully rebased PR #${pr.number} onto ${targetBranch}`); + } catch (error) { + console.error(`Failed to rebase PR #${pr.number}:`, error.message); + + // Create a comment about the failure + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + body: `❌ Failed to automatically rebase this PR onto ${targetBranch}. Please rebase manually.` + }); + } + } \ No newline at end of file From a48baff397c04a7bcb766e1f5f8e8b176dea732a Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 4 Jun 2025 22:10:59 +0200 Subject: [PATCH 03/13] push master Signed-off-by: Ben --- docs/bucket-notifications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/bucket-notifications.md b/docs/bucket-notifications.md index 2c2c742cfe..ef58913376 100644 --- a/docs/bucket-notifications.md +++ b/docs/bucket-notifications.md @@ -4,7 +4,7 @@ Bucket's notifications can be configured with the s3api operation [put-bucket-notification-configuration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/put-bucket-notification-configuration.html). Specify notifications under the "TopicConfigurations" field, which is an array of jsons, one for each notification. -A notification json has these fields: +A notification json has these fields:fffffffff - Id: Mandatory. A unique string identifying the notification configuration. - Events: Optional. An array of [events](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-event-types-and-destinations.html) for which the notification is relevant. If not specified, the notification is relevant for all events. From 3aab717e8a940535c68a63ed72b66519f2faa00f Mon Sep 17 00:00:00 2001 From: Ben Eli Date: Wed, 4 Jun 2025 22:14:10 +0200 Subject: [PATCH 04/13] Update autorebase.yml --- .github/workflows/autorebase.yml | 87 +++++++++++--------------------- 1 file changed, 29 insertions(+), 58 deletions(-) diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml index 249bdbfd6f..7c3f204f3d 100644 --- a/.github/workflows/autorebase.yml +++ b/.github/workflows/autorebase.yml @@ -1,16 +1,17 @@ -name: Auto Rebase PRs +name: Sync PRs on Push on: push: branches: - - '**' # This will trigger on pushes to all branches + - '**' jobs: - auto-rebase: + cancel-and-rebase: runs-on: ubuntu-latest permissions: pull-requests: write contents: write + actions: write steps: - name: Checkout repository uses: actions/checkout@v4 @@ -23,85 +24,55 @@ jobs: git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - name: Find and rebase PRs + - name: Cancel workflows for PRs targeting this branch uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const targetBranch = context.ref.replace('refs/heads/', ''); - console.log(`Checking PRs targeting branch: ${targetBranch}`); - const { data: prs } = await github.rest.pulls.list({ owner: context.repo.owner, repo: context.repo.repo, state: 'open', base: targetBranch }); - for (const pr of prs) { - // Cancel running workflows for this PR const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({ owner: context.repo.owner, repo: context.repo.repo, + event: 'pull_request', branch: pr.head.ref, status: 'in_progress' }); - for (const run of runs.workflow_runs) { - console.log(`Cancelling run ${run.id} for PR #${pr.number}`); await github.rest.actions.cancelWorkflowRun({ owner: context.repo.owner, repo: context.repo.repo, run_id: run.id }); } - try { - // Skip if PR is already up to date - const { data: comparison } = await github.rest.repos.compareCommits({ - owner: context.repo.owner, - repo: context.repo.repo, - base: pr.base.sha, - head: pr.head.sha - }); - - if (comparison.behind_by === 0) { - console.log(`PR #${pr.number} is already up to date`); - continue; - } + } - // Create a comment to indicate rebase attempt - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr.number, - body: `🤖 Attempting to rebase this PR onto ${targetBranch}...` - }); - - // Perform the rebase using Git commands - const { execSync } = require('child_process'); - - // Fetch the PR branch - execSync(`git fetch origin pull/${pr.number}/head:pr-${pr.number}`); - - // Checkout the PR branch - execSync(`git checkout pr-${pr.number}`); - - // Perform the rebase - execSync(`git rebase --signoff origin/${targetBranch}`); - - // Force push the rebased branch - execSync(`git push origin pr-${pr.number}:${pr.head.ref} --force-with-lease`); - - console.log(`Successfully rebased PR #${pr.number} onto ${targetBranch}`); - } catch (error) { - console.error(`Failed to rebase PR #${pr.number}:`, error.message); - - // Create a comment about the failure - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr.number, - body: `❌ Failed to automatically rebase this PR onto ${targetBranch}. Please rebase manually.` - }); + - name: Rebase PRs onto updated branch + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const targetBranch = context.ref.replace('refs/heads/', ''); + const { execSync } = require('child_process'); + const { data: prs } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + base: targetBranch + }); + for (const pr of prs) { + try { + execSync(`git fetch origin pull/${pr.number}/head:pr-${pr.number}`, { stdio: 'inherit' }); + execSync(`git checkout pr-${pr.number}`, { stdio: 'inherit' }); + execSync(`git rebase --signoff origin/${targetBranch}`, { stdio: 'inherit' }); + execSync(`git push origin pr-${pr.number}:${pr.head.ref} --force-with-lease`, { stdio: 'inherit' }); + } catch (err) { + console.log(`Failed to rebase PR #${pr.number}: ${err.message}`); } - } \ No newline at end of file + } From af77f5ae8e54724dddf39e9ff8108ec0965f71ce Mon Sep 17 00:00:00 2001 From: Ben Eli Date: Wed, 4 Jun 2025 22:40:19 +0200 Subject: [PATCH 05/13] Update autorebase.yml --- .github/workflows/autorebase.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml index 7c3f204f3d..58e548747c 100644 --- a/.github/workflows/autorebase.yml +++ b/.github/workflows/autorebase.yml @@ -66,8 +66,24 @@ jobs: state: 'open', base: targetBranch }); + for (const pr of prs) { + // Check if PR head includes latest base commit + const comparison = await github.rest.repos.compareCommits({ + owner: context.repo.owner, + repo: context.repo.repo, + base: `heads/${targetBranch}`, + head: pr.head.sha + }); + + const isBehind = comparison.status === 'behind'; + if (!isBehind) { + console.log(`PR #${pr.number} is already based on the latest ${targetBranch}`); + continue; + } + try { + execSync(`git fetch origin ${targetBranch}`, { stdio: 'inherit' }); execSync(`git fetch origin pull/${pr.number}/head:pr-${pr.number}`, { stdio: 'inherit' }); execSync(`git checkout pr-${pr.number}`, { stdio: 'inherit' }); execSync(`git rebase --signoff origin/${targetBranch}`, { stdio: 'inherit' }); @@ -76,3 +92,4 @@ jobs: console.log(`Failed to rebase PR #${pr.number}: ${err.message}`); } } + From 666f386b3bffd41fda45b11110f974f97f766f4b Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 4 Jun 2025 22:42:02 +0200 Subject: [PATCH 06/13] unrelated change Signed-off-by: Ben --- docs/s3-compatibility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/s3-compatibility.md b/docs/s3-compatibility.md index d460e98745..bafba003da 100644 --- a/docs/s3-compatibility.md +++ b/docs/s3-compatibility.md @@ -4,7 +4,7 @@ S3 (also known as Simple Storage Service) is an object storage service provided by Amazon. However, S3 is often colloquially used to refer to the S3 API - the RESTful interface for interaction with AWS S3. Over time, the S3 API has reached a point where many consider it the de facto standard API for object storage, and is supported by many cloud providers and storage vendors - even ones like Microsoft Azure and Google Cloud Platform, which also offer their own APIs alongside S3 compatibility. ## API Compatibility -Due to the wide adoption of the S3 API, NooBaa has been designed to be S3 compatible and adherent. NooBaa buckets and objects can be managed with most S3 clients without a need for proprietary tools or workarounds. All a user needs in order to interact with NooBaa through an S3 client is the S3 endpoint of the NooBaa system, and a set of fitting credentials. +Due to the wide adoptioffffffffn of the S3 API, NooBaa has been designed to be S3 compatible and adherent. NooBaa buckets and objects can be managed with most S3 clients without a need for proprietary tools or workarounds. All a user needs in order to interact with NooBaa through an S3 client is the S3 endpoint of the NooBaa system, and a set of fitting credentials. The endpoint can be found by checking the `routes` and `services` on a cluster, and the default admin credentials can be found in the same namespace that NooBaa was installed in, inside the `noobaa-admin` secret. For further reference of supported API calls in NooBaa, you can check out [AWS API Compatibility](design/AWS_API_Compatibility.md) From 03f76d3cb311805f780efc59aaf9c858b056bab1 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 4 Jun 2025 22:42:53 +0200 Subject: [PATCH 07/13] same file changes Signed-off-by: Ben --- docs/bucket-notifications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/bucket-notifications.md b/docs/bucket-notifications.md index ef58913376..810054ab0f 100644 --- a/docs/bucket-notifications.md +++ b/docs/bucket-notifications.md @@ -110,7 +110,7 @@ Once NooBaa finds an event with a relevant notification configuration, the notif is written to a persistent file. Location of persistent files is determined by- - For containerized, the pvc specified in NooBaa Bucket Notification spec (see Operator docs for more info). -- For NC, the env variable NOTIFICATION_LOG_DIR (see NC docs for more info). +- For NC, the env variable NOTIFIaaaaCATION_LOG_DIR (see NC docs for more info). Files are processed by- - For containerized, files are contantly being processed in the background of the core pod. From b295af34a7cb13ab8ae447e1a35deb1afc4d28a6 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 4 Jun 2025 22:46:35 +0200 Subject: [PATCH 08/13] test Signed-off-by: Ben --- docs/s3-compatibility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/s3-compatibility.md b/docs/s3-compatibility.md index bafba003da..5c26cd6422 100644 --- a/docs/s3-compatibility.md +++ b/docs/s3-compatibility.md @@ -4,7 +4,7 @@ S3 (also known as Simple Storage Service) is an object storage service provided by Amazon. However, S3 is often colloquially used to refer to the S3 API - the RESTful interface for interaction with AWS S3. Over time, the S3 API has reached a point where many consider it the de facto standard API for object storage, and is supported by many cloud providers and storage vendors - even ones like Microsoft Azure and Google Cloud Platform, which also offer their own APIs alongside S3 compatibility. ## API Compatibility -Due to the wide adoptioffffffffn of the S3 API, NooBaa has been designed to be S3 compatible and adherent. NooBaa buckets and objects can be managed with most S3 clients without a need for proprietary tools or workarounds. All a user needs in order to interact with NooBaa through an S3 client is the S3 endpoint of the NooBaa system, and a set of fitting credentials. +Due to the wide adoptioffffffffn of the S3 API, NooBaa has been designed to be S3 compatible and adherent. NooBaa buckets and objects can be managed with most S3 clients without a need for proprietary tools or workarounds. All a user needs in order to interact with NooBaa through an S3 client is the S3 endpoint of the NooBaa system, and a set of fsssitting credentials. The endpoint can be found by checking the `routes` and `services` on a cluster, and the default admin credentials can be found in the same namespace that NooBaa was installed in, inside the `noobaa-admin` secret. For further reference of supported API calls in NooBaa, you can check out [AWS API Compatibility](design/AWS_API_Compatibility.md) From 6335d6a8827aa299dc61f2f899ba38e8638da50d Mon Sep 17 00:00:00 2001 From: Ben Eli Date: Wed, 4 Jun 2025 22:49:40 +0200 Subject: [PATCH 09/13] Update autorebase.yml --- .github/workflows/autorebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml index 58e548747c..e6c80add29 100644 --- a/.github/workflows/autorebase.yml +++ b/.github/workflows/autorebase.yml @@ -73,7 +73,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, base: `heads/${targetBranch}`, - head: pr.head.sha + base: context.payload.after }); const isBehind = comparison.status === 'behind'; From 43706ace657fd856c82ea5bcbb28a7cec4bc34d2 Mon Sep 17 00:00:00 2001 From: Ben Eli Date: Wed, 4 Jun 2025 22:51:49 +0200 Subject: [PATCH 10/13] Update autorebase.yml --- .github/workflows/autorebase.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml index e6c80add29..b8c14d8782 100644 --- a/.github/workflows/autorebase.yml +++ b/.github/workflows/autorebase.yml @@ -72,8 +72,8 @@ jobs: const comparison = await github.rest.repos.compareCommits({ owner: context.repo.owner, repo: context.repo.repo, - base: `heads/${targetBranch}`, - base: context.payload.after + base: context.payload.after, + head: pr.head.sha }); const isBehind = comparison.status === 'behind'; From 039b8a9a98134d946e7a895046cde2ea1510a4e2 Mon Sep 17 00:00:00 2001 From: Ben Eli Date: Wed, 4 Jun 2025 22:54:37 +0200 Subject: [PATCH 11/13] Update autorebase.yml --- .github/workflows/autorebase.yml | 63 ++++++++++---------------------- 1 file changed, 20 insertions(+), 43 deletions(-) diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml index b8c14d8782..45e8f4d354 100644 --- a/.github/workflows/autorebase.yml +++ b/.github/workflows/autorebase.yml @@ -6,14 +6,14 @@ on: - '**' jobs: - cancel-and-rebase: + rebase-outdated-prs: runs-on: ubuntu-latest permissions: - pull-requests: write contents: write - actions: write + pull-requests: write + steps: - - name: Checkout repository + - name: Checkout full repo uses: actions/checkout@v4 with: fetch-depth: 0 @@ -21,75 +21,52 @@ jobs: - name: Configure Git run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Cancel workflows for PRs targeting this branch + - name: Rebase outdated PRs uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const targetBranch = context.ref.replace('refs/heads/', ''); - const { data: prs } = await github.rest.pulls.list({ + const { execSync } = require('child_process'); + + const { data: baseBranch } = await github.rest.repos.getBranch({ owner: context.repo.owner, repo: context.repo.repo, - state: 'open', - base: targetBranch + branch: targetBranch }); - for (const pr of prs) { - const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - event: 'pull_request', - branch: pr.head.ref, - status: 'in_progress' - }); - for (const run of runs.workflow_runs) { - await github.rest.actions.cancelWorkflowRun({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: run.id - }); - } - } + const baseSha = baseBranch.commit.sha; - - name: Rebase PRs onto updated branch - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const targetBranch = context.ref.replace('refs/heads/', ''); - const { execSync } = require('child_process'); const { data: prs } = await github.rest.pulls.list({ owner: context.repo.owner, repo: context.repo.repo, state: 'open', base: targetBranch }); - + for (const pr of prs) { - // Check if PR head includes latest base commit const comparison = await github.rest.repos.compareCommits({ owner: context.repo.owner, repo: context.repo.repo, - base: context.payload.after, + base: baseSha, head: pr.head.sha }); - - const isBehind = comparison.status === 'behind'; - if (!isBehind) { - console.log(`PR #${pr.number} is already based on the latest ${targetBranch}`); + + if (comparison.status !== 'behind') { + console.log(`PR #${pr.number} is already based on latest ${targetBranch}`); continue; } - + try { + console.log(`Rebasing PR #${pr.number}`); execSync(`git fetch origin ${targetBranch}`, { stdio: 'inherit' }); execSync(`git fetch origin pull/${pr.number}/head:pr-${pr.number}`, { stdio: 'inherit' }); execSync(`git checkout pr-${pr.number}`, { stdio: 'inherit' }); execSync(`git rebase --signoff origin/${targetBranch}`, { stdio: 'inherit' }); - execSync(`git push origin pr-${pr.number}:${pr.head.ref} --force-with-lease`, { stdio: 'inherit' }); + execSync(`git push origin HEAD:${pr.head.ref} --force-with-lease`, { stdio: 'inherit' }); } catch (err) { console.log(`Failed to rebase PR #${pr.number}: ${err.message}`); } } - From 6c928ef5223053473ff5ea85f7d846f0b7099ed7 Mon Sep 17 00:00:00 2001 From: Ben Eli Date: Wed, 4 Jun 2025 23:02:02 +0200 Subject: [PATCH 12/13] Create statuscheck.yml --- .github/workflows/statuscheck.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/statuscheck.yml diff --git a/.github/workflows/statuscheck.yml b/.github/workflows/statuscheck.yml new file mode 100644 index 0000000000..f654b652ff --- /dev/null +++ b/.github/workflows/statuscheck.yml @@ -0,0 +1,12 @@ +name: PR Status Check + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + check-pr: + name: Required PR Check + runs-on: ubuntu-latest + steps: + - run: echo "This is a required check" From c171f3bf5b3db9dbec24d02597e4b34304c95bdf Mon Sep 17 00:00:00 2001 From: Ben Eli Date: Wed, 4 Jun 2025 23:16:19 +0200 Subject: [PATCH 13/13] Update autorebase.yml --- .github/workflows/autorebase.yml | 37 ++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml index 45e8f4d354..5c2138b747 100644 --- a/.github/workflows/autorebase.yml +++ b/.github/workflows/autorebase.yml @@ -6,14 +6,15 @@ on: - '**' jobs: - rebase-outdated-prs: + cancel-and-rebase: runs-on: ubuntu-latest permissions: contents: write pull-requests: write + actions: write steps: - - name: Checkout full repo + - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 @@ -24,6 +25,38 @@ jobs: git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" + - name: Cancel running workflows for PRs targeting this branch + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const targetBranch = context.ref.replace('refs/heads/', ''); + const { data: prs } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + base: targetBranch + }); + + for (const pr of prs) { + const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + event: 'pull_request', + branch: pr.head.ref, + status: 'in_progress' + }); + + for (const run of runs.workflow_runs) { + console.log(`Cancelling run ${run.id} for PR #${pr.number}`); + await github.rest.actions.cancelWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: run.id + }); + } + } + - name: Rebase outdated PRs uses: actions/github-script@v7 with: