Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scottx611x/configurable branch for vis tool registry #2942

Merged

Conversation

scottx611x
Copy link
Member

@scottx611x scottx611x commented Aug 9, 2018

@mccalluc
./manage.py load_tools --visualizations multiqc heatmap-scatterplot --branch new_tool_versions

@codecov
Copy link

codecov bot commented Aug 9, 2018

Codecov Report

Merging #2942 into develop will decrease coverage by 1.42%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2942      +/-   ##
===========================================
- Coverage    60.67%   59.25%   -1.43%     
===========================================
  Files          433      433              
  Lines        28103    27107     -996     
  Branches      1274     1274              
===========================================
- Hits         17051    16061     -990     
+ Misses       11052    11046       -6
Impacted Files Coverage Δ
refinery/tool_manager/tests.py 99.82% <100%> (-0.1%) ⬇️
...ery/tool_manager/management/commands/load_tools.py 86% <100%> (-1.94%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d20ad4...28805f9. Read the comment docs.

raise CommandError("`--branch` requires `--visualizations` to be "
"specified")
if options["branch"]:
self.visualization_registry_branch = options["branch"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do less procedural validation and use more of what argparse provides, like argument_group and mutually_exclusive_group.

def test_load_tools_command_error_if_branch_and_workflows_specified(self):
with self.assertRaises(CommandError):
call_command("load_tools", workflows=True,
branch="fake-branch-name")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in a similar vein, if we were using more of the built-in machinery, I don't think we'd need explicit checks on their error handling.

action='store',
dest='branch',
help='Branch from the registry to target for Vis tool installation'
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the "master" default explicit here, rather than the init? The help text will be more explicit, and you can get rid of one if

Copy link
Member

@mccalluc mccalluc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of functionality that comes with argparse that could be used here. Not blocking a merge, but if you wouldn't mind me tweaking this PR, I could do that...

@scottx611x scottx611x added this to Doing in Scott O. Tasks Aug 15, 2018
@scottx611x scottx611x moved this from Doing to Done in Scott O. Tasks Aug 15, 2018
@scottx611x scottx611x moved this from Done to Doing in Scott O. Tasks Aug 15, 2018
Copy link
Member

@mccalluc mccalluc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With mutually exclusive options at the top level, subparsers might be useful. I haven't actually used them before, but if it's ok with you I'll check out this branch and and try doing it that way.

@scottx611x
Copy link
Member Author

@mccalluc sounds good to me!

@scottx611x scottx611x moved this from Doing to Done in Scott O. Tasks Aug 15, 2018
@mccalluc mccalluc merged commit 4a78611 into develop Aug 15, 2018
@mccalluc mccalluc deleted the scottx611x/configurable_branch_for_vis_tool_registry branch August 15, 2018 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants