Skip to content
Snippets Groups Projects
Commit 285ce195 authored by Jonas Höppner's avatar Jonas Höppner
Browse files

CI: Merge_into_manifest: Fixes for merge detection

parent ce59c409
No related branches found
No related tags found
No related merge requests found
......@@ -125,6 +125,8 @@ deploy:
extends:
- .deploy
- .manifest-projects
rules:
- when: never
deploy-foobar:
extends:
......@@ -134,6 +136,7 @@ deploy-foobar:
trigger:
stage: deploy
rules:
- when: never
- if: $CI_MERGE_REQUEST_IID
needs: [deploy]
trigger:
......@@ -194,13 +197,13 @@ check:
- MERGE_REQUEST="${CI_MERGE_REQUEST_IID}";
- MASTER_BRANCH=dunfell
- ./check_if_integration_branch_is_up_to_date.py
--gitlab-url=${CI_SERVER_URL}
--token=${GITBOT_TOKEN}
--manifest-project=${CI_PROJECT_ROOT_NAMESPACE}/yocto/manifest
--integration-base=${MASTER_BRANCH}
--project=${CI_PROJECT_PATH}
--merge-request=${CI_MERGE_REQUEST_IID}
# - ./check_if_integration_branch_is_up_to_date.py
# --gitlab-url=${CI_SERVER_URL}
# --token=${GITBOT_TOKEN}
# --manifest-project=${CI_PROJECT_ROOT_NAMESPACE}/yocto/manifest
# --integration-base=${MASTER_BRANCH}
# --project=${CI_PROJECT_PATH}
# --merge-request=${CI_MERGE_REQUEST_IID}
# The check is done for both manifests in one job as the retrigger
# looks for jobs named check, though there can only be one
......@@ -212,3 +215,4 @@ check:
--integration-base=master
--project=${CI_PROJECT_PATH}
--merge-request=${CI_MERGE_REQUEST_IID}
--verbose
......@@ -79,4 +79,5 @@ yamllint:
--integration-base=${MASTER_BRANCH_MANIFEST}
--project=${CI_PROJECT_PATH}
--merge-request=${MERGE_REQUEST}
--verbose
${PARENT_MR}
......@@ -111,6 +111,7 @@ merge:
--commit=${CI_COMMIT_SHA}
--save-revision-to=manifest_revision
--recipe-name=${BB_RECIPE_NAME}
--verbose
artifacts:
paths:
- manifest_revision
......
......@@ -2,6 +2,7 @@
import common
import argparse
import logging
import sys
import time
from gitlab import Gitlab
......@@ -37,9 +38,10 @@ def merge_into_manifest(
recipe_name=recipe_name,
srcrev_file=srcrev_file,
)
logging.debug(current_revisions)
# This commit is contained there if current_revisions contains
# it directly or any parrent of current_revisions is commit
for rev in current_revisions:
for rev in current_revisions.values():
if common.is_commit_parent_of_project_commit(project, rev, commit):
print(
"Commit {} is already merged into {}".format(
......@@ -191,8 +193,16 @@ def main():
dest="revision_file",
required=False,
)
parser.add_argument(
"-v",
"--verbose",
action="store_true",
help="""Increase verbosity.""",
)
args, _ = parser.parse_known_args()
if args.verbose:
logging.basicConfig(level=logging.DEBUG)
gitlab = Gitlab(args.gitlab_url, private_token=args.token)
project = common.get_project(gitlab, args.project)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment