Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Specification Tools
Scripts
Commits
bc02d62e
Commit
bc02d62e
authored
7 months ago
by
Miguel Angel Reina Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Adding more details to the conflict log file
parent
50219adb
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
checking_conflicts.sh
+10
-2
10 additions, 2 deletions
checking_conflicts.sh
generateChangemarks/.gitlab-ci.yml
+3
-3
3 additions, 3 deletions
generateChangemarks/.gitlab-ci.yml
with
13 additions
and
5 deletions
checking_conflicts.sh
+
10
−
2
View file @
bc02d62e
...
@@ -55,9 +55,9 @@ echo "\n------ Getting all potential conflicting merge requests --------"
...
@@ -55,9 +55,9 @@ echo "\n------ Getting all potential conflicting merge requests --------"
# Initialize an empty array to store conflicting merge requests
# Initialize an empty array to store conflicting merge requests
conflicting_merge_request_ids
=()
conflicting_merge_request_ids
=()
if
[
${
3
}
==
"all"
]
;
then
if
[
${
3
}
==
"all"
]
;
then
merge_requests
=
$(
curl
"
${
1
}
/projects/
${
2
}
/merge_requests?state=opened&target_branch=
${
4
}
"
)
merge_requests
=
$(
curl
--header
"PRIVATE-TOKEN:
${
10
}
"
"
${
1
}
/projects/
${
2
}
/merge_requests?state=opened&target_branch=
${
4
}
"
)
else
else
merge_requests
=
$(
curl
"
${
1
}
/projects/
${
2
}
/merge_requests?state=opened&milestone=
${
3
}
&target_branch=
${
4
}
"
)
merge_requests
=
$(
curl
--header
"PRIVATE-TOKEN:
${
10
}
"
"
${
1
}
/projects/
${
2
}
/merge_requests?state=opened&milestone=
${
3
}
&target_branch=
${
4
}
"
)
fi
fi
echo
"
${
merge_requests
}
"
| jq
-c
'.[]'
|
while
read
mr
;
do
echo
"
${
merge_requests
}
"
| jq
-c
'.[]'
|
while
read
mr
;
do
mr_id
=
$(
echo
"
$mr
"
| jq
'.iid'
)
mr_id
=
$(
echo
"
$mr
"
| jq
'.iid'
)
...
@@ -86,6 +86,14 @@ echo "${merge_requests}" | jq -c '.[]' | while read mr; do
...
@@ -86,6 +86,14 @@ echo "${merge_requests}" | jq -c '.[]' | while read mr; do
result
=
$?
result
=
$?
if
[
!
$result
==
0
]
;
then
if
[
!
$result
==
0
]
;
then
echo
"Merge request title:
${
mr_title
}
, Merge Request ID:
${
mr_id
}
"
>>
conflicting_merge_requests.txt
echo
"Merge request title:
${
mr_title
}
, Merge Request ID:
${
mr_id
}
"
>>
conflicting_merge_requests.txt
spec
=
$(
git diff
--name-only
--diff-filter
=
U |
grep
-E
"(TS|TR)"
)
sed
-n
'
/^<<<<<<< /,/^>>>>>>> / {
/^<<<<<<<\|^>>>>>>>/!{=;p}
/^>>>>>>> /a\
}
'
${
spec
}
>>
conflicting_merge_requests.txt
conflicting_merge_request_ids+
=(
"
${
mr_id
}
"
)
conflicting_merge_request_ids+
=(
"
${
mr_id
}
"
)
# Setting label to the merge request which is conflicting with
# Setting label to the merge request which is conflicting with
echo
"Setting label to the merge request which is conflicting with:
${
mr_id
}
"
echo
"Setting label to the merge request which is conflicting with:
${
mr_id
}
"
...
...
This diff is collapsed.
Click to expand it.
generateChangemarks/.gitlab-ci.yml
+
3
−
3
View file @
bc02d62e
...
@@ -40,12 +40,12 @@ Checking conflicts:
...
@@ -40,12 +40,12 @@ Checking conflicts:
# Installation of required software
# Installation of required software
-
apt-get update -qq && apt-get -qq install -y git curl jq > /dev/null
-
apt-get update -qq && apt-get -qq install -y git curl jq > /dev/null
-
|
-
|
curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/checking_conflicts%2Esh/raw?ref=
master
" >> checking_conflicts.sh
curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/checking_conflicts%2Esh/raw?ref=
detailsConflicts
" >> checking_conflicts.sh
-
chmod +x checking_conflicts.sh
-
chmod +x checking_conflicts.sh
-
git clone "https://$CI_SERVER_HOST/$CI_PROJECT_PATH.git" ${CI_PROJECT_NAME}
-
git clone "https://
oauth2:${PIPELINE_ACCESS_TOKEN}@
$CI_SERVER_HOST/$CI_PROJECT_PATH.git" ${CI_PROJECT_NAME}
script
:
script
:
-
echo 'Checking conflicts'
-
echo 'Checking conflicts'
-
./checking_conflicts.sh ${CI_API_V4_URL} ${CI_MERGE_REQUEST_PROJECT_ID} ${MERGE_REQUEST_MILESTONE} ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} ${CI_MERGE_REQUEST_IID} ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} ${CI_PROJECT_NAME} "$GITLAB_USER_NAME" $GITLAB_USER_EMAIL $
MIK
E_ACCESS_TOKEN
-
./checking_conflicts.sh ${CI_API_V4_URL} ${CI_MERGE_REQUEST_PROJECT_ID} ${MERGE_REQUEST_MILESTONE} ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} ${CI_MERGE_REQUEST_IID} ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} ${CI_PROJECT_NAME} "$GITLAB_USER_NAME" $GITLAB_USER_EMAIL $
PIPELIN
E_ACCESS_TOKEN
artifacts
:
artifacts
:
when
:
on_failure
when
:
on_failure
paths
:
paths
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment