Skip to content
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

PR harmony and in-browser edit #73

Open
roy-mammen opened this issue Mar 6, 2018 · 1 comment
Open

PR harmony and in-browser edit #73

roy-mammen opened this issue Mar 6, 2018 · 1 comment

Comments

@roy-mammen
Copy link

The in-browser editing feature introduced in Bitbucket server v4.13 is supposed to respect the branch permission, and it in fact honor the inbuilt "Branch Permission" at the project/repository level. If I restrict the direct commit to 'master' using the inbuilt 'Branch permission' in Bitbucket Server it wont let me edit the files in-browser.

However, the in-browser editing doesn't honor the PR Harmony (v2.5.0) setup. In order words, even if I have "Block Direct Commits: master" enabled from the PR harmony settings, Bitbucket Server still lets me edit the files online.

When I contacted the Atlassian premier support regarding this issue, their response was as below

"""Since PR Harmony is a third party plugin, functionality in Bitbucket Server is not aware of its settings. Changes would have to be made to PR Harmony by its developer to implement something like this."""

Please do the needful to resolve this issue.

@bturner
Copy link

bturner commented Mar 8, 2018

@monitorjbl Fixing this may be a little complicated if you want to retain compatibility with Bitbucket Server 4.8-4.12. 4.13 introduced a new FileEditRequestedEvent which can be used to block file edits, but your plugin will fail to deploy in 4.12 and earlier if you use that (unless you guard it carefully, to prevent classloading issues).

A different option, if you were willing to raise your minimum supported version to Bitbucket Server 5.0, would be to turn CommitBlockerHook into a PreRepositoryHook, and watch for FILE_EDIT and REPO_PUSH RepositoryHookTriggers. Our new hooks guide might help with this change. (Note the PreReceiveHook CommitBlockerHook currently implements is deprecated, and will be removed in our 6.0 major release, so switching to PreRepositoryHook will need to happen eventually.)

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

No branches or pull requests

2 participants