Copilot commented on code in PR #8378:
URL: https://github.com/apache/texera/pull/8378#discussion_r3922378579


##########
.github/workflows/direct-backport-push.yml:
##########
@@ -831,22 +850,26 @@ jobs:
           CONFLICT_FILES: ${{ steps.branch.outputs.conflict_files }}
           SUBJECT: ${{ steps.branch.outputs.subject }}
           FEATURE_ABSENT: ${{ steps.branch.outputs.feature_absent }}
+          CLEAN: ${{ matrix.clean }}
         with:
-          # Open the draft as github-actions[bot], not the PAT owner, by using
-          # the default GITHUB_TOKEN. Trade-off: a GITHUB_TOKEN-opened PR does
-          # not trigger pull_request CI — acceptable because this is a draft 
for
-          # manual conflict/build resolution, so CI fires once the human pushes
-          # their fix to the branch.
+          # Opened as github-actions[bot], for both outcomes. GitHub suppresses
+          # workflow runs for anything GITHUB_TOKEN does, so a clean backport's
+          # required checks are started by the step below rather than by this
+          # creation — see the comment there.
           github-token: ${{ secrets.GITHUB_TOKEN }}
           script: |
             const {
               MERGE_SHA, TARGET_BRANCH, PR_NUMBER, MANAGER,
               BRANCH, VERSION, HAD_CONFLICT, CONFLICT_FILES, SUBJECT,
-              FEATURE_ABSENT,
+              FEATURE_ABSENT, CLEAN,
             } = process.env;
             const { owner, repo } = context.repo;
             const prNumber = Number(PR_NUMBER);
             const hadConflict = HAD_CONFLICT === "true";
+            // Clean means the cherry-pick applied and the backported tree 
built
+            // green before the merge: nothing here needs a human's hands, only
+            // the release manager's confirmation.
+            const clean = CLEAN === "true";

Review Comment:
   `CLEAN` reflects the earlier preflight result, but 
`create-backport-branch.sh` performs a fresh cherry-pick and can now report 
`hadConflict` if the release branch advanced meanwhile. As written, that raced 
backport is still opened ready for review, described as conflict-free, and 
auto-merge is armed even though its commit contains conflict markers. Gate the 
clean path on the actual cherry-pick result as well.



##########
.github/workflows/direct-backport-push.yml:
##########
@@ -314,11 +314,24 @@ jobs:
                 `PR #${pullRequest.number}: push=[${push.join(", ")}] 
pr=[${pr.join(", ")}]`
               );
 
+              // Both outcomes now open a pull request. Pushing a cherry-pick
+              // straight onto a release branch is rejected by the Merge Queue
+              // ruleset that covers them (#8377), and ASF policy requires 
prior
+              // Infrastructure authorization for an automated service to push
+              // to a branch subject to official release — so the fix travels
+              // the way every other change to a release branch travels.
+              //
+              // The two are not the same PR, though: a clean cherry-pick needs
+              // nobody to touch it, so it opens ready for review with
+              // auto-merge armed and the manager's approval is the only step
+              // left. A conflicted one still opens as a draft for its author.
               for (const target of push) {
-                pushEntries.push({
+                prEntries.push({
                   pr_number: pullRequest.number,
                   merge_sha: commit.sha,
                   target,
+                  manager: releaseManagers.get(target) || "",
+                  clean: "true",

Review Comment:
   Routing all formerly direct-push entries into this matrix drops the ordering 
guarantee documented and enforced by `push-backports` (`max-parallel: 1`, lines 
366–369). A single merge-queue push can contain multiple fixes for the same 
target; these PR jobs now create independent branches concurrently and arm 
auto-merge independently, so dependent cherry-picks can be prepared or merged 
out of commit order. Preserve per-target commit ordering, for example by 
stacking the generated branches/PRs or only arming each backport after its 
predecessor lands.



##########
.github/workflows/direct-backport-push.yml:
##########
@@ -990,9 +1024,15 @@ jobs:
 
               pr = (await github.rest.pulls.create({
                 owner, repo, base: TARGET_BRANCH, head: BRANCH,
-                title, body, draft: true,
+                title, body, draft: !clean,

Review Comment:
   The new non-draft path still falls through the existing block at lines 
1082–1105, which always tells the original PR that a *draft* needs manual work 
because the build failed and records a failure commit status. Consequently 
every successful clean backport leaves a contradictory comment and permanent 
red `backport/<target>` status. Branch that annotation/status logic on `clean` 
and report the ready PR without claiming failure.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to