Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch matching in CI failed to work correctly #26896

Open
richvdh opened this issue Jan 18, 2024 · 1 comment
Open

Branch matching in CI failed to work correctly #26896

richvdh opened this issue Jan 18, 2024 · 1 comment
Labels
T-Task Tasks for the team like planning

Comments

@richvdh
Copy link
Member

richvdh commented Jan 18, 2024

In matrix-org/matrix-react-sdk#12154, which had a matching branch in the js-sdk (matrix-org/matrix-js-sdk#3915 (comment)), the branch matching appears to be looking for a branch called null:

https://github.com/matrix-org/matrix-react-sdk/actions/runs/7569816250/job/20613922773?pr=12154#step:4:51

+ echo 'Getting info about a PR with number 12154'
+ apiEndpoint=https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/12154
Getting info about a PR with number 12154
++ curl https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/12154
++ jq -r .head.label
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   279  100   279    0     0   4761      0 --:--:-- --:--:-- --:--:--  4810
+ head=null
+ BRANCH_ARRAY=(${head//:/ })
+ TRY_ORG=matrix-org
+ TRY_BRANCH=null
+ [[ null == *\:* ]]
+ clone matrix-org matrix-js-sdk null
+ org=matrix-org
+ repo=matrix-js-sdk
+ branch=null
+ '[' -n null ']'
+ echo 'Trying to use matrix-org/matrix-js-sdk#null'
+ GIT_TERMINAL_PROMPT=0
+ git clone https://github.com/matrix-org/matrix-js-sdk.git matrix-js-sdk --branch null --depth 1
Trying to use matrix-org/matrix-js-sdk#null
Cloning into 'matrix-js-sdk'...
warning: Could not find remote branch null to clone.
fatal: Remote branch null not found in upstream origin

This is presumably a race with github's API, where it returns invalid data. It would be nice if the matching failed early rather than continuing, and confusing everyone with a broken deployment.

I think adding -e to the jq incantation would detect this case:

image

@t3chguy
Copy link
Member

t3chguy commented Jan 18, 2024

Yeah definitely looks like a race with Github

image
image

@MidhunSureshR MidhunSureshR added the T-Task Tasks for the team like planning label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

No branches or pull requests

3 participants