From d91c53e57b40b77706a8872e7c06b929c55e3a0b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 12 2018 08:56:40 +0000 Subject: Increase the logging in when rebasing a pull-request When testing rebasing a PR that had no project_from it was quite hard to follow up what was going on and why the rebasing wasn't working as expected. With these new logs entries, it gets much easier. Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 9a11472..f1cbe86 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -1822,11 +1822,17 @@ def rebase_pull_request(request, username): # Get the fork repopath = pagure.utils.get_repo_path(request.project_from) else: + _log.info( + "PR is neither from a remote git repo or an existing local " + "repo, bailing") return if not request.project or not os.path.exists( pagure.utils.get_repo_path(request.project) ): + _log.info( + "Could not find the targeted git repository for %s", + request.project.fullname) raise pagure.exceptions.PagureException( "Could not find the targeted git repository for %s" % request.project.fullname @@ -1853,10 +1859,12 @@ def rebase_pull_request(request, username): remote.fetch() def _run_command(command): + _log.info("Running command: %s", command) try: out = subprocess.check_output( command, cwd=tempclone.repopath, stderr=subprocess.STDOUT ) + _log.info(" command ran successfully") _log.debug("Output: %s" % out) except subprocess.CalledProcessError as err: _log.debug( diff --git a/pagure/lib/tasks.py b/pagure/lib/tasks.py index 5cae1d2..6b3d200 100644 --- a/pagure/lib/tasks.py +++ b/pagure/lib/tasks.py @@ -711,15 +711,17 @@ def rebase_pull_request( project = pagure.lib.query._get_project( session, namespace=namespace, name=name, user=user ) + _log.info("Rebase PR: %s of project: %s" % (requestid, project.fullname)) with project.lock("WORKER"): request = pagure.lib.query.search_pull_requests( session, project_id=project.id, requestid=requestid ) _log.debug( - "Rebasing pull-request: %s/#%s", + "Rebasing pull-request: %s#%s, uid: %s", request.project.fullname, request.id, + request.uid, ) pagure.lib.git.rebase_pull_request(request, user_rebaser)