]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-tag: Create a PR instead of pushing directly to {{ branch }}
authorDavid Galloway <dgallowa@redhat.com>
Thu, 23 Jun 2022 13:43:28 +0000 (09:43 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Fri, 24 Jun 2022 17:22:00 +0000 (13:22 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
ansible/release.yml
ansible/roles/ceph-release/tasks/push.yml
ceph-tag/build/build

index 09c54816957fde55a7e2fa2610a351fbba036a5f..c50b729c61ba5c80dc2f7b121633212b141135df 100644 (file)
     force_dch: false # if coming from a rc and wanting to release a stable you need to force dch
     debemail: ceph-maintainers@ceph.com
     debfullname: "Ceph Release Team"
+    pr_checklist: |
+      ## Checklist
+      - Tracker (select at least one)
+        - [ ] References tracker ticket
+        - [ ] Very recent bug; references commit where it was introduced
+        - [ ] New feature (ticket optional)
+        - [x] Doc update (no ticket needed)
+        - [ ] Code cleanup (no ticket needed)
+      - Component impact
+        - [ ] Affects [Dashboard](https://tracker.ceph.com/projects/dashboard/issues/new), opened tracker ticket
+        - [ ] Affects [Orchestrator](https://tracker.ceph.com/projects/orchestrator/issues/new), opened tracker ticket
+        - [x] No impact that needs to be tracked
+      - Documentation (select at least one)
+        - [ ] Updates relevant documentation
+        - [x] No doc update is appropriate
+      - Tests (select at least one)
+        - [ ] Includes [unit test(s)](https://docs.ceph.com/en/latest/dev/developer_guide/tests-unit-tests/)
+        - [ ] Includes [integration test(s)](https://docs.ceph.com/en/latest/dev/developer_guide/testing_integration_tests/)
+        - [ ] Includes bug reproducer
+        - [x] No tests
   roles:
     - { role: ceph-release, when: "project == 'ceph'" }
     - { role: ceph-deploy-release, when: "project == 'ceph-deploy'" }
index 136fe09fc63e10ec1525b992da53034f62150fee..feef5d7529edb53685a1b35481b40f11fff6f139 100644 (file)
   args:
     chdir: ceph
 
-- name: "git checkout {{ branch }}"
-  command: git checkout upstream/{{ branch }}
-  args:
-    chdir: ceph
-
-# In case any commits got pushed to {{ branch }} while we were building
-- name: "merge {{ branch }}-release changes back into {{ branch }}"
-  command: git merge -m "Merging {{ branch }}-release {{ version }} commit into {{ branch }}" {{ branch }}-release
-  args:
-    chdir: ceph
-  
-- name: "push version commit to {{ branch }}"
-  command: git push upstream {{ branch }}
-  args:
-    chdir: ceph
+- name: "create pull request to merge {{ branch }}-release back into {{ branch }}"
+  uri:
+    url: https://api.github.com/repos/ceph/ceph/pulls
+    method: POST
+    status_code: 201
+    headers:
+      Accept: "application/vnd.github.v3+json"
+      Authorization: "token {{ token }}"
+    body:
+      title: "v{{ version }}"
+      body: "{{ pr_checklist }}"
+      head: "{{ branch }}-release"
+      base: "{{ branch }}"
+    body_format: json
+  tags: pr
+  no_log: true
 
 - name: push the newly created tag
   command: git push upstream v{{ version }}
index 04852f03cce557ff9f06a3c45ce519fbe7e19e34..1fbde3d15bdae1412abf270a7605ac2a8e10acd3 100644 (file)
@@ -17,5 +17,5 @@ else
     # run ansible to do all the tagging and release specifying
     # a local connection and 'localhost' as the host where to execute
     cd "$WORKSPACE/ceph-build/ansible/"
-    $VENV/ansible-playbook -i "localhost," -c local release.yml --extra-vars="stage=push version=$VERSION branch=$BRANCH force_version=$FORCE_VERSION release=$RELEASE_TYPE tag=$TAG project=ceph"
+    $VENV/ansible-playbook -i "localhost," -c local release.yml --extra-vars="stage=push version=$VERSION branch=$BRANCH force_version=$FORCE_VERSION release=$RELEASE_TYPE tag=$TAG project=ceph token=$GITHUB_TOKEN"
 fi