Skip to content

add script to clean up gists#958

Merged
boegel merged 6 commits intoeasybuilders:developfrom
wpoely86:cleanscript
Dec 12, 2014
Merged

add script to clean up gists#958
boegel merged 6 commits intoeasybuilders:developfrom
wpoely86:cleanscript

Conversation

@wpoely86
Copy link
Copy Markdown
Member

The script cleans up gists from closed/merged PR's.

The script cleans up gists from closed/merged PR's.
@boegel
Copy link
Copy Markdown
Member

boegel commented Jun 22, 2014

@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!

@wpoely86
Copy link
Copy Markdown
Member Author

I should add a couple of more options, delete all gists not from a PR and such...

@boegel
Copy link
Copy Markdown
Member

boegel commented Jul 3, 2014

@wpoely86: do you want to add more features in the script before this is reviewed/merged?

@wpoely86
Copy link
Copy Markdown
Member Author

wpoely86 commented Jul 3, 2014

@boegel I would add a nice option menu with the GeneralOption class to allow:

  • delete all easybuild gists
  • delete all closed/merged easybuild gists (the default)
  • delete all easybuild gists without a PR

I will try to do it as soon as possible. But the general structure of the program shouldn't change that much anymore.

@boegel
Copy link
Copy Markdown
Member

boegel commented Jul 3, 2014

@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)

@boegel boegel added this to the v1.15 milestone Jul 5, 2014
@wpoely86
Copy link
Copy Markdown
Member Author

@boegel ready for a first review

Comment thread easybuild/scripts/clean_gists.py Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah but, I don't import the easybuild logger? How does it end up here? Through EasyBuildOptions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

through anything that imports something from EB 😄 (yeah not pretty)
if you don't want it, also don't expect .error to be fatal

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@pforai
Copy link
Copy Markdown
Contributor

pforai commented Jul 16, 2014

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 [private info]:.

@wpoely86
Copy link
Copy Markdown
Member Author

@pforai you mean like the --test-report-env-filter in easybuild 1.14 😉

@boegel boegel modified the milestones: v1.15, v1.16, v1.X Sep 6, 2014
@wpoely86
Copy link
Copy Markdown
Member Author

@boegel please give this a thorough review when you got the time.

Comment thread easybuild/scripts/clean_gists.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there's no real reason to do his. you can use go.log to log (or use log=go.log)

boegel added a commit that referenced this pull request Dec 12, 2014
add script to clean up gists
@boegel boegel merged commit 011aba8 into easybuilders:develop Dec 12, 2014
@boegel
Copy link
Copy Markdown
Member

boegel commented Dec 12, 2014

Merged, thanks @wpoely86!

@wpoely86 wpoely86 deleted the cleanscript branch December 12, 2014 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants