Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gitlab-ci
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
SECO Northern Europe
Yocto
infrastructure
gitlab-ci
Commits
b86fe238
Commit
b86fe238
authored
2 years ago
by
Jonas Höppner
Browse files
Options
Downloads
Patches
Plain Diff
CI: merge_into_manifest: Check if a commit is already merged
parent
daa4cbee
No related branches found
Branches containing commit
No related tags found
1 merge request
!107
CI: deploy_gitlab_ci: Move one-time code to own function as reference
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
merge_into_manifest.py
+22
-0
22 additions, 0 deletions
merge_into_manifest.py
with
22 additions
and
0 deletions
merge_into_manifest.py
+
22
−
0
View file @
b86fe238
...
@@ -9,6 +9,7 @@ from accept_merge_request import accept_merge_request
...
@@ -9,6 +9,7 @@ from accept_merge_request import accept_merge_request
from
create_merge_request
import
create_merge_request
from
create_merge_request
import
create_merge_request
from
get_merge_requests
import
get_merge_requests
from
get_merge_requests
import
get_merge_requests
from
integrate_into_manifest
import
integrate_into_manifest
from
integrate_into_manifest
import
integrate_into_manifest
from
get_current_revision_from_manifest
import
get_current_revision_from_manifest
def
merge_into_manifest
(
def
merge_into_manifest
(
...
@@ -26,6 +27,27 @@ def merge_into_manifest(
...
@@ -26,6 +27,27 @@ def merge_into_manifest(
the current manifest master.
the current manifest master.
"""
"""
# Check if the commit is already merged
# Currently this is especially true if the gitlab-ci
# pipeline already has merged an gitlab-ci update
current_revisions
=
get_current_revision_from_manifest
(
manifest_project
=
manifest_project
,
manifest_branch
=
master_branch
,
project
=
project
,
recipe_name
=
recipe_name
,
srcrev_file
=
srcrev_file
,
)
# This commit is contained there if current_revisions contains
# it directly or any parrent of current_revisions is commit
for
rev
in
current_revisions
:
if
common
.
is_commit_parent_of_project_commit
(
project
,
rev
,
commit
):
print
(
"
Commit {} is already merged into {}
"
.
format
(
commit
,
manifest_project
.
name
)
)
return
# Get source merge request
# Get source merge request
mrs
=
get_merge_requests
(
mrs
=
get_merge_requests
(
project
,
project
,
...
...
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