Skip to content

Why not return topics in Repository? #31100

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

Closed
Gitttttttt opened this issue May 27, 2024 · 5 comments
Closed

Why not return topics in Repository? #31100

Gitttttttt opened this issue May 27, 2024 · 5 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Milestone

Comments

@Gitttttttt
Copy link

Feature Description

I want to display the corresponding topic information in the repository list on the homepage, but the repository infomation does not contain topics information.

I must loop to obtain the corresponding topics after obtaining the repository list. This is very time-consuming. Can you return the corresponding topic list while querying the repository? Because the topics and the repository are actually in one table

Screenshots

No response

@Gitttttttt Gitttttttt added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label May 27, 2024
@lunny
Copy link
Member

lunny commented May 27, 2024

They are not on the same table. Did you mean API? If that, which API did you mean?

@Gitttttttt
Copy link
Author

Gitttttttt commented May 28, 2024

@lunny But I see that they are indeed in the same table:

image

So I think it is reasonable to return repositories with the topics while searching repositories or getting a repository, such as GET /repos/{owner}/{repo} and GET /repos/search

And the type Repository dose not have a topics attribute

type Repository struct {
ID int64 json:"id"
Owner *User json:"owner"
Name string json:"name"
FullName string json:"full_name"
Description string json:"description"
Empty bool json:"empty"
Private bool json:"private"
Fork bool json:"fork"
Template bool json:"template"
Parent *Repository json:"parent"
Mirror bool json:"mirror"
Size int json:"size"
HTMLURL string json:"html_url"
SSHURL string json:"ssh_url"
CloneURL string json:"clone_url"
OriginalURL string json:"original_url"
Website string json:"website"
Stars int json:"stars_count"
Forks int json:"forks_count"
Watchers int json:"watchers_count"
OpenIssues int json:"open_issues_count"
OpenPulls int json:"open_pr_counter"
Releases int json:"release_counter"
DefaultBranch string json:"default_branch"
Archived bool json:"archived"
Created time.Time json:"created_at"
Updated time.Time json:"updated_at"
Permissions *Permission json:"permissions,omitempty"
HasIssues bool json:"has_issues"
InternalTracker *InternalTracker json:"internal_tracker,omitempty"
ExternalTracker *ExternalTracker json:"external_tracker,omitempty"
HasWiki bool json:"has_wiki"
ExternalWiki *ExternalWiki json:"external_wiki,omitempty"
HasPullRequests bool json:"has_pull_requests"
HasProjects bool json:"has_projects"
HasReleases bool json:"has_releases,omitempty"
HasPackages bool json:"has_packages,omitempty"
HasActions bool json:"has_actions,omitempty"
IgnoreWhitespaceConflicts bool json:"ignore_whitespace_conflicts"
AllowMerge bool json:"allow_merge_commits"
AllowRebase bool json:"allow_rebase"
AllowRebaseMerge bool json:"allow_rebase_explicit"
AllowSquash bool json:"allow_squash_merge"
AvatarURL string json:"avatar_url"
Internal bool json:"internal"
MirrorInterval string json:"mirror_interval"
MirrorUpdated time.Time json:"mirror_updated,omitempty"
DefaultMergeStyle MergeStyle json:"default_merge_style"
}

@lunny
Copy link
Member

lunny commented May 28, 2024

Ah, right. I forgot there is a cache column.

@Gitttttttt
Copy link
Author

Gitttttttt commented May 28, 2024

Ah, right. I forgot there is a cache column.

@lunny So can you carry the topics field in the return results of the repository list? If you do this, Things will become very simple. Thanks very much

@lunny lunny added this to the 1.23.0 milestone May 28, 2024
lunny added a commit that referenced this issue May 28, 2024
@lunny
Copy link
Member

lunny commented May 30, 2024

Resovled by #31127

@lunny lunny closed this as completed May 30, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants