Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions buildlib/az-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ check_release_build() {

elif [ "${build_reason}" == "PullRequest" ]
then
# In case of pull request, HEAD^ is the branch commit we merge with
range="$(git rev-parse HEAD^)..${build_sourceversion}"
for sha1 in `git log $range --format="%h"`
base_revision=$(git rev-parse "${build_sourceversion}^1")
head_revision=$(git rev-parse "${build_sourceversion}^2")
for sha1 in $(git log --first-parent --no-merges \
"${base_revision}..${head_revision}" --format="%h")
do
title=`git log -1 --format="%s" $sha1`
title=$(git log -1 --format="%s" $sha1)
[[ "$title" == "${title_mask}"* ]] && launch=True;
done
fi
Expand Down
13 changes: 6 additions & 7 deletions buildlib/pr/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
set -eE
source ./buildlib/tools/codestyle.sh

BASE_SOURCEVERSION=$(git rev-parse HEAD^)
range="$BASE_SOURCEVERSION..$(Build.SourceVersion)"
base_revision=$(git rev-parse "$(Build.SourceVersion)^1")
head_revision=$(git rev-parse "$(Build.SourceVersion)^2")

codestyle_check_commit_title "$range"
codestyle_check_commit_title "$base_revision..$head_revision"
if [[ $? -ne 0 ]]
then
url="https://github.com/openucx/ucx/wiki/Guidance-for-contributors#general-guidelines"
Expand Down Expand Up @@ -85,11 +85,10 @@ jobs:
- bash: |
set -eEx

BASE_SOURCEVERSION=$(git rev-parse HEAD^)
range="$BASE_SOURCEVERSION..$(Build.SourceVersion)"
base_revision=$(git rev-parse "$(Build.SourceVersion)^1")
head_revision=$(git rev-parse "$(Build.SourceVersion)^2")

echo "Looking for missing AUTHORS on commit range ${range}"
./contrib/authors_update.sh "$range"
./contrib/authors_update.sh "$base_revision..$head_revision"
git diff --exit-code
displayName: AUTHORS file check

Expand Down
6 changes: 3 additions & 3 deletions buildlib/tools/codestyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ codestyle_check_commit_title() {
local range="$1"
local err=0

for sha1 in `git log "$range" --format="%h"`
for sha1 in $(git log --first-parent --no-merges "$range" --format="%h")
do
title=`git log -1 --format="%s" $sha1`
if echo $title | grep -qP '^Merge |^[0-9A-Z/_\-]*: \w'
title=$(git log -1 --format="%s" $sha1)
if [[ $title =~ ^[0-9A-Z/_-]*:\ [[:alnum:]_] ]]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ $title =~ ^[0-9A-Z/_-]*:\ [[:alnum:]_] ]]
if [[ $title =~ ^[0-9A-Z/_-]+:\ [[:alnum:]_] ]]

then
echo "Good commit title: '$title'"
else
Expand Down
3 changes: 2 additions & 1 deletion contrib/authors_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ then
fi

# Failure message triggered if range is not valid
lines=$(git log --no-merges --pretty=format:"%an%x09%ae" "$range" | sort -u)
lines=$(git log --first-parent --no-merges --pretty=format:"%an%x09%ae" \
"$range" | sort -u)
if [ -z "$lines" ]
then
echo "Error: provided range \"$range\" is empty"
Expand Down
Loading