wildbit/beanstalk-code-snippet-bot

Bot isn't working with Subvevrsion repositories

Closed this issue · 3 comments

Would this be as simple as just changing this:

\/browse\/git\/

to this:

\/browse\/(?:(?:git)|(?:trunk)|(?:tags)|(?:branches))\/

on this line:

https://github.com/wildbit/beanstalk-code-snippet-bot/blob/master/src/utils.js#L19

(if all the API interactions are the same for both Git and Subversion repositories)

Actually - might be a git more complex - since 'git' isn't part of the file path's in the repos - whereas 'trunk' / 'tags' / 'branches' are. Need to play with the RegExp and value capturing a bit more I guess.

Can you submit a PR please if you get it working? Would be great!

Also add tests with Subversion URLs here https://github.com/wildbit/beanstalk-code-snippet-bot/blob/master/test/utils.spec.js#L71

Looks like you were spot on; all the API calls are repository type agnostic - it was just a case of parsing the values out of the file URL slightly differently and Subversion repositories worked fine too.