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

By default only main branch show up in search #120

Open
elettrico opened this issue Dec 10, 2024 · 2 comments
Open

By default only main branch show up in search #120

elettrico opened this issue Dec 10, 2024 · 2 comments
Labels
question Further information is requested

Comments

@elettrico
Copy link

elettrico commented Dec 10, 2024

After issue #117 I've corrected my config that looks like this:

{
    "$schema": "../schemas/v2/index.json",
    "repos": [
        {
            "type": "gitlab",
            "url": "https://gitlab.****.com",
            "token": "glpat-*****",
            "all": true,
            "revisions": {
                "branches": [
                    "main",
                    "dev"
                ]
            }
        }
    ]
}

now branches are indexed correctly, anyway:

  • every repository show 3 branches: HEAD, main and dev, where head is basically the same as main so what's the meaning?
  • doing a search only show results from main (or maybe head, there's no information about the branch)
  • if I want to search in dev, I have to specifically put "rev:dev" in the search bar

It not really the best way imho, because if I search for a something without specifying a branch filter I want to search in every branch and not only in the main, ie: I use the feature branching model so I have multiple branches for every proyect and I want to search in which branch a particular method is present.

It seems there's a way to search in all branches using "rev:" (with nothing after rev:) in the search bar, but it seems more like as a workaround to me.

Ah, and a side question: it is possible to change how often are the projects retrieved and the indices regenerated?

Thanks!

@brendan-kellam brendan-kellam added the question Further information is requested label Dec 11, 2024
@brendan-kellam
Copy link
Contributor

Glad branch indexing is working!

The current branch searching behaviour is by design. When you don't specify a branch filter, we default to searching in the default branch (HEAD) only. The hypothesis is that most of the time, people will want to search in HEAD, so we make it implicit. When they want to search a different branch, they can do so explicitly using the rev: prefix.

To achieve this, we will always index HEAD (regardless if branches are specified or not), so this is why you are seeing both HEAD and main.

Your use-case of "I want to find out what branches X exists in across all projects" is totally valid though, and necessitates the ability to search across all branches. The empty "rev:" does feel like a workaround... maybe we can change the syntax to rev:*, or add a button to "search all branches"... I will think on it a bit.

Currently the re-index and re-sync intervals are hardcoded here, but we could make them configurable. Is the current cadence not optimal for your use-case?

@elettrico
Copy link
Author

The button "search all branches" seems a very good option to me, very good idea.
About the re-index and re-sync intervals, actually they are ok for me, but I think it would be good to be able to configure them, especially because in the future I might need a more frequent frequency. and now that I think about it, it would be even better to be able to configure everything per group or per repository, for example having a general value but being able to say "for the repository of this group (or for these specific repositories) the interval is this".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants