]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pr-api: Remove ghprb no-more-ghprb 2362/head
authorDavid Galloway <david.galloway@ibm.com>
Thu, 26 Jun 2025 21:26:13 +0000 (17:26 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Thu, 26 Jun 2025 21:38:12 +0000 (17:38 -0400)
Merge with https://github.com/ceph/ceph/pull/63168

Signed-off-by: David Galloway <david.galloway@ibm.com>
ceph-pr-api/build/build
ceph-pr-api/config/definitions/ceph-pr-api.yml

index b42d410f9c1bb81ab5dd7bdd6943d849f9e460f2..12b599591a66bcfb438e4e83c4ee8dd2b5a0535a 100644 (file)
@@ -1,13 +1,8 @@
 #!/bin/bash -e
 
-docs_pr_only
-container_pr_only
-if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true ]]; then
-    echo "Only the doc/ or container/ dir changed.  No need to run make check or API tests."
-    mkdir -p $WORKSPACE/build/out
-    echo "File created to avoid Jenkins' Artifact Archiving plugin from hanging" > $WORKSPACE/build/out/mgr.foo.log
-    exit 0
-fi
+echo "This job was triggered by $TRIGGER_METHOD via $TRIGGERED_BY"
+
+report_github_check_status pending "ceph API tests" "ceph API tests running" $GH_PULL_REQUEST_SHA $BUILD_URL
 
 n_build_jobs=$(get_nr_build_jobs)
 n_test_jobs=$(($(nproc) / 4))
@@ -16,5 +11,8 @@ export BUILD_MAKEOPTS="-j${n_build_jobs}"
 export FOR_MAKE_CHECK=1
 timeout 2h ./src/script/run-make.sh \
         --cmake-args '-DWITH_TESTS=OFF -DENABLE_GIT_VERSION=OFF'
+
+report_github_check_status success "ceph API tests" "ceph API tests passed" $GH_PULL_REQUEST_SHA $BUILD_URL
+
 sleep 5
 ps -ef | grep ceph || true
index b2afd6a96d6183db0e827f40843436eba52160d4..97946ed0218d53b816713540812f77dbdc431018 100644 (file)
 
     parameters:
       - string:
-          name: sha1
-          description: "commit id or a refname, like 'origin/pr/72/head'"
-
-    triggers:
-      - github-pull-request:
-          cancel-builds-on-update: true
-          allow-whitelist-orgs-as-admins: true
-          org-list:
-            - ceph
-          white-list-target-branches:
-            - main
-            - tentacle
-            - squid
-            - reef
-            - "feature-.*"
-          trigger-phrase: 'jenkins test api'
-          skip-build-phrase: '^jenkins do not test.*'
-          only-trigger-phrase: false
-          github-hooks: true
-          permit-all: true
-          auto-close-on-fail: false
-          status-context: "ceph API tests"
-          started-status: "running API tests"
-          success-status: "ceph API tests succeeded"
-          failure-status: "ceph API tests failed"
+          name: GH_PULL_REQUEST_ID
+          description: "The GitHub PR number, like '72' in 'ceph/pull/72'"
+      - string:
+          name: GH_PULL_REQUEST_SHA
+          description: "The GitHub PR SHA1, like 'c816207c3130c67e5bcc56766a530e881e2c0181'"
+      - string:
+          name: TRIGGERED_BY
+          description: "The GitHub Action Workflow that called this job"
+      - string:
+          name: TRIGGER_METHOD
+          description: "The method by which this job was triggered (e.g., comment or push)"
 
     scm:
       - git:
           url: https://github.com/ceph/ceph.git
           branches:
-            - origin/pr/${{ghprbPullId}}/merge
-          refspec: +refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*
+            - origin/pr/${{GH_PULL_REQUEST_ID}}/merge
+          refspec: +refs/pull/${{GH_PULL_REQUEST_ID}}/*:refs/remotes/origin/pr/${{GH_PULL_REQUEST_ID}}/*
           browser: auto
           timeout: 20
           skip-tag: true
     publishers:
       - postbuildscript:
           builders:
+            - role: SLAVE
+              build-on:
+                - FAILURE
+                - ABORTED
+              build-steps:
+                - shell: |
+                    . ../../../scripts/report_github_check_status.sh
+                    report_github_check_status failure "ceph API tests" "ceph API tests failed" ${{GH_PULL_REQUEST_SHA}} ${{BUILD_URL}}
             - role: SLAVE
               build-on:
                   - ABORTED
@@ -95,3 +89,6 @@
               credential-id: github-readonly-token
               username: GITHUB_USER
               password: GITHUB_PASS
+          - text:
+              credential-id: github-ceph-jenkins-pr-checks
+              variable: GITHUB_TOKEN