Skip to content
Snippets Groups Projects
Commit bfa38b24 authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Improve log messages

parent 1c9670d9
No related branches found
No related tags found
1 merge request!189Multiple integration pipelines
...@@ -163,8 +163,14 @@ def commit_and_push( ...@@ -163,8 +163,14 @@ def commit_and_push(
"""Commit and push to a repo branch""" """Commit and push to a repo branch"""
branch = repo.head.reference branch = repo.head.reference
author = Actor(name, email) author = Actor(name, email)
logging.debug("Committing changes:")
logging.debug(repo.git.diff("--staged"))
repo.index.commit(message, author=author, committer=author) repo.index.commit(message, author=author, committer=author)
print(repo.git.log("--oneline", "-n", "5"))
logging.debug("Git log:")
logging.debug(repo.git.log("--oneline", "-n", "5"))
# Push commit # Push commit
try: try:
...@@ -179,7 +185,7 @@ def commit_and_push( ...@@ -179,7 +185,7 @@ def commit_and_push(
print("Pushed new commit:") print("Pushed new commit:")
print(project.web_url + "/-/commit/" + revision) print(project.web_url + "/-/commit/" + revision)
if not less_verbose: if not less_verbose:
print(repo.git.show("--summary", "--decorate")) print(repo.git.show("--summary", "--decorate") + "\n")
return revision return revision
......
...@@ -71,12 +71,12 @@ def update_srcrev(srcrev, recipe_name, new_revision): ...@@ -71,12 +71,12 @@ def update_srcrev(srcrev, recipe_name, new_revision):
def integrate_into_manifest( def integrate_into_manifest(
manifest_project, manifest_project: Project,
integration_base, integration_base,
manifest_file, manifest_file,
srcrev_file, srcrev_file,
recipe_name, recipe_name,
project, project: Project,
merge_request, merge_request,
): ):
gitlab = manifest_project.manager.gitlab gitlab = manifest_project.manager.gitlab
...@@ -92,6 +92,7 @@ def integrate_into_manifest( ...@@ -92,6 +92,7 @@ def integrate_into_manifest(
# Checkout manifest # Checkout manifest
# TODO replace checkout with gitlab api access # TODO replace checkout with gitlab api access
print("Cloning manifest repo: %s" % manifest_project.http_url_to_repo)
try: try:
manifest_repo = Repo.clone_from( manifest_repo = Repo.clone_from(
clone_url.url, manifest_dir, branch=integration_base clone_url.url, manifest_dir, branch=integration_base
...@@ -115,7 +116,8 @@ def integrate_into_manifest( ...@@ -115,7 +116,8 @@ def integrate_into_manifest(
) )
logging.debug("Heads: %s", manifest_repo.heads) logging.debug("Heads: %s", manifest_repo.heads)
manifest_repo.heads[integration_branch].checkout() manifest_repo.heads[integration_branch].checkout()
print(manifest_repo.git.log("--oneline", "-n", "5")) logging.debug(manifest_repo.git.log("--oneline", "-n", "5"))
print("Using existing integration branch: %s" % integration_branch)
else: else:
# Create integration branch (delete former one if already exists) # Create integration branch (delete former one if already exists)
integration_branch = common.integration_branch_name( integration_branch = common.integration_branch_name(
...@@ -125,7 +127,7 @@ def integrate_into_manifest( ...@@ -125,7 +127,7 @@ def integrate_into_manifest(
if integration_branch == ref.name: if integration_branch == ref.name:
manifest_repo.delete_head(ref) manifest_repo.delete_head(ref)
logging.debug("Integration branch: %s", integration_branch) print("Creating integration branch: %s" % integration_branch)
manifest_repo.head.set_reference( manifest_repo.head.set_reference(
manifest_repo.create_head(integration_branch) manifest_repo.create_head(integration_branch)
) )
......
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