-
Notifications
You must be signed in to change notification settings - Fork 93
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
Enable clickthrough to original repo #162
Comments
100% something I agree with and something I am looking to integrate. As you say I just need to come up with a flexible url-pattern matcher which makes it easy per source. I am actually going to be defining those soon actually so that if you have 2 sources you can filter accordingly. IE you may want to index code from github, bitbucket and gitlab and should be able to filer on each accordingly. With the above in place the click though to the actual file is possible. It is on the list of things to do. |
Moved up in priority as it is a requirement for searchcode.com |
So this functionality now exists in master if you need it urgently. However you need to manually add the repository using the Repository Add screen in admin. The source are defined in ./include/source/database.json and look like the following, https://github.com/{user}/{project}/blob/{branch}/{filepath} NB You can update the file as required to get new sources and the like. It should be refreshed every time the add page is loaded. However the name value should be unique. There are 3 new fields to help with this when adding a repository. Source = Contains the names from the database JSON file mentioned above. I have only included replacements that would work for GitHub/BitBucket/GitLab. I will have a look at other types later but this covers the majority. Existing field of Repository Branch is used to get {branch} TODO
|
Looks great, thanks! |
Still need to fix up the API to support this but most of it is there now. The ability to filter by source is rather neat though. |
Just needs additional testing at this point. Going to move into test. |
To further this, for file system source it would be nice to have a direct link to the file. So for example, if my files system repo path is /code/test and the file is /code/test/folder/myfile.js , but I enter in a repository source of file://fileserver/code/test/, then it would link to file://fileserver/code/test/folder/myfile.js so that it can open directly from within the browser in the default editor of choice. |
@MaxDiOrio So that would only work if whoever is browsing the page has the code on their local machine at the same file location. However it is still possible to do. Edit the ./include/source/database.json file and define your own source like the below,
Then when adding the repository select the source "File" and it all should work for you. Of course after the file:// portion you will need to add the full path. I am still working on the edit screen for the repositories so you can set this up after the fact but it should hit master in a week or two. |
You can now add the click through to existing projects through the UI. Not going to add it to the API because if you are using that it shouldn't be a huge issue to delete everything and add it again. Merged into master. Going to move this into done as it has passed all internal tests as well. |
Currently, when you run a search the file is displayed as a local snapshot from searchcode. When you click on a line number, this updates the url with a
#NN
for the line number.It would be useful to have the ability to click on a line number and have the original repo open. In etsy/hound it's possible to specify a
url-pattern
tokenized into"{url}/{path}{anchor}"
, which lets users open custom deeplinks into various hosting platforms (gitea, gitlab, bitbucket)The text was updated successfully, but these errors were encountered: