element-hq / element-hq/element-web

Branch matching in CI failed to work correctly

Open
#26,896 1 comment 0 reactions 0 assignees View on GitHub
T-Task
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

In https://github.com/matrix-org/matrix-react-sdk/pull/12154, which had a matching branch in the js-sdk (https://github.com/matrix-org/matrix-js-sdk/issues/3915#issuecomment-1865221366), 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](https://github.com/element-hq/element-web/assets/1389908/eb70a2a3-6344-4245-9561-a5db0a86d265)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.