Does Gogs support filtering repositories by type? Getting the answer from source code.

Updates and open questions about problems Harlan is working to solve and tools he is working with.
harlanji
Posts: 13
Joined: Mon Jul 24, 2023 6:44 pm

Does Gogs support filtering repositories by type? Getting the answer from source code.

Post by harlanji »

The best way to get an answer to a question about software is to read the source code.

I am populating my Git server with repos, both original and mirrors. I'm using Gogs which clones GitHub that allows filtering repositories by type in the way I desire.

I try adding ?type=source to my query string, no luck. I try adding /source to the URL and no luck.

Gogs is written in Go which I used a long time ago. Still, I ventured to the source repo and started looking around. Nothing looked like a web app source directory so I clicked internal, success. I looked at the profile page and found a distinctive string to search for, "ui repository list." I found it used in a template, "repo_list." I searched for "repo_list" and found it used in "templates/user/profile.tmpl," noticing the syntax of how a template is included. I searched for "user/profile" and found "internal/route/user/profile.go" with a function for Profile. I clicked into it and found 'c.Query("tab")' and looked around the route's code and don't see anything to do with repo types.

So unless there's some magic happening like an aspect, there's no way to filter repositories by type.

Source code, the best documentation.