gitee

package
v0.45.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package gitee implements the Gitee Provider for the git-platform-sdk.

The backend builds on the community go-gitee SDK (gitee.com/openeuler/go-gitee) and wires the SDK's http.Client through the unified transport pipeline (auth, retry, hooks, logging) so SDK-issued requests behave like every other backend's traffic. A handful of endpoints are not usable through the SDK — either missing entirely (e.g. DELETE /repos/{owner}/{repo}/branches/{branch}), generated with a broken signature (the user-repos list methods decode into a single Project instead of an array; the commit, compare, contents, and release models type live objects/arrays/booleans as plain strings, as does the webhook Hook model whose list decode is then silently swallowed; the tags method returns a single Tag for an array endpoint; the labels list opts carry no pagination; the labels patch, releases create, webhook create, and issue create methods post multipart bodies labeled application/json) — and keep using the retained transport.Client via Provider.raw(). Each such detour is registered in a doc comment on the method that takes it. All Provider methods are split across the per-responsibility files in this package:

  • gitee.go: constructor + identity (Platform, TestConnection, Capabilities)
  • init.go: provider registration with the global registry
  • methods.go: doRequest JSON helper + esc/escPath path escaping (raw client)
  • repos.go: ListRepos, GetRepo, CreateRepo, DeleteRepo, UpdateRepo, ForkRepo
  • crs.go: Change requests (PRs): Create/Get/List/Merge/Close/Reopen/Update/UpdateLabels/Comments/Commits
  • webhooks.go: webhook CRUD + signature validation + event parsing
  • branches.go: ListBranches, CreateBranch, DeleteBranch
  • diffs.go: GetCRDiff, GetCRFiles, CreateNote/DeleteNote, CreateDiscussion
  • commits.go: GetCommit, ListCommits, CompareCommits
  • files.go: GetFileContent, CreateFile, UpdateFile, DeleteFile
  • releases.go: ListTags, ListReleases, CreateRelease, GetArchive
  • labels.go: repository label CRUD (LabelManager)
  • issues.go: issue CRUD, comments, and issue labels (IssueManager)
  • milestones.go: repository milestone CRUD (MilestoneManager)
  • search.go: global repo/issue/user search (SearchManager)
  • types.go: SDK model conversions and raw-wire types/helpers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Divergences added in v0.45.0

func Divergences() []provider.Divergence

Divergences returns the registered divergence ledger for the Gitee backend.

func New

New builds a Gitee Provider from the given config.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is the Gitee implementation of provider.Provider. It embeds the go-gitee SDK client plus an auxiliary transport.Client used for endpoints the SDK does not cover (or covers with a broken generated signature).

func (*Provider) AddIssueLabels added in v0.39.0

func (p *Provider) AddIssueLabels(ctx context.Context, owner, repo, number string, labels []string) error

AddIssueLabels implements provider.IssueManager via the SDK: the generated call posts the bare label-name array as its JSON body (an upstream patch on PullRequestLabelPostParam — the same wire shape as the PR-labels calls in crs.go). That patch drops the param's AccessToken from the wire; the call stays authenticated through the transport pipeline's Bearer header.

func (*Provider) Capabilities added in v0.38.0

func (p *Provider) Capabilities() provider.CapabilitySet

Capabilities implements provider.Provider. Gitee implements the optional LabelManager (see labels.go), IssueManager (see issues.go), and SearchManager (see search.go) interfaces. Gitee issue numbers are alphanumeric strings (e.g. "IAINVA"), addressed natively by the string-typed IssueManager.

func (*Provider) CloseCR

func (p *Provider) CloseCR(ctx context.Context, owner, repo, number string) (*provider.ChangeRequest, error)

CloseCR implements provider.ChangeRequestManager.

func (*Provider) CloseIssue added in v0.39.0

func (p *Provider) CloseIssue(ctx context.Context, owner, repo, number string) (*provider.Issue, error)

