add script to clean up gists#958
Conversation
The script cleans up gists from closed/merged PR's.
|
@wpoely86: Nice! :) I'll review/test this later (looks nice on first sight), but I can see why you created this. Thanks for contributing it! |
|
I should add a couple of more options, delete all gists not from a PR and such... |
|
@wpoely86: do you want to add more features in the script before this is reviewed/merged? |
|
@boegel I would add a nice option menu with the
I will try to do it as soon as possible. But the general structure of the program shouldn't change that much anymore. |
|
@wpoely86: makes sense, let me know when you've tackled that (but treat your other open PRs as higher priority w.r.t. EasyBuild v1.14.0 pls) |
Everything should work now
|
@boegel ready for a first review |
There was a problem hiding this comment.
This does not work, if you use log.error, you get:
Traceback (most recent call last):
File "clean_gists.py", line 129, in <module>
main()
File "clean_gists.py", line 57, in main
log.error("Please tell me what to do?")
File "/home/ward/opt/lib/python2.7/site-packages/easybuild_framework-1.15.0dev-py2.7.egg/easybuild/tools/build_log.py", line 100, in error
newMsg = "EasyBuild crashed with an error %s: %s" % (self.caller_info(), msg)
File "/home/ward/opt/lib/python2.7/site-packages/easybuild_framework-1.15.0dev-py2.7.egg/easybuild/tools/build_log.py", line 83, in caller_info
return "(at %s:%s in %s)" % (os.path.join(*filepath_dirs), line, function_name)
TypeError: join() takes at least 1 argument (0 given)
And I don't understand why this happens?
There was a problem hiding this comment.
the easybuild logger has a bug, should handle empty filepath_dirs properly. (another issue is that the EB code is not so portable to create srcipt like this).
There was a problem hiding this comment.
yeah but, I don't import the easybuild logger? How does it end up here? Through EasyBuildOptions?
There was a problem hiding this comment.
through anything that imports something from EB 😄 (yeah not pretty)
if you don't want it, also don't expect .error to be fatal
There was a problem hiding this comment.
well, I need to import stuff from EB to find out the github username and token. I will look into fixing the filepath_dirs stuff.
|
Good stuff. 👍 What would be kewl in the nice to heave department is to filter the output on the CLI in terms of what will not be uploaded in the first place - say just prepend a string like |
|
@pforai you mean like the |
|
@boegel please give this a thorough review when you got the time. |
There was a problem hiding this comment.
there's no real reason to do his. you can use go.log to log (or use log=go.log)
|
Merged, thanks @wpoely86! |
The script cleans up gists from closed/merged PR's.