mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
refactor: remove features beyond the UX plan
Drop additions that the UX plan does not ask for: - the interactive label edit form; label edit now requires a flag - label clone and the skip mode of label creation it needed - repo rename rewriting the Git remote or tea.repository; it now warns that the remote still points to the old name - the extra "source" remote on clones of pull mirrors - run artifact download, which duplicates run download --zip - 256-color and 24-bit label swatches; colors stay ANSI 16 - config list --show-source (config get keeps it) - the membership and access GETs before team member/repo add and remove; Gitea's PUT and DELETE are idempotent label edit/delete keep --by-name: it is the only way to address a label whose name is a number that is also another label's ID. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
22 files changed
+69
-560
No files matched your search
@@ -59,14 +59,6 @@ func (s Actions) AllArtifacts(ctx context.Context, run int64) ([]Artifact, error
|
||||
return nil, fmt.Errorf("listing exceeded %d pages", maxListPages)
|
||||
}
|
||||
|
||||
// Artifact retrieves one artifact.
|
||||
func (s Actions) Artifact(ctx context.Context, id int64) (Artifact, error) {
|
||||
artifact, err := repoConvert(ctx, s.Client, s.Repository, artifactFrom, func(ctx context.Context, c *gitea.Client, owner, repo string) (*gitea.ActionsArtifact, *gitea.Response, error) {
|
||||
return c.Actions.GetRepoArtifact(ctx, owner, repo, id)
|
||||
})
|
||||
return artifact, Classify(err, "artifact", strconv.FormatInt(id, 10), s.Repository)
|
||||
}
|
||||
|
||||
// DownloadArtifact streams an artifact ZIP, accepting a scoped signed redirect.
|
||||
func (s Actions) DownloadArtifact(ctx context.Context, id int64) (io.ReadCloser, error) {
|
||||
endpoint, err := s.Client.URL(fmt.Sprintf("%sartifacts/%d/zip", s.endpoint(), id))
|
||||
|
||||
@@ -282,17 +282,6 @@ func (s Teams) Members(ctx context.Context, id int64, limit, page int) (Page[Org
|
||||
return convertPage(users, memberFrom), err
|
||||
}
|
||||
|
||||
// IsMember reports whether username belongs to the team.
|
||||
func (s Teams) IsMember(ctx context.Context, id int64, username string) (bool, error) {
|
||||
_, _, err := call(ctx, s.Client, func(ctx context.Context, c *gitea.Client) (*gitea.User, *gitea.Response, error) {
|
||||
return c.Organizations.GetTeamMember(ctx, id, username)
|
||||
})
|
||||
if statusNotFound(err) {
|
||||
return false, nil
|
||||
}
|
||||
return err == nil, err
|
||||
}
|
||||
|
||||
// SetMember adds or removes one team membership.
|
||||
func (s Teams) SetMember(ctx context.Context, id int64, username string, add bool) error {
|
||||
err := do(ctx, s.Client, func(ctx context.Context, c *gitea.Client) (*gitea.Response, error) {
|
||||
@@ -315,17 +304,6 @@ func (s Teams) Repositories(ctx context.Context, id int64, limit, page int) (Pag
|
||||
return convertPage(repos, repositoryFrom), err
|
||||
}
|
||||
|
||||
// HasRepository reports whether the team has access to the owner/name repository.
|
||||
func (s Teams) HasRepository(ctx context.Context, id int64, repository string) (bool, error) {
|
||||
_, err := repoCall(ctx, s.Client, repository, func(ctx context.Context, c *gitea.Client, owner, name string) (*gitea.Repository, *gitea.Response, error) {
|
||||
return c.Organizations.GetTeamRepository(ctx, id, owner, name)
|
||||
})
|
||||
if statusNotFound(err) {
|
||||
return false, nil
|
||||
}
|
||||
return err == nil, err
|
||||
}
|
||||
|
||||
// SetRepository adds or removes team access to a repository.
|
||||
func (s Teams) SetRepository(ctx context.Context, id int64, repository string, add bool) error {
|
||||
err := repoDo(ctx, s.Client, repository, func(ctx context.Context, c *gitea.Client, owner, name string) (*gitea.Response, error) {
|
||||
|
||||
Reference in new issue
Block a user