CloseIssue implements provider.IssueManager.

func (*Provider) CompareCommits

func (p *Provider) CompareCommits(ctx context.Context, owner, repo, base, head string) (*provider.CompareResult, error)

CompareCommits implements provider.CommitManager.

Routed through the raw transport client rather than the SDK: the SDK's Compare model types the live payload's commits/files arrays as plain strings (upstream swagger generation bug), so GetV5ReposOwnerRepoCompareBaseHead fails to decode every real response. The file objects decode into giteeCompareFile (types.go), which mirrors the compare endpoint's wire shape (numeric stats, string patch).

func (*Provider) CreateBranch

func (p *Provider) CreateBranch(ctx context.Context, owner, repo, branch, ref string) (*provider.PlatformBranch, error)

CreateBranch implements provider.BranchManager.

func (*Provider) CreateCR

CreateCR implements provider.ChangeRequestManager.

func (*Provider) CreateDiscussion

func (p *Provider) CreateDiscussion(ctx context.Context, owner, repo, number string, opts provider.DiscussionOptions) (string, error)

CreateDiscussion implements provider.DiffManager.

Gitee has no separate discussion endpoint; PR comments are the only option. We post the body as a regular PR comment.

func (*Provider) CreateFile

func (p *Provider) CreateFile(ctx context.Context, owner, repo string, opts provider.FileOptions) (*provider.FileResult, error)

CreateFile implements provider.FileManager.

Routed through the raw transport client rather than the SDK: the generated NewFileParam marshals bracketed JSON keys ("author[name]", "committer[email]") the live API does not accept — the endpoint takes the flat author_name/author_email vocabulary sent here — and the response's CommitContent model re-types "size"/"_links" as strings while its Commit model lacks the wire's "sha" key, so the decoded FileResult would lose both SHAs even when decoding succeeded.

func (*Provider) CreateIssue added in v0.39.0

func (p *Provider) CreateIssue(ctx context.Context, opts provider.CreateIssueOptions) (*provider.Issue, error)

CreateIssue implements provider.IssueManager.

Routed through the raw transport client rather than the SDK: the generated PostV5ReposOwnerIssues encodes its opts as a multipart body while sending an application/json Content-Type header (upstream client.go prepareRequest bug — same family as the labels patch and releases create detours), which the server cannot parse. The raw call uses the documented owner-scoped POST /repos/{owner}/issues endpoint with the repo path in the body, and Gitee's own parameter vocabulary (assignees join onto the single "assignee" param, labels are comma-joined, milestone carries the milestone serial number).

func (*Provider) CreateIssueComment added in v0.39.0

func (p *Provider) CreateIssueComment(ctx context.Context, owner, repo, number, body string) (*provider.IssueComment, error)

CreateIssueComment implements provider.IssueManager via the SDK: the body param marshals as JSON ({"access_token": ..., "body": ...}).

func (*Provider) CreateLabel added in v0.38.0

func (p *Provider) CreateLabel(ctx context.Context, owner, repo string, opts provider.CreateLabelOptions) (*provider.Label, error)

CreateLabel implements provider.LabelManager via the SDK (PostV5ReposOwnerRepoLabels posts a JSON body). Registration: Gitee's live label object carries no description (id/color/name/repository_id/url only), so CreateLabelOptions.Description is a no-op on this platform and provider.Label.Description stays empty.

func (*Provider) CreateMilestone added in v0.40.0

func (p *Provider) CreateMilestone(ctx context.Context, owner, repo string, opts provider.CreateMilestoneOptions) (*provider.Milestone, error)

CreateMilestone implements provider.MilestoneManager through the raw transport client (SDK multipart bug — see the file comment).

func (*Provider) CreateNote

func (p *Provider) CreateNote(ctx context.Context, owner, repo, number, body string) (string, error)

CreateNote implements provider.DiffManager.

func (*Provider) CreateRelease

func (p *Provider) CreateRelease(ctx context.Context, owner, repo string, opts provider.CreateReleaseOptions) (*provider.ReleaseInfo, error)

CreateRelease implements provider.ReleaseManager.

Routed through the raw transport client rather than the SDK: the generated PostV5ReposOwnerRepoReleases posts its parameters as a multipart body labeled application/json (upstream client.go bug) and offers no draft parameter, and its response decodes into the mis-typed Release model (see ListReleases).

func (*Provider) CreateRepo

func (p *Provider) CreateRepo(ctx context.Context, owner string, opts provider.CreateRepoOptions) (*provider.PlatformRepo, error)

CreateRepo implements provider.RepoManager.

Routed through the raw transport client rather than the SDK: the SDK's RepositoryPostParam has no default_branch field, and this surface keeps forwarding it. The response is still decoded into the SDK's Project model so the conversion layer stays in one place.

func (*Provider) CreateWebhook

CreateWebhook implements provider.WebhookManager.

Routed through the raw transport client rather than the SDK: the generated PostV5ReposOwnerRepoHooks encodes its opts as a multipart body while sending an application/json Content-Type header (upstream client.go prepareRequest bug — same family as the labels patch and releases create detours), which the server cannot parse. The raw body sticks to Gitee's documented vocabulary: the signing secret travels as "password" (the key Gitee HMACs into X-Gitee-Token) and event selections map onto Gitee's *_events booleans (push + pull_request when the caller passes none).

func (*Provider) DeleteBranch

func (p *Provider) DeleteBranch(ctx context.Context, owner, repo, branch string) error

DeleteBranch implements provider.BranchManager.

Routed through the raw transport client: go-gitee ships no DeleteV5ReposOwnerRepoBranches method (only branch-protection variants), so this endpoint is registered as SDK-missing and stays on the raw client.

func (*Provider) DeleteFile

func (p *Provider) DeleteFile(ctx context.Context, owner, repo string, opts provider.FileDeleteOptions) (*provider.FileResult, error)

DeleteFile implements provider.FileManager.

Routed through the raw transport client rather than the SDK: the generated DeleteV5ReposOwnerRepoContentsPath turns sha/message/branch/author into URL query parameters — the REST contract puts them in the JSON body — and shares the broken CommitContent response model.

func (*Provider) DeleteLabel added in v0.38.0

func (p *Provider) DeleteLabel(ctx context.Context, owner, repo, name string) error

DeleteLabel implements provider.LabelManager via the SDK.

func (*Provider) DeleteMilestone added in v0.40.0

func (p *Provider) DeleteMilestone(ctx context.Context, owner, repo, number string) error

DeleteMilestone implements provider.MilestoneManager via the SDK (the generated DELETE carries no body).

func (*Provider) DeleteNote

func (p *Provider) DeleteNote(ctx context.Context, owner, repo, number, noteID string) error

DeleteNote implements provider.DiffManager. The note itself is addressed by its numeric platform ID; the change-request number is only validated, as Gitee's delete-comment endpoint does not take it.

func (*Provider) DeleteRelease added in v0.40.0

func (p *Provider) DeleteRelease(ctx context.Context, owner, repo, tag string) error

DeleteRelease implements provider.ReleaseManager.

Routed through the raw transport client rather than the SDK, for the same multipart/mis-typed-model reasons as UpdateRelease. The delete endpoint is id-addressed, so the tag is resolved through the by-tag endpoint first. The release's tag is kept.

func (*Provider) DeleteRepo

func (p *Provider) DeleteRepo(ctx context.Context, owner, repo string) error

DeleteRepo implements provider.RepoManager.

func (*Provider) DeleteWebhook

func (p *Provider) DeleteWebhook(ctx context.Context, owner, repo string, webhookID int64) error

DeleteWebhook implements provider.WebhookManager via the SDK: the delete call passes the token as a query param and has no response body to decode.

func (*Provider) Divergences added in v0.45.0

func (p *Provider) Divergences() []provider.Divergence

Divergences implements provider.Provider.

func (*Provider) ForkRepo

func (p *Provider) ForkRepo(ctx context.Context, owner, repo string, opts provider.ForkRepoOptions) (*provider.PlatformRepo, error)

ForkRepo implements provider.RepoManager.

func (*Provider) GetArchive

func (p *Provider) GetArchive(ctx context.Context, owner, repo, ref, format string) ([]byte, error)

GetArchive implements provider.ReleaseManager.

Routed through the raw transport client (registered detour): the go-gitee SDK exposes no archive-download endpoint, so the GitHub-shaped zipball/tarball URLs are fetched directly.

func (*Provider) GetCR

func (p *Provider) GetCR(ctx context.Context, owner, repo, number string) (*provider.ChangeRequest, error)

GetCR implements provider.ChangeRequestManager.

func (*Provider) GetCRDiff

func (p *Provider) GetCRDiff(ctx context.Context, owner, repo, number string) (*provider.MergeDiff, error)

GetCRDiff implements provider.DiffManager.

func (*Provider) GetCRFiles

func (p *Provider) GetCRFiles(ctx context.Context, owner, repo, number string) ([]*provider.ChangedFile, error)

GetCRFiles implements provider.DiffManager.

func (*Provider) GetCommit

func (p *Provider) GetCommit(ctx context.Context, owner, repo, sha string) (*provider.CommitInfo, error)

GetCommit implements provider.CommitManager.

Routed through the raw transport client rather than the SDK: the SDK's RepoCommit model types the live payload's author/committer/stats objects as plain strings (upstream swagger generation bug), so GetV5ReposOwnerRepoCommitsSha fails to decode every real response. The response is still decoded with a wire-accurate local type (giteeCommitDetail in types.go).

func (*Provider) GetFileContent

func (p *Provider) GetFileContent(ctx context.Context, owner, repo, path, ref string) (string, error)

GetFileContent implements provider.FileManager.

Routed through the raw transport client rather than the SDK: the SDK's Content model types the live payload's numeric "size" and object "_links" fields as plain strings (upstream swagger generation bug — verified against the live v5 contents payload), so GetV5ReposOwnerRepoContentsPath fails to decode every real file response. The returned string is the raw payload "content" field (base64), matching the pre-SDK behaviour.

func (*Provider) GetIssue added in v0.39.0

func (p *Provider) GetIssue(ctx context.Context, owner, repo, number string) (*provider.Issue, error)

GetIssue implements provider.IssueManager via the SDK. Gitee addresses issues by their alphanumeric string number directly — the SDK parameter is a string, so no conversion is needed.

func (*Provider) GetMilestone added in v0.40.0

func (p *Provider) GetMilestone(ctx context.Context, owner, repo, number string) (*provider.Milestone, error)

GetMilestone implements provider.MilestoneManager via the SDK.

func (*Provider) GetReleaseByTag added in v0.40.0

func (p *Provider) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*provider.ReleaseInfo, error)

GetReleaseByTag implements provider.ReleaseManager.

Routed through the raw transport client rather than the SDK: the generated GetV5ReposOwnerRepoReleasesTagsTag decodes into the mis-typed Release model (see ListReleases), and the tag-addressed endpoint is outside the SDK's release surface anyway.

func (*Provider) GetRepo

func (p *Provider) GetRepo(ctx context.Context, owner, repo string) (*provider.PlatformRepo, error)

GetRepo implements provider.RepoManager.

func (*Provider) ListBranches

func (p *Provider) ListBranches(ctx context.Context, owner, repo string) ([]*provider.PlatformBranch, error)

ListBranches implements provider.BranchManager.

Note: the SDK's GetV5ReposOwnerRepoBranchesOpts carries only AccessToken (no Page/PerPage), so the previous explicit page=1&per_page=20 query parameters are no longer sent; Gitee applies the same defaults server-side.

func (*Provider) ListCRComments

func (p *Provider) ListCRComments(ctx context.Context, owner, repo, number string) ([]*provider.CRComment, error)

ListCRComments implements provider.ChangeRequestManager.

func (*Provider) ListCRCommits

func (p *Provider) ListCRCommits(ctx context.Context, owner, repo, number string) ([]*provider.CRCommit, error)

ListCRCommits implements provider.ChangeRequestManager.

Note: the SDK's GetV5ReposOwnerRepoPullsNumberCommitsOpts carries only AccessToken (no Page/PerPage), so the previous explicit page=1&per_page=20 query parameters are no longer sent; Gitee applies the same defaults server-side.

func (*Provider) ListCRs

ListCRs implements provider.ChangeRequestManager.

func (*Provider) ListCommits

func (p *Provider) ListCommits(ctx context.Context, owner, repo string, opts provider.ListCommitsOptions) ([]*provider.CommitInfo, error)

ListCommits implements provider.CommitManager.

Routed through the raw transport client rather than the SDK for the same reason as GetCommit (RepoCommit model bug). Branch/since/until map to the endpoint's sha/since/until query parameters, matching Gitee's REST contract.

func (*Provider) ListIssueComments added in v0.39.0

func (p *Provider) ListIssueComments(ctx context.Context, owner, repo, number string) ([]*provider.IssueComment, error)

ListIssueComments implements provider.IssueManager via the SDK.

Registration: the SDK's Note model carries no updated_at field (the live wire does), so IssueComment.UpdatedAt stays zero on Gitee until the SDK model catches up; created_at parses from the wire's timestamp string.

func (*Provider) ListIssueLabels added in v0.39.0

func (p *Provider) ListIssueLabels(ctx context.Context, owner, repo string) ([]*provider.IssueLabel, error)

ListIssueLabels implements provider.IssueManager: repository-level labels via the SDK. The interface takes no pagination, so the SDK's AccessToken-only opts lose nothing (unlike LabelManager.ListLabels, whose pagination contract forces its raw detour in labels.go).

func (*Provider) ListIssues added in v0.39.0

func (p *Provider) ListIssues(ctx context.Context, opts provider.ListIssuesOptions) ([]*provider.Issue, int, error)

ListIssues implements provider.IssueManager via the SDK. State, labels, and assignee filters travel as query params alongside the normalized pagination.

func (*Provider) ListLabels added in v0.38.0

func (p *Provider) ListLabels(ctx context.Context, owner, repo string, opts provider.ListLabelsOptions) ([]*provider.Label, error)

ListLabels implements provider.LabelManager. Gitee addresses labels by name natively.

Routed through the raw transport client rather than the SDK: the SDK's GetV5ReposOwnerRepoLabelsOpts exposes only AccessToken — no Page/PerPage — so the generated call would silently drop the pagination Gitee's list endpoint accepts and the provider contract asserts on the wire. The response still decodes into the SDK's gitee.Label model (a subset of the live wire shape; extra wire fields are ignored).

func (*Provider) ListMilestones added in v0.40.0

func (p *Provider) ListMilestones(ctx context.Context, owner, repo string, opts provider.ListMilestonesOptions) ([]provider.Milestone, error)

ListMilestones implements provider.MilestoneManager via the SDK (the generated GET carries its filters as query params, which the server reads fine). State filters by "open"/"closed" (Gitee also accepts "all"); Gitee defaults to open.

func (*Provider) ListReleases

func (p *Provider) ListReleases(ctx context.Context, owner, repo string) ([]*provider.ReleaseInfo, error)

ListReleases implements provider.ReleaseManager.

Routed through the raw transport client rather than the SDK: the SDK's Release model types the live payload's boolean "prerelease" and object "author" as plain strings (upstream swagger generation bug — verified against the live v5 releases payload), so GetV5ReposOwnerRepoReleases fails to decode every real response. The model also lacks the draft/published_at/html_url fields ReleaseInfo surfaces.

func (*Provider) ListRepos

ListRepos implements provider.RepoManager.

Routed through the raw transport client rather than the SDK: go-gitee's GetV5UserRepos/GetV5UsersUsernameRepos are generated with a single-Project return type and cannot decode the array this endpoint actually returns. The response is still decoded into the SDK's Project model so the conversion layer stays in one place.

func (*Provider) ListTags

func (p *Provider) ListTags(ctx context.Context, owner, repo string) ([]*provider.TagInfo, error)

ListTags implements provider.ReleaseManager.

Routed through the raw transport client rather than the SDK: the SDK's GetV5ReposOwnerRepoTags returns a single Tag whose Commit is a plain string, while the live wire is an array of objects with a nested commit{sha} (verified against the live v5 tags payload) — the generated call cannot decode the response at all.

func (*Provider) ListWebhooks

func (p *Provider) ListWebhooks(ctx context.Context, owner, repo string) ([]*provider.PlatformWebhook, error)

ListWebhooks implements provider.WebhookManager.

Routed through the raw transport client rather than the SDK: the SDK's Hook model types the live wire's numeric id and boolean *_events fields as strings, and the generated list call silently swallows the resulting decode error (its success path only returns early when decoding succeeds), so an SDK-backed list would report an empty result for every populated repo. The raw decode keeps the live wire shape (numeric id, url, events array).

func (*Provider) MergeCR

func (p *Provider) MergeCR(ctx context.Context, owner, repo, number string, opts provider.MergeCROptions) (*provider.ChangeRequest, error)

MergeCR implements provider.ChangeRequestManager.

The SDK's PutV5ReposOwnerRepoPullsNumberMerge returns no decoded body (the live endpoint responds with the merged PR, but the generated method drops it), so the merged change request is re-fetched via GetV5ReposOwnerRepoPullsNumber right after a successful merge.

func (*Provider) ParseWebhookEvent

func (p *Provider) ParseWebhookEvent(r *http.Request, secret string) (*provider.NormalizedEvent, error)

ParseWebhookEvent implements provider.WebhookManager.

func (*Provider) Platform

func (p *Provider) Platform() provider.Platform

Platform implements provider.Provider.

func (*Provider) RemoveIssueLabel added in v0.39.0

func (p *Provider) RemoveIssueLabel(ctx context.Context, owner, repo, number, name string) error

RemoveIssueLabel implements provider.IssueManager via the SDK (the name-addressed delete passes the token as a query param).

func (*Provider) ReopenCR

func (p *Provider) ReopenCR(ctx context.Context, owner, repo, number string) (*provider.ChangeRequest, error)

ReopenCR implements provider.ChangeRequestManager.

func (*Provider) ReopenIssue added in v0.39.0

func (p *Provider) ReopenIssue(ctx context.Context, owner, repo, number string) (*provider.Issue, error)

ReopenIssue implements provider.IssueManager.

func (*Provider) SearchIssues added in v0.40.0

SearchIssues implements provider.SearchManager. Gitee issue numbers are alphanumeric strings on the wire and carry through as-is.

func (*Provider) SearchRepos added in v0.40.0

SearchRepos implements provider.SearchManager.

func (*Provider) SearchUsers added in v0.40.0

SearchUsers implements provider.SearchManager.

func (*Provider) TestConnection

func (p *Provider) TestConnection(ctx context.Context) (*provider.TestConnectionResult, error)

TestConnection implements provider.Provider.

func (*Provider) UpdateCR

func (p *Provider) UpdateCR(ctx context.Context, owner, repo, number string, opts provider.UpdateCROptions) (*provider.ChangeRequest, error)

UpdateCR implements provider.ChangeRequestManager.

Registration: UpdateCROptions.TargetBranch has no Gitee counterpart — the SDK's PullRequestUpdateParam (mirroring Gitee's PATCH /pulls/{number}) carries no base/target-branch field, so retargeting a PR is not supported by the API and the option is not forwarded.

func (*Provider) UpdateCRLabels

func (p *Provider) UpdateCRLabels(ctx context.Context, owner, repo, number string, labels []string) error

UpdateCRLabels implements provider.ChangeRequestManager.

func (*Provider) UpdateFile

func (p *Provider) UpdateFile(ctx context.Context, owner, repo string, opts provider.FileOptions) (*provider.FileResult, error)

UpdateFile implements provider.FileManager.

Routed through the raw transport client rather than the SDK: besides the CommitContent response-model defects (see CreateFile), the generated PutV5ReposOwnerRepoContentsPath sends its author/committer options as a multipart body labeled application/json (upstream client.go bug), which the server cannot parse.

func (*Provider) UpdateIssue added in v0.39.0

func (p *Provider) UpdateIssue(ctx context.Context, owner, repo, number string, opts provider.UpdateIssueOptions) (*provider.Issue, error)

UpdateIssue implements provider.IssueManager via the SDK. The update endpoint is owner-scoped (PATCH /repos/{owner}/issues/{number}), so the repo path travels in the JSON body via the SDK's IssueUpdateParam; empty fields drop out of the wire body (omitempty), leaving the issue unchanged. Milestone carries Gitee's milestone serial number, the identifier round tripped by MilestoneRef below; assignees join onto the single "assignee" param.

func (*Provider) UpdateLabel added in v0.38.0

func (p *Provider) UpdateLabel(ctx context.Context, owner, repo, name string, opts provider.UpdateLabelOptions) (*provider.Label, error)

UpdateLabel implements provider.LabelManager. Gitee addresses labels by name natively.

Routed through the raw transport client rather than the SDK: the generated PatchV5ReposOwnerRepoLabelsOriginalName encodes its opts as a multipart body while sending an application/json Content-Type header (upstream client.go prepareRequest bug — FormDataContentType is only set when a file part exists), which the server cannot parse. The raw JSON body keeps the documented wire shape. UpdateLabelOptions.Description is a no-op on the live API (Gitee labels have no description), matching CreateLabel.

func (*Provider) UpdateMilestone added in v0.40.0

func (p *Provider) UpdateMilestone(ctx context.Context, owner, repo, number string, opts provider.UpdateMilestoneOptions) (*provider.Milestone, error)

UpdateMilestone implements provider.MilestoneManager through the raw transport client (SDK multipart bug — see the file comment). Fields the caller left nil stay out of the JSON body, leaving the milestone unchanged.

func (*Provider) UpdateRelease added in v0.40.0

func (p *Provider) UpdateRelease(ctx context.Context, owner, repo, tag string, opts provider.UpdateReleaseOptions) (*provider.ReleaseInfo, error)

UpdateRelease implements provider.ReleaseManager.

Routed through the raw transport client rather than the SDK: the generated PatchV5ReposOwnerRepoReleasesId posts its parameters as a multipart body labeled application/json (the upstream client.go bug behind CreateRelease's detour) and decodes into the mis-typed Release model. The update endpoint is id-addressed, so the tag is resolved through the by-tag endpoint first (exact lookup, no list window); the PATCH body carries only the fields the caller set, so nil options leave the release untouched.

func (*Provider) UpdateRepo

func (p *Provider) UpdateRepo(ctx context.Context, owner, repo string, opts provider.UpdateRepoOptions) (*provider.PlatformRepo, error)

UpdateRepo implements provider.RepoManager.

func (*Provider) ValidateWebhookSignature

func (p *Provider) ValidateWebhookSignature(r *http.Request, secret string) error

ValidateWebhookSignature implements provider.WebhookManager.

Gitee uses HMAC-SHA256 over the body, sent in the X-Gitee-Token header.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL