From a379b31a1952eeecbfe0ee080a1ce5a178758d38 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Mon, 21 Oct 2024 22:18:29 +0200 Subject: [PATCH] refactor: dont use topics See https://git.coopcloud.tech/coop-cloud/organising/issues/377 See https://git.coopcloud.tech/coop-cloud/organising/issues/569 --- pkg/recipe/recipe.go | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/pkg/recipe/recipe.go b/pkg/recipe/recipe.go index 821d59df..7306a336 100644 --- a/pkg/recipe/recipe.go +++ b/pkg/recipe/recipe.go @@ -8,7 +8,6 @@ import ( "net/url" "os" "path" - "slices" "sort" "strconv" "strings" @@ -59,11 +58,6 @@ type RecipeMeta struct { Website string `json:"website"` } -// TopicMeta represents a list of topics for a repository. -type TopicMeta struct { - Topics []string `json:"topics"` -} - // LatestVersion returns the latest version of a recipe. func (r RecipeMeta) LatestVersion() string { var version string @@ -562,16 +556,7 @@ func ReadReposMetadata() (RepoCatalogue, error) { } for idx, repo := range reposList { - var topicMeta TopicMeta - - topicsURL := getReposTopicUrl(repo.Name) - if err := web.ReadJSON(topicsURL, &topicMeta); err != nil { - return reposMeta, err - } - - if slices.Contains(topicMeta.Topics, "recipe") && repo.Name != "example" { - reposMeta[repo.Name] = reposList[idx] - } + reposMeta[repo.Name] = reposList[idx] } pageIdx++ @@ -679,11 +664,6 @@ func UpdateRepositories(repos RepoCatalogue, recipeName string) error { return nil } -// getReposTopicUrl retrieves the repository specific topic listing. -func getReposTopicUrl(repoName string) string { - return fmt.Sprintf("https://git.coopcloud.tech/api/v1/repos/coop-cloud/%s/topics", repoName) -} - // ensurePathExists ensures that a path exists. func ensurePathExists(path string) error { if _, err := os.Stat(path); err != nil && os.IsNotExist(err) {