[ 
https://issues.apache.org/jira/browse/KAFKA-19768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18034815#comment-18034815
 ] 

Ming-Yen Chung edited comment on KAFKA-19768 at 11/2/25 7:34 AM:
-----------------------------------------------------------------

I don’t think we can rely on determining which branch the PR is being merged 
into, because we don’t have access to target branch information. Therefore, I 
will change the approach to uploading all artifacts whose names start with 
{{{}build-scan-{}}}.

Here’s why we can’t get the target branch information:
When I create a PR from my own fork, I can see which branch the PR is 
targeting. But when the PR is to the upstream Kafka repository, the 
{{pull_request}} array is empty. (GitHub removed this for security reasons)

Example — PR from my fork:
{code:java}
"event": "pull_request",
"head_branch": "merge-to-4.0",
"pull_requests": [
  {
    "base": {
      "ref": "4.0"
    },
    "head": {
      "ref": "merge-to-4.0"
    }
  }
]
 {code}
Example — PR (created, synchronized) to upstream (we cannot get the target 
branch info here):
{code:java}
"event": "pull_request",
"head_branch": "merge-to-4.0",
"pull_requests": [] {code}
After the upstream merge triggers the build scan, we can correctly determine 
the branch:
{code:java}
"event": "push",
"head_branch": "4.0" {code}


was (Author: JIRAUSER287528):
I don’t think we can rely on determining which branch the PR is being merged 
into, because we don’t have access to target branch information. Therefore, I 
will change the approach to uploading all artifacts whose names start with 
{{{}build-scan-{}}}.

Here’s why we can’t get the target branch information:
When I create a PR from my own fork, I can see which branch the PR is 
targeting. But when the PR is to the upstream Kafka repository, the 
{{pull_request}} array is empty. (GitHub removed this for security reasons)

Example — PR from my fork:
{code:java}
"event": "pull_request",
"head_branch": "merge-to-4.0",
"pull_requests": [
  {
    "base": {
      "ref": "4.0"
    },
    "head": {
      "ref": "merge-to-4.0"
    }
  }
]
 {code}
Example — PR (created, synchronized) to upstream (we cannot get the target 
branch info here):
{code:java}
"event": "pull_request",
"head_branch": "merge-to-4.0",
"pull_requests": [] {code}
After the upstream merge triggers the build scan, we can correctly determine 
the branch:

 
{code:java}
"event": "push",
"head_branch": "4.0" {code}
 

 

> `ci-complete` needs to work with active branches after the JDK is updated
> -------------------------------------------------------------------------
>
>                 Key: KAFKA-19768
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19768
>             Project: Kafka
>          Issue Type: Improvement
>          Components: build
>            Reporter: Chia-Ping Tsai
>            Assignee: Ming-Yen Chung
>            Priority: Minor
>              Labels: build, github-actions
>
> The JDK version used by `ci-complete` is inconsistent with other active 
> branches, which is causing the build report task to fail



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to