dragouf / Stash-Reviewers-Chrome-Extension

This chrome/firefox extension allow to define groups of reviewers in Atlassian Stash/Bitbucket to bulk add them when creating or updating pull request + other features
MIT License
88 stars 34 forks source link

Ability to add a local code reviewer JSON file #39

Open artie-lee opened 7 years ago

artie-lee commented 7 years ago

I would like to be able to reference a local JSON file that contains groups of reviewers in the URL to json field in Reviewer Groups via a file URI. For example, file:///folder/reviewers.json. This would also help resolve, though not entirely, issue #24 because that file could be put into a shared repo.

artie-lee commented 7 years ago

Just to be clear, if this is what the "Allow access to file URLs" checkbox in Chrome is for, it does not work for me. The result is "Error: TypeError: Failed to fetch"

SSchuetrumpf commented 7 years ago

As a workaround, you could use the raw url to the file in source control. I.e http://git.mycompany.com/projects/PROJ/repo/path/to/file.json, or whatever the url is. As an added bonus, you wouldn't have to git pull / git fetch the branch if someone made changes to the file.

artie-lee commented 7 years ago

That's a good suggestion. Unfortunately, I tried it and got this error - "Error: SyntaxError: Unexpected token < in JSON at position 0". Any thoughts on why that might happen? Perhaps because of the company firewall?

I added a screenshot too.

extension_via_git
SSchuetrumpf commented 7 years ago

The link you have it looks like a regular bitbucket file browser link, so it's likely giving you html, not the raw file. Go to that link, click the raw button and use that link. The firewall won't be an issue as long as your computer is networked, since it's just an ajax call.

On Fri, Apr 21, 2017, 4:02 PM rtrr notifications@github.com wrote:

That's a good suggestion. Unfortunately, I tried it and got this error - "Error: SyntaxError: Unexpected token < in JSON at position 0". Any thoughts on why that might happen? Perhaps because of the company firewall?

I added a screenshot too. [image: extension_via_git] https://cloud.githubusercontent.com/assets/23665454/25295996/ec31fc4a-269a-11e7-8856-ad8769ef8fc8.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dragouf/Stash-Reviewers-Chrome-Extension/issues/39#issuecomment-296304956, or mute the thread https://github.com/notifications/unsubscribe-auth/AGn44GM17eYREJWw-PNfwhgIhNvyPtgWks5ryRligaJpZM4MgCxc .

artie-lee commented 7 years ago

Good catch. But using the raw link I get the same error. Link path: https://[MyGitPathHere]/raw/reviewer_groups.json?at=refs%2Fheads%2Fmaster

I also tried at a specific commit in case it didn't like the path formatters: https://[MyGitPathHere]/raw/reviewer_groups.json?at=ebdcf33a7095571dc4b0126f0f004fa3649a35a7

It feels like I'm missing something obvious, but it's Friday and multi-tasking is not making me smarter.

ra100 commented 6 years ago

Maybe the problem is, that extension (background task) doesn't have access to your repository, as fetching is done without credentials.