Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

stash filesize hook plugin

James Ching April 29, 2013

Hi,

We are trying restrict commits that contain files over a certain size and found this resource: https://bitbucket.org/atlassianlabs/stash-filesize-hook-plugin

This is exactly what we need but unfortunately we do not know how to set this up. Unfortunately I'm a sysadmin and not a programmer so I'm not sure what I need to do with the source to get this setup to work properly with stash... any instrictions or direction would be greatly appreciated!

Thanks!

6 answers

1 vote
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2013

Hi James,

I've uploaded a compiled jar to the Bitbucket repository for you:

https://bitbucket.org/atlassianlabs/stash-filesize-hook-plugin/downloads

You should be able to upload that on the plugins administration screen, and then the hook will be visible in the repository hook page which can be enabled per-repository (and a maximum size configured).

Let me know if you have any questions, although I do need to mention that this isn't an official plugin and as such we don't support it in our normal capacity.

Cheers,

Charles

James Ching April 30, 2013

Thank you so much Charles! We'll give it a shot, appreciate your help with this!

0 votes
Daniel Varela Santoalla June 17, 2013
OK, finally found the problem. The ReadMe Parser plugin was interfering, generating the Javascript error and preventing the filesize plugin to work properly. Deactivated the ReadMe Parser and now it all works as usual. Sorry for the noise here.
0 votes
Daniel Varela Santoalla June 16, 2013
Aha, there are two Javascript errors loading the "hooks" screen. No errors when clicking the button, but of course the error had already happened previously > TypeError: obj is undefined >https://foo.ecmwf.int/stash/s/d41d8cd98f00b204e9800998ecf8427e/en-1988229788/9e87d57/11/11/_/download/superbatch/js/batch.js > Line 584 > TypeError: loader is undefined > https://foo.ecmwf.int/stash/projects/TEST/repos/test/settings/hooks > Line 118
0 votes
Daniel Varela Santoalla June 16, 2013
Ummm, I'm getting the same situation with the HipChat notification plugin, so it is surely not a problem with you plugin, sorry about that. I don't know, I just updated as usual and just as I started this started happening. As I said, also the edit in place plugins stopped working... strange. ps: I don't seem to be able to post a comment (nothing happens) so I have to post a new "answer".
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2013

Daniel,

Sorry, I can't help you without more information. I need the logs from your browser and/or Stash (see above). Lastly, have you tried to clear your browser cache? Does it happen to other users or just you?

Charles

0 votes
Daniel Varela Santoalla June 16, 2013
Hi Charles, thanks for the quick answer. What I am seeing is that when I either try to enable or configure the hook in a repo the configure screen stays stuck in the "turning wheel" symbol. The only HTTP request I see the one I mention, that returns a "204". However, the same request is done with Stash 2.4.1, where it returns 204 too but the configure screen does show up. BTW, I'm also having problems with the stash-editor-plugin and "Instant Edit for Stash" plugins in 2.5, so I guess something must have changed...
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2013

Hi Daniel,

That does't sound right. Again, is there anything in your Javascript console, or an error in the $STASH_HOME/log/atlassian-stash.log file? I can confirm that the hooks on our 2.5 production server are working as expected.

Charles

0 votes
Daniel Varela Santoalla June 16, 2013

This plugin is wonderful, however it seems to have been broken by Stash 2.5. Changes in the API?

The configure screen gets stuck while I see that this AJAX request

https://my.server.com/stash/rest/api/latest/projects/TEST/repos/test/settings/hooks/com.atlassian.stash.stash-filesize-hook-plugin%3AfileSizeHook/settings

is returning "204 No Content".... Not what the plugin expects?

cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2013

Hi Daniel,

The API around hooks shouldn't have changed at all in 2.5. Also, that request is generic across all hooks, so that would mean that everything else was broken too. Are you seeing an error in either your Stash logs (in the home directory), or an error in the Javascript (ie when you open your Chrome console)?

Charles

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events