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

Server-side pre-commit hook?

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 29, 2020

My questions might sound silly at first but here is what I want to achieve:

Currently we are using a custom pre-receive script written in Perl which does some syntax checking on our pushed files. It has been put in each repository's hooks/post-receive.d/ directory on the Bitbucket server. This is being provisoined by Puppet and works just fine.

HOWEVER users can bypass this hook by using the online Bitbucket editor. Pre-receive hooks are only being triggered on a push. And committing with the online editor does not involve any push.
So I thought I could fix this by using the same script as pre-commit hook on the server side. But apparently pre-commit scripts are not being triggered either when using the online editor.
I know pre-commit hooks are meant to be used client-side but how I see it Bitbucket server is the client when using the online editor.
Anyone knows how to achieve this?

 

1 answer

1 vote
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 30, 2020

I don't think it's gonna work.

We have a Bitbucket app, very similar functionality (commit policy enforced) and the Bitbucket editor does not call the corresponding handlers. At least, it was the status some months ago.

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2020

Hmm that's a pity. And I don't want to disable the editor because it's useful for some other projects.
Maybe we should use a CI plan instead.

Thanks for your answer!

Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2020

You may want to accept the answer so that future visitors can see if it was correct even if not an actual solution.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events