-
Notifications
You must be signed in to change notification settings - Fork 219
add support for --preview-pr #2331
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
Changes from 3 commits
ce1b274
792cc08
29aea71
468f154
e2b0a97
77ddd19
79c9913
3ba5bf9
a086775
f2c8bfd
bde283d
25e9b56
ca98281
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,7 @@ | |
| from easybuild.framework.easyconfig.style import cmdline_easyconfigs_style_check | ||
| from easybuild.framework.easyconfig.tools import alt_easyconfig_paths, categorize_files_by_type, dep_graph | ||
| from easybuild.framework.easyconfig.tools import det_easyconfig_paths, dump_env_script, get_paths_for | ||
| from easybuild.framework.easyconfig.tools import parse_easyconfigs, review_pr, skip_available | ||
| from easybuild.framework.easyconfig.tools import parse_easyconfigs, preview_pr, review_pr, skip_available | ||
| from easybuild.framework.easyconfig.tweak import obtain_ec_for, tweak | ||
| from easybuild.tools.config import find_last_log, get_repository, get_repositorypath, build_option | ||
| from easybuild.tools.docs import list_software | ||
|
|
@@ -375,7 +375,7 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None): | |
|
|
||
| forced = options.force or options.rebuild | ||
| dry_run_mode = options.dry_run or options.dry_run_short | ||
| new_update_pr = options.new_pr or options.update_pr | ||
| new_update_pr = options.new_pr or options.update_pr or options.preview_pr | ||
|
||
|
|
||
| # skip modules that are already installed unless forced, or unless an option is used that warrants not skipping | ||
| if not (forced or dry_run_mode or options.extended_dry_run or new_update_pr or options.inject_checksums): | ||
|
|
@@ -402,7 +402,11 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None): | |
|
|
||
| # creating/updating PRs | ||
| if new_update_pr: | ||
| if options.new_pr: | ||
| if options.preview_pr: | ||
| print preview_pr(paths, colored=use_color(options.color)) | ||
| cleanup(logfile, eb_tmpdir, testing, silent=True) | ||
| sys.exit(0) | ||
|
||
| elif options.new_pr: | ||
|
||
| new_pr(categorized_paths, ordered_ecs, title=options.pr_title, descr=options.pr_descr, | ||
| commit_msg=options.pr_commit_msg) | ||
| else: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@migueldiascosta This is working as expected now, but there's way too much copy-pasting going on here when comparing
preview_prwithreview_pr.The only thing that differs is the list of files (
pr_files) and a part of the log message.Can we create a private method (
_pr_diff_commonor something like that) which accepts these two as additional arguments?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boegel definitely, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current approach of enhancing the existing
review_pris way better 👍