@@ -100,7 +100,7 @@ def sync(self):
100
100
self .make_pull_request ()
101
101
except PullRequestException as e :
102
102
self .reset_target_dir ()
103
- raise PullRequestException (pr_exception )
103
+ raise PullRequestException (e )
104
104
105
105
self .reset_target_dir ()
106
106
@@ -140,7 +140,7 @@ def get_wf_config(self):
140
140
# Try to check out target branch (eg. `origin/dev`)
141
141
try :
142
142
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 ))
144
144
self .repo .git .checkout (self .from_branch )
145
145
except git .exc .GitCommandError :
146
146
raise SyncException ("Branch `{}` not found!" .format (self .from_branch ))
@@ -173,7 +173,7 @@ def get_wf_config(self):
173
173
)
174
174
175
175
# Fetch workflow variables
176
- log .info ("Fetching workflow config variables" )
176
+ log .debug ("Fetching workflow config variables" )
177
177
self .wf_config = nf_core .utils .fetch_wf_config (self .pipeline_dir )
178
178
179
179
# Check that we have the required variables
@@ -201,7 +201,7 @@ def delete_template_branch_files(self):
201
201
Delete all files in the TEMPLATE branch
202
202
"""
203
203
# Delete everything
204
- log .info ("Deleting all files in TEMPLATE branch" )
204
+ log .debug ("Deleting all files in TEMPLATE branch" )
205
205
for the_file in os .listdir (self .pipeline_dir ):
206
206
if the_file == ".git" :
207
207
continue
@@ -219,11 +219,10 @@ def make_template_pipeline(self):
219
219
"""
220
220
Delete all files and make a fresh template using the workflow variables
221
221
"""
222
- log .info ("Making a new template pipeline using pipeline variables" )
222
+ log .debug ("Making a new template pipeline using pipeline variables" )
223
223
224
224
# 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 )
227
226
228
227
nf_core .create .PipelineCreate (
229
228
name = self .wf_config ["manifest.name" ].strip ('"' ).strip ("'" ),
@@ -247,7 +246,7 @@ def commit_template_changes(self):
247
246
self .repo .git .add (A = True )
248
247
self .repo .index .commit ("Template update for nf-core/tools version {}" .format (nf_core .__version__ ))
249
248
self .made_changes = True
250
- log .info ("Committed changes to TEMPLATE branch" )
249
+ log .debug ("Committed changes to TEMPLATE branch" )
251
250
except Exception as e :
252
251
raise SyncException ("Could not commit changes to TEMPLATE:\n {}" .format (e ))
253
252
return True
@@ -257,7 +256,7 @@ def push_template_branch(self):
257
256
and try to make a PR. If we don't have the auth token, try to figure out a URL
258
257
for the PR and print this to the console.
259
258
"""
260
- log .info ("Pushing TEMPLATE branch to remote" )
259
+ log .debug ("Pushing TEMPLATE branch to remote: '{}'" . format ( os . path . basename ( self . pipeline_dir )) )
261
260
try :
262
261
self .repo .git .push ()
263
262
except git .exc .GitCommandError as e :
@@ -287,23 +286,18 @@ def make_pull_request(self):
287
286
)
288
287
raise PullRequestException ("No GitHub authentication token set - cannot make PR" )
289
288
290
- log .info ("Submitting a pull request via the GitHub API" )
289
+ log .debug ("Submitting a pull request via the GitHub API" )
291
290
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__ )
307
301
308
302
pr_content = {
309
303
"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):
360
354
# Let's do some updating!
361
355
for wf in wfs .remote_workflows :
362
356
357
+ log .info ("-" * 30 )
363
358
log .info ("Syncing {}" .format (wf .full_name ))
364
359
365
360
# Make a local working directory
@@ -373,8 +368,7 @@ def sync_all_pipelines(gh_username=None, gh_auth_token=None):
373
368
assert repo
374
369
375
370
# 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 )
378
372
379
373
# Sync the repo
380
374
log .debug ("Running template sync" )
@@ -395,7 +389,7 @@ def sync_all_pipelines(gh_username=None, gh_auth_token=None):
395
389
failed_syncs .append (wf .name )
396
390
else :
397
391
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 (
399
393
wf .full_name , sync_obj .gh_pr_returned_data .get ("html_url" )
400
394
)
401
395
)
0 commit comments