Skip to content

Commit 18b710c

Browse files
Rita SadekRita Sadek
authored andcommitted
Merge remote-tracking branch 'upstream/dev' into dev
2 parents 2ce7791 + 42d5ae1 commit 18b710c

7,237 files changed

Lines changed: 607383 additions & 232422 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Apply requested async label
3+
4+
'on':
5+
issue_comment:
6+
types:
7+
- created
8+
- edited
9+
10+
permissions: {}
11+
12+
jobs:
13+
apply_async_labels:
14+
name: Apply requested async label
15+
uses: alisw/ali-bot/.github/workflows/async-auto-label.yml@master
16+
permissions:
17+
pull-requests: write # to update labels
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Collect and print async labels
3+
4+
'on':
5+
pull_request_target:
6+
types:
7+
- opened
8+
- reopened
9+
branches:
10+
- dev
11+
12+
permissions: {}
13+
14+
jobs:
15+
list_async_labels:
16+
name: Collect and print async labels
17+
uses: alisw/ali-bot/.github/workflows/async-list-label.yml@master
18+
permissions:
19+
pull-requests: write # to update labels

.github/workflows/clean-test.yml

Lines changed: 63 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,70 @@
1+
---
12
name: Clean PR checks
2-
on:
3+
4+
'on':
35
workflow_dispatch:
46
inputs:
57
pr:
6-
description: PR to be cleaned
7-
required: true
8-
checks:
9-
description: Checks to be cleaned
10-
required: true
11-
default: 'build/O2/o2,build/AliceO2/O2/o2/macOS,build/O2/fullCI,build/O2/o2-cs8,build/O2/o2-dataflow,build/O2/o2-dataflow-cs8'
12-
owner:
13-
description: Organization
14-
required: true
15-
default: 'AliceO2Group'
16-
repo:
17-
description: Repository
8+
description: PR number in this repo to be cleaned
9+
type: string # can't use number here
1810
required: true
19-
default: 'AliceO2'
11+
message:
12+
description: Human-readable message displayed on the new pending status
13+
type: string
14+
required: false
15+
default: ''
16+
17+
# Warning: GitHub limits the total number of inputs to 10, so a maximum of
18+
# 8 checks is allowed here!
19+
# Warning: the check_* keys are magic and must consist of the string
20+
# "check_" followed by the applicable check name exactly. The
21+
# "description" field is only the human-readable label for the input.
22+
'check_build/O2/o2':
23+
description: build/O2/o2
24+
type: boolean
25+
default: true
26+
'check_build/AliceO2/O2/o2/macOS':
27+
description: build/AliceO2/O2/o2/macOS
28+
type: boolean
29+
default: true
30+
'check_build/AliceO2/O2/o2/macOS-arm':
31+
description: build/AliceO2/O2/o2/macOS-arm
32+
type: boolean
33+
default: true
34+
'check_build/O2/fullCI':
35+
description: build/O2/fullCI
36+
type: boolean
37+
default: true
38+
'check_build/O2/o2-cs8':
39+
description: build/O2/o2-cs8
40+
type: boolean
41+
default: true
42+
'check_build/O2/o2-dataflow-cs8':
43+
description: build/O2/o2-dataflow-cs8
44+
type: boolean
45+
default: true
46+
'check_build/O2/o2/aarch64':
47+
description: build/O2/o2/aarch64
48+
type: boolean
49+
default: true
50+
'check_build/O2/o2_slc9':
51+
description: build/O2/o2_slc9
52+
type: boolean
53+
default: true
54+
55+
56+
permissions: {}
2057

2158
jobs:
22-
cleanup_pr_checks:
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: Set up Python 3.7
26-
uses: actions/setup-python@v1
27-
with:
28-
python-version: 3.7
29-
- name: Install ali-bot
30-
run: |
31-
sudo apt-get update -y
32-
sudo apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev
33-
python -m pip install --upgrade pip
34-
pip install git+https://github.com/alisw/ali-bot@master
35-
- uses: octokit/graphql-action@v2.x
36-
id: get_last_commit_for_pr
37-
with:
38-
query: |
39-
{
40-
repository(owner: "${{ github.event.inputs.owner }}", name: "${{ github.event.inputs.repo }}") {
41-
url
42-
pullRequest(number:${{ github.event.inputs.pr }}) {
43-
commits(last: 1) {
44-
nodes {
45-
commit {
46-
oid
47-
}
48-
}
49-
}
50-
}
51-
}
52-
}
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
- name: Cleanup tests
56-
run: |-
57-
set -x
58-
cat <<\EOF > results.json
59-
${{ steps.get_last_commit_for_pr.outputs.data }}
60-
EOF
61-
COMMIT=$(jq -r '.repository.pullRequest.commits.nodes[].commit.oid' results.json)
62-
echo $COMMIT
63-
for check in `echo ${{ github.event.inputs.checks }} | tr , \\\\n`; do
64-
set-github-status -c ${{ github.event.inputs.owner }}/${{ github.event.inputs.repo }}@$COMMIT -s $check/pending
65-
done
66-
env:
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
clean:
60+
name: Clean PR checks
61+
uses: alisw/ali-bot/.github/workflows/clean-pr-checks.yml@master
62+
with:
63+
owner: ${{ github.event.repository.owner.login }}
64+
repo: ${{ github.event.repository.name }}
65+
pr: ${{ github.event.inputs.pr }}
66+
message: ${{ github.event.inputs.message }}
67+
checks: ${{ toJSON(github.event.inputs) }}
68+
permissions:
69+
pull-requests: read # to get last commit for pr (octokit/graphql-action)
70+
statuses: write # for set-github-status
Lines changed: 8 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,11 @@
1-
name: Check PR with clang-format
1+
---
2+
name: Formatting
23

3-
on: [pull_request_target]
4+
'on': [pull_request_target]
45

