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

Searching GitHub repo only finds 2 of 26 files containing the pattern #320

Closed
Liturgist opened this issue Apr 4, 2023 · 12 comments
Closed
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@Liturgist
Copy link

When I search the remote GitHub repo from vscode it finds only two (2) files containing the pattern.

When I search the cloned repo on my local machine, Select-String finds twenty-six (26) files.

Should these produce the same results?

@joyceerhl
Copy link
Contributor

@Liturgist do you have a minimal repro (a sample repository and a specific pattern where this repros)? This sounds like a bug but I'd need more details in order to identify the cause.

@joyceerhl joyceerhl self-assigned this Apr 4, 2023
@joyceerhl joyceerhl added the info-needed Issue requires more information from poster label Apr 4, 2023
@Liturgist
Copy link
Author

@Liturgist do you have a minimal repro (a sample repository and a specific pattern where this repros)? This sounds like a bug but I'd need more details in order to identify the cause.

@joyceerhl, this is in an Enterprise repo. I am not sure that you will be able to access the repo. I do not think that I can/should just copy the files to a personal repo. Do you typically have access to Enterprise account repos?

@joyceerhl
Copy link
Contributor

Do you mean a GitHub Enterprise repo? This extension (GitHub Repositories, for browsing repos without cloning locally) doesn't support opening repos hosted with GitHub Enterprise, so I'm not sure anymore what the scenario is here.

@Liturgist
Copy link
Author

Liturgist commented Apr 4, 2023

Do you mean a GitHub Enterprise repo? This extension (GitHub Repositories, for browsing repos without cloning locally) doesn't support opening repos hosted with GitHub Enterprise, so I'm not sure anymore what the scenario is here.

@joyceerhl, yes, this is an Enterprise account repo hosted by github.com for a Fortune < 10 company. This is not an on-prem GitHub Enterprise server.

It sounds like the extension will not search this repo remotely. Is that correct?

Can this repo be searched remotely with anything in Visual Studio?

@joyceerhl
Copy link
Contributor

This is not an on-prem GitHub Enterprise server.

OK, that makes more sense.

the extension will not search this repo remotely

This extension does implement text search. I have a few questions:

  • Is your search query a glob pattern? It's possible that the globs are being handled differently in this extension's search provider. If you could provide the specific glob pattern and examples of the 2 successful matches and the 24 unsuccessful ones that would be great (or provide an equivalent minimal repro if the matches or search contain anything proprietary).
  • Are there any errors in the developer tools console (F1 > Toggle Developer Tools)? It's possible that the requests we make to GitHub's APIs to provide search results are failing (e.g. because of network proxies, transient errors, or perhaps a difference in API behavior between Enterprise and non-enterprise repos.
  • To confirm, is this a GitHub Enterprise Cloud repo?

@Liturgist
Copy link
Author

@joyceerhl. ok, I take it all back. After downloading the "index", the search results produces 29 files containing the pattern. Now I have to find out which extra files it found.

The "index" was several MiB. How different is that from cloning the repo?

Is there an easy way to get a list of the found files onto the clipboard?

One of the files has an icon to the left of its name that is orange and looks like a WiFi symbol, but the dot is in the lower left corner. What does that mean?

@Liturgist
Copy link
Author

@joyceerhl, ok, things are a bit better. The three (3) extra files were .dtproj files and not .dtsx files that I was looking for.

What can I put in the "files to include" edit control to specify a base/root directory in the repo AND a file name extension? I want to search all *.dtsx files under the ./SSIS directory.

The WiFi-looking icon is gone. I found a way to copy the results list. I can get down to just the filenames with a couple of regex replacements.

@joyceerhl
Copy link
Contributor

What can I put in the "files to include" edit control to specify a base/root directory in the repo AND a file name extension? I want to search all *.dtsx files under the ./SSIS directory.

Does SSIS/**/*.dtsx work for you?

The "index" was several MiB. How different is that from cloning the repo?

What we download for the search index is the git archive of the repo for the current commit (a regular git clone would
by default download your entire git commit history). This isn't necessary for just displaying the filetree, but for search it's valuable for working around some limitations of the current GitHub search API. Note also that GitHub Repositories supports searching/editing repos even in environments where git isn't available, e.g. browsers on mobile devices (via github.dev and vscode.dev).

One of the files has an icon to the left of its name that is orange and looks like a WiFi symbol

I'm not sure what this is, but if you see it again feel free to share a screenshot.

@Liturgist
Copy link
Author

@joyceerhl, yes, SSIS/**/*.dtsx works. 26 files found. Thanks.

Code must not be using the GitHub search. I find that it will not identify patterns which are past column 1024.
https://github.com/orgs/community/discussions/52114

The icon is:
image

@joyceerhl
Copy link
Contributor

I think that icon is just the icon for XML files in the Seti font (which is the default in VS Code).

Code must not be using the GitHub search. I find that it will not identify patterns which are past column 1024.

To clarify, do you mean that GitHub search doesn't find patterns past column 1024, or search in VS Code doesn't find patterns past column 1024? VS Code indexes the downloaded archive for search rather than using GitHub's search APIs directly in order to provide accurate search results.

@Liturgist
Copy link
Author

The icon changes to be like the four-line icon above and below it. These are all .xml files.

GitHub search does not identify a pattern past 1024 characters. VS Code does. It identified all 26 files, just like Select-String.

@joyceerhl
Copy link
Contributor

Thanks for clarifying. For the icon related issue, would you mind filing a bug at https://github.com/microsoft/vscode/issues and including a screen recording of what you are seeing there? If there is a bug with file icons I don't believe it would be specific to Remote Repositories.

I'm going to close this issue out since it sounds like searching GitHub repositories with this extension is working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants