@@ -100,7 +100,7 @@ def sync(self):
100100 self .make_pull_request ()
101101 except PullRequestException as e :
102102 self .reset_target_dir ()
103- raise PullRequestException (pr_exception )
103+ raise PullRequestException (e )
104104
105105 self .reset_target_dir ()
106106
@@ -140,7 +140,7 @@ def get_wf_config(self):
140140 # Try to check out target branch (eg. `origin/dev`)
141141 try :
142142 if self .from_branch and self .repo .active_branch .name != self .from_branch :
143- log .info ("Checking out workflow branch '{}'" .format (self .from_branch ))
143+ log .debug ("Checking out workflow branch '{}'" .format (self .from_branch ))
144144 self .repo .git .checkout (self .from_branch )
145145 except git .exc .GitCommandError :
146146 raise SyncException ("Branch `{}` not found!" .format (self .from_branch ))
@@ -173,7 +173,7 @@ def get_wf_config(self):
173173 )
174174
175175 # Fetch workflow variables
176- log .info ("Fetching workflow config variables" )
176+ log .debug ("Fetching workflow config variables" )
177177 self .wf_config = nf_core .utils .fetch_wf_config (self .pipeline_dir )
178178
179179 # Check that we have the required variables
@@ -201,7 +201,7 @@ def delete_template_branch_files(self):
201201 Delete all files in the TEMPLATE branch
202202 """
203203 # Delete everything
204- log .info ("Deleting all files in TEMPLATE branch" )
204+ log .debug ("Deleting all files in TEMPLATE branch" )
205205 for the_file in os .listdir (self .pipeline_dir ):
206206 if the_file == ".git" :
207207 continue
@@ -219,11 +219,10 @@ def make_template_pipeline(self):
219219 """
220220 Delete all files and make a fresh template using the workflow variables
221221 """
222- log .info ("Making a new template pipeline using pipeline variables" )
222+ log .debug ("Making a new template pipeline using pipeline variables" )
223223
224224 # Only show error messages from pipeline creation
225- if log .getEffectiveLevel () == logging .INFO :
226- logging .getLogger ("nf_core.create" ).setLevel (logging .ERROR )
225+ logging .getLogger ("nf_core.create" ).setLevel (logging .ERROR )
227226
228227 nf_core .create .PipelineCreate (
229228 name = self .wf_config ["manifest.name" ].strip ('"' ).strip ("'" ),
@@ -247,7 +246,7 @@ def commit_template_changes(self):
247246 self .repo .git .add (A = True )
248247 self .repo .index .commit ("Template update for nf-core/tools version {}" .format (nf_core .__version__ ))
249248 self .made_changes = True
250- log .info ("Committed changes to TEMPLATE branch" )
249+ log .debug ("Committed changes to TEMPLATE branch" )
251250 except Exception as e :
252251 raise SyncException ("Could not commit changes to TEMPLATE:\n {}" .format (e ))
253252 return True
@@ -257,7 +256,7 @@ def push_template_branch(self):
257256 and try to make a PR. If we don't have the auth token, try to figure out a URL
258257 for the PR and print this to the console.
259258 """
260- log .info ("Pushing TEMPLATE branch to remote" )
259+ log .debug ("Pushing TEMPLATE branch to remote: '{}'" . format ( os . path . basename ( self . pipeline_dir )) )
261260 try :
262261 self .repo .git .push ()
263262 except git .exc .GitCommandError as e :
@@ -287,23 +286,18 @@ def make_pull_request(self):
287286 )
288287 raise PullRequestException ("No GitHub authentication token set - cannot make PR" )
289288
290- log .info ("Submitting a pull request via the GitHub API" )
289+ log .debug ("Submitting a pull request via the GitHub API" )
291290
292- pr_body_text = """
293- A new release of the main template in nf-core/tools has just been released.
294- This automated pull-request attempts to apply the relevant updates to this pipeline.
295-
296- Please make sure to merge this pull-request as soon as possible.
297- Once complete, make a new minor release of your pipeline.
298-
299- For instructions on how to merge this PR, please see
300- [https://nf-co.re/developers/sync](https://nf-co.re/developers/sync#merging-automated-prs).
301-
302- For more information about this release of [nf-core/tools](https://github.com/nf-core/tools),
303- please see the [nf-core/tools v{tag} release page](https://github.com/nf-core/tools/releases/tag/{tag}).
304- """ .format (
305- tag = nf_core .__version__
306- )
291+ pr_body_text = (
292+ "A new release of the main template in nf-core/tools has just been released. "
293+ "This automated pull-request attempts to apply the relevant updates to this pipeline.\n \n "
294+ "Please make sure to merge this pull-request as soon as possible. "
295+ "Once complete, make a new minor release of your pipeline. "
296+ "For instructions on how to merge this PR, please see "
297+ "[https://nf-co.re/developers/sync](https://nf-co.re/developers/sync#merging-automated-prs).\n \n "
298+ "For more information about this release of [nf-core/tools](https://github.com/nf-core/tools), "
299+ "please see the [nf-core/tools v{tag} release page](https://github.com/nf-core/tools/releases/tag/{tag})."
300+ ).format (tag = nf_core .__version__ )
307301
308302 pr_content = {
309303 "title" : "Important! Template update for nf-core/tools v{}" .format (nf_core .__version__ ),
@@ -360,6 +354,7 @@ def sync_all_pipelines(gh_username=None, gh_auth_token=None):
360354 # Let's do some updating!
361355 for wf in wfs .remote_workflows :
362356
357+ log .info ("-" * 30 )
363358 log .info ("Syncing {}" .format (wf .full_name ))
364359
365360 # Make a local working directory
@@ -373,8 +368,7 @@ def sync_all_pipelines(gh_username=None, gh_auth_token=None):
373368 assert repo
374369
375370 # Only show error messages from pipeline creation
376- if log .getEffectiveLevel () == logging .INFO :
377- logging .getLogger ("nf_core.create" ).setLevel (logging .ERROR )
371+ logging .getLogger ("nf_core.create" ).setLevel (logging .ERROR )
378372
379373 # Sync the repo
380374 log .debug ("Running template sync" )
@@ -395,7 +389,7 @@ def sync_all_pipelines(gh_username=None, gh_auth_token=None):
395389 failed_syncs .append (wf .name )
396390 else :
397391 log .info (
398- "[green]Sync successful for {}:[/] [blue][link={1}]{1}[/link]" .format (
392+ "[green]Sync successful for {0 }:[/] [blue][link={1}]{1}[/link]" .format (
399393 wf .full_name , sync_obj .gh_pr_returned_data .get ("html_url" )
400394 )
401395 )
0 commit comments