56
jobs:
6-
build:
7-
# We need at least 20.04 to install clang-format-11.
8-
runs-on: ubuntu-20.04
9-
10-
steps:
11-
- uses: actions/checkout@v2
12-
with:
13-
ref: ${{ github.event.pull_request.head.sha }}
14-
persist-credentials: false
15-
# We need the history of the dev branch all the way back to where the PR
16-
# diverged. We're fetching everything here, as we don't know how many
17-
# commits back that point is.
18-
fetch-depth: 0
19-
20-
- name: Install prerequisites
21-
env:
22-
DEBIAN_FRONTEND: noninteractive
23-
run: |
24-
sudo apt update -y
25-
sudo apt install -y clang-format-11
26-
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 100
27-
sudo update-alternatives --install /usr/bin/git-clang-format git-clang-format /usr/bin/git-clang-format-11 100
28-
29-
- name: Run clang format
30-
id: clang_format
31-
env:
32-
ALIBUILD_GITHUB_TOKEN: ${{secrets.ALIBUILD_GITHUB_TOKEN}}
33-
run: |
34-
set -x
35-
# We need to fetch the other commit.
36-
git fetch origin ${{ github.event.pull_request.base.ref }} \
37-
pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}
38-
39-
# We create a new branch which we will use for the eventual PR.
40-
git config --global user.email "alibuild@cern.ch"
41-
git config --global user.name "ALICE Action Bot"
42-
git checkout -b alibot-cleanup-${{ github.event.pull_request.number }} ${{ github.event.pull_request.head.sha }}
43-
44-
# github.event.pull_request.base.sha is the latest commit on the branch
45-
# the PR will be merged into, NOT the commit this PR derives from! For
46-
# that, we need to find the latest common ancestor between the PR and
47-
# the branch we are merging into.
48-
BASE_COMMIT=$(git merge-base HEAD ${{ github.event.pull_request.base.sha }})
49-
echo "Running clang-format against branch ${{ github.event.pull_request.base.ref }}, with hash ${{ github.event.pull_request.base.sha }}"
50-
COMMIT_FILES=$(git diff --diff-filter d --name-only $BASE_COMMIT | grep -ivE 'LinkDef|Utilities/PCG/')
51-
[ "X$COMMIT_FILES" = X ] && { echo "No files to check" ; exit 0; }
52-
RESULT_OUTPUT="$(git-clang-format --commit $BASE_COMMIT --diff --style file $COMMIT_FILES)"
53-
54-
for x in $COMMIT_FILES; do
55-
case $x in
56-
*.hxx|*.cc|*.hpp) echo "$x uses non-allowed extension." && exit 1 ;;
57-
*) ;;
58-
esac
59-
done
60-
61-
if [ "$RESULT_OUTPUT" == 'no modified files to format' ] ||
62-
[ "$RESULT_OUTPUT" == 'clang-format did not modify any files' ]
63-
then
64-
echo "clang-format passed."
65-
git push --set-upstream https://alibuild:$ALIBUILD_GITHUB_TOKEN@github.com/alibuild/AliceO2.git :alibot-cleanup-${{ github.event.pull_request.number }} -f || true
66-
echo ::set-output name=clean::true
67-
else
68-
git-clang-format --diff --commit $BASE_COMMIT --style file $COMMIT_FILES |
69-
patch -p1
70-
echo "clang-format failed."
71-
echo "To reproduce it locally please run"
72-
echo -e "\tgit checkout ${{ github.event.pull_request.head.ref }}"
73-
echo -e "\tgit-clang-format --commit $BASE_COMMIT --diff --style file"
74-
echo "Note: using clang-format version $(clang-format --version)"
75-
echo "Opening a PR to your branch with the fixes"
76-
git commit -m "Please consider the following formatting changes" -a
77-
git show | cat
78-
git fetch https://github.com/AliceO2Group/AliceO2.git pull/${{ github.event.pull_request.number }}/head
79-
git push --set-upstream https://alibuild:$ALIBUILD_GITHUB_TOKEN@github.com/alibuild/AliceO2.git HEAD:refs/heads/alibot-cleanup-${{ github.event.pull_request.number }} -f
80-
echo ::set-output name=clean::false
81-
fi
82-
83-
- name: pull-request
84-
uses: alisw/pull-request@master
85-
with:
86-
source_branch: 'alibuild:alibot-cleanup-${{ github.event.pull_request.number }}'
87-
destination_branch: '${{ github.event.pull_request.head.label }}'
88-
github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }}
89-
pr_title: "Please consider the following formatting changes to #${{ github.event.pull_request.number }}"
90-
pr_body: |
91-
This PR cannot be merged as is. You should either run clang-format yourself and update the pull request, or merge this PR in yours.
92-
You can find AliceO2 coding conventions at http://github.com/AliceO2Group/CodingGuidelines.
93-
continue-on-error: true # We do not create PRs if the branch is not there.
94-
95-
- name: Exit with error if the PR is not clean
96-
run: |
97-
case ${{ steps.clang_format.outputs.clean }} in
98-
true) echo "PR clean" ; exit 0 ;;
99-
false) echo "PR not clean" ; exit 1 ;;
100-
esac
7+
formatting:
8+
name: PR formatting
9+
uses: alisw/ali-bot/.github/workflows/c++-code-formatting.yml@master
10+
secrets:
11+
alibuild_github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Current refactorings
2+
3+
on: [pull_request_target]
4+
env:
5+
RATIONALE: "Adapt to new FairLogger API"
6+
REFACTORING: "s|LOGP[(]ERROR|LOGP(error|g;s|LOGP[(]INFO|LOGP(info|g;s|LOGP[(]WARNING|LOGP(warning|g;s|LOGP[(]WARN|LOGP(warn|g;s|LOGP[(]DEBUG|LOGP(debug|;s|LOG[(]ERROR|LOG(error|g;s|LOG[(]INFO|LOG(info|g;s|LOG[(]WARNING|LOG(warning|g;s|LOG[(]WARN|LOG(warn|g;s|LOG[(]DEBUG|LOG(debug|g"
7+
8+
jobs:
9+
build:
10+
# We need at least 20.04 to install clang-format-11.
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
ref: ${{ github.event.pull_request.head.sha }}
17+
persist-credentials: false
18+
# We need the history of the dev branch all the way back to where the PR
19+
# diverged. We're fetching everything here, as we don't know how many
20+
# commits back that point is.
21+
fetch-depth: 0
22+
23+
- name: Run refactoring
24+
id: run_refactoring
25+
env:
26+
ALIBUILD_GITHUB_TOKEN: ${{secrets.ALIBUILD_GITHUB_TOKEN}}
27+
run: |
28+
set -x
29+
# We need to fetch the other commit.
30+
git fetch origin ${{ github.event.pull_request.base.ref }} \
31+
pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}
32+
33+
# We create a new branch which we will use for the eventual PR.
34+
git config --global user.email "alibuild@cern.ch"
35+
git config --global user.name "ALICE Action Bot"
36+
git checkout -b alibot-refactor-${{ github.event.pull_request.number }} ${{ github.event.pull_request.head.sha }}
37+
38+
# github.event.pull_request.base.sha is the latest commit on the branch
39+
# the PR will be merged into, NOT the commit this PR derives from! For
40+
# that, we need to find the latest common ancestor between the PR and
41+
# the branch we are merging into.
42+
BASE_COMMIT=$(git merge-base HEAD ${{ github.event.pull_request.base.sha }})
43+
echo "Running refactoring against branch ${{ github.event.pull_request.base.ref }}, with hash ${{ github.event.pull_request.base.sha }}"
44+
COMMIT_FILES=$(git diff --diff-filter d --name-only $BASE_COMMIT)
45+
if [ -z "$COMMIT_FILES" ]; then
46+
echo "No files to check" >&2
47+
echo clean=true >> "$GITHUB_OUTPUT"
48+
exit 0
49+
fi
50+
perl -p -i -e "${{ env.REFACTORING }}" $COMMIT_FILES
51+
52+
if git diff --exit-code; then
53+
echo "Refactoring not needed."
54+
git push --set-upstream https://alibuild:$ALIBUILD_GITHUB_TOKEN@github.com/alibuild/AliceO2.git :alibot-refactoring-${{ github.event.pull_request.number }} -f || true
55+
echo clean=true >> "$GITHUB_OUTPUT"
56+
else
57+
git commit -m "${{ env.RATIONALE }}" -a
58+
git show | cat
59+
git fetch https://github.com/AliceO2Group/AliceO2.git pull/${{ github.event.pull_request.number }}/head
60+
git push --set-upstream https://alibuild:$ALIBUILD_GITHUB_TOKEN@github.com/alibuild/AliceO2.git HEAD:refs/heads/alibot-refactoring-${{ github.event.pull_request.number }} -f
61+
echo clean=false >> "$GITHUB_OUTPUT"
62+
fi
63+
64+
- name: pull-request
65+
uses: alisw/pull-request@master
66+
with:
67+
source_branch: 'alibuild:alibot-refactoring-${{ github.event.pull_request.number }}'
68+
destination_branch: '${{ github.event.pull_request.head.label }}'
69+
github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }}
70+
pr_title: "Please consider the refactoring changes to AliceO2Group/AliceO2#${{ github.event.pull_request.number }}"
71+
pr_body: |
72+
AliceO2Group/AliceO2#${{ github.event.pull_request.number }}" cannot be merged as is.
73+
You should either modify your code according to what is done in this PR, or directly merge this PR in yours.
74+
The rationale for this change is:
75+
${{ env.RATIONALE }}
76+
77+
continue-on-error: true # We do not create PRs if the branch is not there.
78+
79+
- name: Exit with error if the PR is not clean
80+
run: |
81+
case ${{ steps.run_refactoring.outputs.clean }} in
82+
true) echo "PR clean" ; exit 0 ;;
83+
false) echo "PR not clean" ; exit 1 ;;
84+
esac

0 commit comments

Comments
 (0)