Documentation ¶
Overview ¶
Package task implements tasks involved in making a Go release.
Index ¶
- Variables
- func AwaitCondition[T any](ctx *wf.TaskContext, period time.Duration, condition func() (T, bool, error)) (T, error)
- func ChangeLink(changeID string) string
- func CheckCoordinators(users []string) error
- func ConvertZIPToTGZ(r io.ReaderAt, size int64, w io.Writer) error
- func ExtractFile(tgz io.Reader, dest io.Writer, glob string) error
- func NewMastodonClient(config secret.MastodonCredentials) (realMastodonClient, error)
- func NewSendGridMailClient(sendgridAPIKey string) realSendGridMailClient
- func NewTestMastodonClient(config secret.MastodonCredentials, pmTarget string) (realMastodonClient, error)
- func NewTwitterClient(t secret.TwitterCredentials) realTwitterClient
- func ReadBinariesFromPKG(pkg io.Reader) (map[string][]byte, error)
- func ServeTarball(pathMatch string, files map[string]string, w http.ResponseWriter, ...)
- func TarToModFiles(target *releasetargets.Target, version string, t time.Time, tgz io.Reader, ...) (mod string, info string, _ error)
- func ToolchainModuleVersion(target *releasetargets.Target, version string) string
- func ToolchainZipPrefix(target *releasetargets.Target, version string) string
- type AnnounceMailTasks
- func (t AnnounceMailTasks) AnnounceRelease(ctx *workflow.TaskContext, kind ReleaseKind, published []Published, ...) (SentMail, error)
- func (t AnnounceMailTasks) AwaitAnnounceMail(ctx *workflow.TaskContext, m SentMail) (announcementURL string, _ error)
- func (t AnnounceMailTasks) PreAnnounceRelease(ctx *workflow.TaskContext, versions []string, target Date, security string, ...) (SentMail, error)
- type BuildBucketClient
- type BundleNSSRootsTask
- type CloudBuild
- type CloudBuildClient
- type CloudBuildOptions
- type CommunicationTasks
- type Date
- type FakeBinary
- type FakeBuildBucketClient
- func (c *FakeBuildBucketClient) Completed(ctx context.Context, id int64) (string, bool, error)
- func (c *FakeBuildBucketClient) ListBuilders(ctx context.Context, bucket string) (map[string]*pb.BuilderConfig, error)
- func (c *FakeBuildBucketClient) RunBuild(ctx context.Context, bucket string, builder string, commit *pb.GitilesCommit, ...) (int64, error)
- func (c *FakeBuildBucketClient) SearchBuilds(ctx context.Context, pred *pb.BuildPredicate) ([]int64, error)
- type FakeCloudBuild
- func (cb *FakeCloudBuild) Completed(ctx context.Context, build CloudBuild) (string, bool, error)
- func (c *FakeCloudBuild) ResultFS(ctx context.Context, build CloudBuild) (fs.FS, error)
- func (cb *FakeCloudBuild) RunBuildTrigger(ctx context.Context, project string, trigger string, ...) (CloudBuild, error)
- func (cb *FakeCloudBuild) RunCustomSteps(ctx context.Context, steps func(resultURL string) []*cloudbuildpb.BuildStep, ...) (CloudBuild, error)
- func (cb *FakeCloudBuild) RunScript(ctx context.Context, script string, gerritProject string, outputs []string) (CloudBuild, error)
- type FakeGerrit
- func (g *FakeGerrit) CreateAutoSubmitChange(_ *wf.TaskContext, input gerrit.ChangeInput, reviewers []string, ...) (string, error)
- func (g *FakeGerrit) CreateBranch(ctx context.Context, project, branch string, input gerrit.BranchInput) (string, error)
- func (g *FakeGerrit) GerritURL() string
- func (*FakeGerrit) GetChange(_ context.Context, _ string, _ ...gerrit.QueryChangesOpt) (*gerrit.ChangeInfo, error)
- func (g *FakeGerrit) GetCommitsInRefs(ctx context.Context, project string, commits, refs []string) (map[string][]string, error)
- func (g *FakeGerrit) GetTag(ctx context.Context, project string, tag string) (gerrit.TagInfo, error)
- func (g *FakeGerrit) GitilesURL() string
- func (g *FakeGerrit) ListBranches(ctx context.Context, project string) ([]gerrit.BranchInfo, error)
- func (g *FakeGerrit) ListProjects(ctx context.Context) ([]string, error)
- func (g *FakeGerrit) ListTags(ctx context.Context, project string) ([]string, error)
- func (*FakeGerrit) QueryChanges(_ context.Context, query string) ([]*gerrit.ChangeInfo, error)
- func (g *FakeGerrit) ReadBranchHead(ctx context.Context, project, branch string) (string, error)
- func (g *FakeGerrit) ReadFile(ctx context.Context, project string, commit string, file string) ([]byte, error)
- func (*FakeGerrit) SetHashtags(_ context.Context, changeID string, _ gerrit.HashtagsInput) error
- func (g *FakeGerrit) Submitted(ctx context.Context, changeID, baseCommit string) (string, bool, error)
- func (g *FakeGerrit) Tag(ctx context.Context, project, tag, commit string) error
- type FakeGitHub
- func (f *FakeGitHub) CreateIssue(ctx context.Context, owner string, repo string, request *github.IssueRequest) (*github.Issue, *github.Response, error)
- func (*FakeGitHub) CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, error)
- func (*FakeGitHub) EditIssue(_ context.Context, owner string, repo string, number int, ...) (*github.Issue, *github.Response, error)
- func (*FakeGitHub) EditMilestone(_ context.Context, owner string, repo string, number int, ...) (*github.Milestone, *github.Response, error)
- func (f *FakeGitHub) FetchMilestone(_ context.Context, owner, repo, name string, create bool) (int, error)
- func (f *FakeGitHub) FetchMilestoneIssues(_ context.Context, owner, repo string, milestoneID int) (map[int]map[string]bool, error)
- func (f *FakeGitHub) GetIssue(_ context.Context, owner string, repo string, number int) (*github.Issue, *github.Response, error)
- func (f *FakeGitHub) PostComment(_ context.Context, _ githubv4.ID, _ string) error
- func (*FakeGitHub) UploadReleaseAsset(ctx context.Context, owner, repo string, releaseID int64, fileName string, ...) (*github.ReleaseAsset, error)
- type FakeRepo
- func (repo *FakeRepo) Branch(branch, commit string)
- func (repo *FakeRepo) Commit(contents map[string]string) string
- func (repo *FakeRepo) CommitOnBranch(branch string, contents map[string]string) string
- func (repo *FakeRepo) History() []string
- func (repo *FakeRepo) ReadFile(commit, file string) ([]byte, error)
- func (repo *FakeRepo) Tag(tag, commit string)
- type FakeSignService
- func (s *FakeSignService) ArtifactSigningStatus(_ context.Context, jobID string) (_ sign.Status, desc string, out []string, _ error)
- func (s *FakeSignService) CancelSigning(_ context.Context, jobID string) error
- func (s *FakeSignService) SignArtifact(_ context.Context, bt sign.BuildType, in []string) (jobID string, _ error)
- type FakeSwarmingClient
- type GerritClient
- type Git
- type GitDir
- type GitHubClient
- func (c *GitHubClient) CreateIssue(ctx context.Context, owner string, repo string, issue *github.IssueRequest) (*github.Issue, *github.Response, error)
- func (c *GitHubClient) CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, error)
- func (c *GitHubClient) EditIssue(ctx context.Context, owner string, repo string, number int, ...) (*github.Issue, *github.Response, error)
- func (c *GitHubClient) EditMilestone(ctx context.Context, owner string, repo string, number int, ...) (*github.Milestone, *github.Response, error)
- func (c *GitHubClient) FetchMilestone(ctx context.Context, owner, repo, name string, create bool) (int, error)
- func (c *GitHubClient) FetchMilestoneIssues(ctx context.Context, owner, repo string, milestoneID int) (map[int]map[string]bool, error)
- func (c *GitHubClient) GetIssue(ctx context.Context, owner string, repo string, number int) (*github.Issue, *github.Response, error)
- func (c *GitHubClient) PostComment(ctx context.Context, id githubv4.ID, body string) error
- func (c *GitHubClient) UploadReleaseAsset(ctx context.Context, owner, repo string, releaseID int64, fileName string, ...) (*github.ReleaseAsset, error)
- type GitHubClientInterface
- type LogWriter
- type MailContent
- type MailHeader
- type MilestoneTasks
- func (m *MilestoneTasks) CheckBlockers(ctx *wf.TaskContext, milestones ReleaseMilestones, version string, ...) error
- func (m *MilestoneTasks) FetchMilestones(ctx *wf.TaskContext, currentVersion string, kind ReleaseKind) (ReleaseMilestones, error)
- func (m *MilestoneTasks) PingEarlyIssues(ctx *wf.TaskContext, develVersion int, openTreeURL string) (result struct{}, _ error)
- func (m *MilestoneTasks) PushIssues(ctx *wf.TaskContext, milestones ReleaseMilestones, version string, ...) error
- type Poster
- type PrivXPatch
- type PrivateMasterSyncTask
- type Published
- type RealBuildBucketClient
- func (c *RealBuildBucketClient) Completed(ctx context.Context, id int64) (string, bool, error)
- func (c *RealBuildBucketClient) ListBuilders(ctx context.Context, bucket string) (map[string]*pb.BuilderConfig, error)
- func (c *RealBuildBucketClient) RunBuild(ctx context.Context, bucket, builder string, commit *pb.GitilesCommit, ...) (int64, error)
- func (c *RealBuildBucketClient) SearchBuilds(ctx context.Context, pred *pb.BuildPredicate) ([]int64, error)
- type RealCloudBuildClient
- func (c *RealCloudBuildClient) Completed(ctx context.Context, build CloudBuild) (string, bool, error)
- func (c *RealCloudBuildClient) ResultFS(ctx context.Context, build CloudBuild) (fs.FS, error)
- func (c *RealCloudBuildClient) RunBuildTrigger(ctx context.Context, project, trigger string, substitutions map[string]string) (CloudBuild, error)
- func (c *RealCloudBuildClient) RunCustomSteps(ctx context.Context, steps func(resultURL string) []*cloudbuildpb.BuildStep, ...) (CloudBuild, error)
- func (c *RealCloudBuildClient) RunScript(ctx context.Context, script string, gerritProject string, outputs []string) (CloudBuild, error)
- type RealGerritClient
- func (c *RealGerritClient) CreateAutoSubmitChange(ctx *wf.TaskContext, input gerrit.ChangeInput, reviewers []string, ...) (_ string, err error)
- func (c *RealGerritClient) CreateBranch(ctx context.Context, project, branch string, input gerrit.BranchInput) (string, error)
- func (c *RealGerritClient) GetChange(ctx context.Context, changeID string, opts ...gerrit.QueryChangesOpt) (*gerrit.ChangeInfo, error)
- func (c *RealGerritClient) GetCommitsInRefs(ctx context.Context, project string, commits, refs []string) (map[string][]string, error)
- func (c *RealGerritClient) GetTag(ctx context.Context, project, tag string) (gerrit.TagInfo, error)
- func (c *RealGerritClient) GitilesURL() string
- func (c *RealGerritClient) ListBranches(ctx context.Context, project string) ([]gerrit.BranchInfo, error)
- func (c *RealGerritClient) ListProjects(ctx context.Context) ([]string, error)
- func (c *RealGerritClient) ListTags(ctx context.Context, project string) ([]string, error)
- func (c *RealGerritClient) QueryChanges(ctx context.Context, query string) ([]*gerrit.ChangeInfo, error)
- func (c *RealGerritClient) ReadBranchHead(ctx context.Context, project, branch string) (string, error)
- func (c *RealGerritClient) ReadFile(ctx context.Context, project, commit, file string) ([]byte, error)
- func (c *RealGerritClient) SetHashtags(ctx context.Context, changeID string, hashtags gerrit.HashtagsInput) error
- func (c *RealGerritClient) Submitted(ctx context.Context, changeID, parentCommit string) (string, bool, error)
- func (c *RealGerritClient) Tag(ctx context.Context, project, tag, commit string) error
- type RealSwarmingClient
- type ReleaseGoplsTasks
- type ReleaseKind
- type ReleaseMilestones
- type ReleaseVSCodeGoTasks
- type ScratchFS
- func (s *ScratchFS) OpenRead(ctx *wf.TaskContext, name string) (fs.File, error)
- func (s *ScratchFS) OpenWrite(ctx *wf.TaskContext, baseName string) (name string, _ gcsfs.WriterFile, _ error)
- func (s *ScratchFS) ReadFile(ctx *wf.TaskContext, name string) ([]byte, error)
- func (s *ScratchFS) URL(ctx *wf.TaskContext, name string) string
- func (s *ScratchFS) WriteFilename(ctx *wf.TaskContext, baseName string) string
- type SentMail
- type SocialMediaTasks
- type SwarmingClient
- type TagDep
- type TagRepo
- type TagTelemetryTasks
- func (t *TagTelemetryTasks) AwaitSubmission(ctx *wf.TaskContext, changeID string) error
- func (t *TagTelemetryTasks) GenerateConfig(ctx *wf.TaskContext, reviewers []string) (string, error)
- func (t *TagTelemetryTasks) MaybeTag(ctx *wf.TaskContext) (string, error)
- func (t *TagTelemetryTasks) NewDefinition() *wf.Definition
- type TagXReposTasks
- func (x *TagXReposTasks) AwaitGoMod(ctx *wf.TaskContext, changeID, repo, branch string) (string, error)
- func (x *TagXReposTasks) AwaitGreen(ctx *wf.TaskContext, repo TagRepo, commit string) (string, error)
- func (x *TagXReposTasks) BuildPlan(wd *wf.Definition, repos []TagRepo, reviewers []string) (wf.Value[string], error)
- func (x *TagXReposTasks) BuildSingleRepoPlan(wd *wf.Definition, repoSlice []TagRepo, name string, skipPostSubmit bool, ...) (wf.Value[TagRepo], error)
- func (x *TagXReposTasks) MailGoMod(ctx *wf.TaskContext, repo, branch string, files map[string]string, ...) (string, error)
- func (x *TagXReposTasks) MaybeTag(ctx *wf.TaskContext, repo TagRepo, commit string) (TagRepo, error)
- func (x *TagXReposTasks) NewDefinition() *wf.Definition
- func (x *TagXReposTasks) NewSingleDefinition() *wf.Definition
- func (x *TagXReposTasks) SelectRepos(ctx *wf.TaskContext) ([]TagRepo, error)
- func (x *TagXReposTasks) UpdateGoMod(ctx *wf.TaskContext, repo TagRepo, deps []TagRepo, branch string) (files map[string]string, _ error)
- type UpdateProxyTestRepoTasks
- type VSCodeGoReleaseTask
- type VersionTasks
- func (t *VersionTasks) AwaitCL(ctx *workflow.TaskContext, changeID, baseCommit string) (string, error)
- func (t *VersionTasks) CreateAutoSubmitVersionCL(ctx *workflow.TaskContext, branch, version string, reviewers []string, ...) (string, error)
- func (t *VersionTasks) CreateUpdateStdlibIndexCL(ctx *workflow.TaskContext, reviewers []string, version string) (string, error)
- func (t *VersionTasks) GenerateVersionFile(_ *workflow.TaskContext, version string, timestamp time.Time) (string, error)
- func (t *VersionTasks) GetCurrentMajor(ctx context.Context) (int, time.Time, error)
- func (t *VersionTasks) GetDevelVersion(ctx context.Context) (int, error)
- func (t *VersionTasks) GetNextMinorVersions(ctx context.Context, majors []int) ([]string, error)
- func (t *VersionTasks) GetNextVersion(ctx context.Context, major int, kind ReleaseKind) (string, error)
- func (t *VersionTasks) MailDLCL(ctx *workflow.TaskContext, major int, kind ReleaseKind, version string, ...) (changeID string, _ error)
- func (t *VersionTasks) ReadBranchHead(ctx *workflow.TaskContext, branch string) (string, error)
- func (t *VersionTasks) TagRelease(ctx *workflow.TaskContext, version, commit string) error
- func (t *VersionTasks) UnwaitWaitReleaseCLs(ctx *workflow.TaskContext) (result struct{}, _ error)
- type WebsiteFile
- type WebsiteRelease
Constants ¶
This section is empty.
Variables ¶
var AwaitDivisor int = 1
var ErrTweetTooLong = fmt.Errorf("tweet text length exceeded Twitter's limit")
ErrTweetTooLong is the error when a tweet is too long.
Functions ¶
func AwaitCondition ¶
func AwaitCondition[T any](ctx *wf.TaskContext, period time.Duration, condition func() (T, bool, error)) (T, error)
AwaitCondition calls the condition function every period until it returns true to indicate success, or an error. If the condition succeeds, AwaitCondition returns its result.
func ChangeLink ¶
ChangeLink returns a link to the review page for the CL with the specified change ID. The change ID must be in the project~cl# form.
func CheckCoordinators ¶
CheckCoordinators checks that all users are known and have required information (name, Gerrit email, GitHub user name).
func ExtractFile ¶
ExtractFile copies the first file in tgz matching glob to dest.
func NewMastodonClient ¶
func NewMastodonClient(config secret.MastodonCredentials) (realMastodonClient, error)
NewMastodonClient creates a Mastodon API client authenticated to make Mastodon API calls using the provided credentials. The resulting client may have been permission-limited at its creation (e.g., only allowed to upload media and write posts). For tests, use NewTestMastodonClient, which creates private messages instead.
func NewSendGridMailClient ¶
func NewSendGridMailClient(sendgridAPIKey string) realSendGridMailClient
NewSendGridMailClient creates a SendGrid mail client authenticated with the given API key.
func NewTestMastodonClient ¶
func NewTestMastodonClient(config secret.MastodonCredentials, pmTarget string) (realMastodonClient, error)
NewTestMastodonClient creates a client that will DM the announcement to the designated recipient for end-to-end testing. config.TestRecipient cannot be empty; that would result in a public message, which should not happen unintentionally.
func NewTwitterClient ¶
func NewTwitterClient(t secret.TwitterCredentials) realTwitterClient
NewTwitterClient creates a Twitter API client authenticated to make Twitter API calls using the provided credentials.
func ReadBinariesFromPKG ¶
ReadBinariesFromPKG reads pkg, the Go installer .pkg file, and returns binaries in bin and pkg/tool directories within GOROOT which we expect to have been signed by the macOS signing process.
The map key is a relative path starting with "go/", like "go/bin/gofmt" or "go/pkg/tool/darwin_arm64/test2json". The map value holds its bytes.
func ServeTarball ¶
func ServeTarball(pathMatch string, files map[string]string, w http.ResponseWriter, r *http.Request)
ServeTarball serves files as a .tar.gz to w, only if path contains pathMatch.
func TarToModFiles ¶
func TarToModFiles(target *releasetargets.Target, version string, t time.Time, tgz io.Reader, w io.Writer) (mod string, info string, _ error)
TarToModFiles converts the distribution archive with the given name and content to a collection of module files.
func ToolchainModuleVersion ¶
func ToolchainModuleVersion(target *releasetargets.Target, version string) string
func ToolchainZipPrefix ¶
func ToolchainZipPrefix(target *releasetargets.Target, version string) string
Types ¶
type AnnounceMailTasks ¶
type AnnounceMailTasks struct { // SendMail sends an email with the given header and content // using an externally-provided implementation. // // Email delivery happens asynchronously, so SendMail returns a nil error // if the transmission was started successfully, but that error value // doesn't indicate anything about the status of the delivery. SendMail func(MailHeader, MailContent) error // AnnounceMailHeader is the header to use for the release (pre-)announcement email. AnnounceMailHeader MailHeader // contains filtered or unexported fields }
AnnounceMailTasks contains tasks related to the release (pre-)announcement email.
func (AnnounceMailTasks) AnnounceRelease ¶
func (t AnnounceMailTasks) AnnounceRelease(ctx *workflow.TaskContext, kind ReleaseKind, published []Published, security []string, users []string) (SentMail, error)
AnnounceRelease sends an email to Google Groups announcing that a Go release has been published.
func (AnnounceMailTasks) AwaitAnnounceMail ¶
func (t AnnounceMailTasks) AwaitAnnounceMail(ctx *workflow.TaskContext, m SentMail) (announcementURL string, _ error)
AwaitAnnounceMail waits for an announcement email with the specified subject to show up on Google Groups, and returns its canonical URL.
func (AnnounceMailTasks) PreAnnounceRelease ¶
func (t AnnounceMailTasks) PreAnnounceRelease(ctx *workflow.TaskContext, versions []string, target Date, security string, cves []string, users []string) (SentMail, error)
PreAnnounceRelease sends an email pre-announcing a Go release containing PRIVATE track security fixes planned for the target date.
type BuildBucketClient ¶
type BuildBucketClient interface { // ListBuilders lists all the builders in bucket, keyed by their builder names. ListBuilders(ctx context.Context, bucket string) (map[string]*pb.BuilderConfig, error) // RunBuild runs a builder at commit with properties and returns its ID. RunBuild(ctx context.Context, bucket, builder string, commit *pb.GitilesCommit, properties map[string]*structpb.Value) (int64, error) // Completed reports whether a build has finished, returning an error if // it's failed. It's suitable for use with AwaitCondition. Completed(ctx context.Context, id int64) (string, bool, error) // SearchBuilds searches for builds matching pred and returns their IDs. SearchBuilds(ctx context.Context, pred *pb.BuildPredicate) ([]int64, error) }
type BundleNSSRootsTask ¶
type BundleNSSRootsTask struct { Gerrit GerritClient CloudBuild CloudBuildClient }
func (*BundleNSSRootsTask) NewDefinition ¶
func (x *BundleNSSRootsTask) NewDefinition() *wf.Definition
func (*BundleNSSRootsTask) UpdateBundle ¶
func (x *BundleNSSRootsTask) UpdateBundle(ctx *wf.TaskContext, reviewers []string) (string, error)
type CloudBuild ¶
CloudBuild represents a Cloud Build that can be queried with the status methods on CloudBuildClient.
type CloudBuildClient ¶
type CloudBuildClient interface { // RunBuildTrigger runs an existing trigger in project with the given // substitutions. RunBuildTrigger(ctx context.Context, project, trigger string, substitutions map[string]string) (CloudBuild, error) // RunScript runs the given script under bash -eux -o pipefail in // ScriptProject. Outputs are collected into the build's ResultURL, // readable with ResultFS. The script will have the latest version of Go // and some version of gsutil on $PATH. // If gerritProject is provided, the script operates within a checkout of the // latest commit on the default branch of that repository. RunScript(ctx context.Context, script string, gerritProject string, outputs []string) (CloudBuild, error) // RunCustomSteps is a low-level API that provides direct control over // individual Cloud Build steps. It creates a random result directory // and provides that as a parameter to the steps function, so that it // may write output to it with 'gsutil cp' for accessing via ResultFS. // Prefer RunScript for simpler scenarios. // Reference: https://cloud.google.com/build/docs/build-config-file-schema RunCustomSteps(ctx context.Context, steps func(resultURL string) []*cloudbuildpb.BuildStep, opts *CloudBuildOptions) (CloudBuild, error) // Completed reports whether a build has finished, returning an error if // it's failed. It's suitable for use with AwaitCondition. Completed(ctx context.Context, build CloudBuild) (detail string, completed bool, _ error) // ResultFS returns an FS that contains the results of the given build. ResultFS(ctx context.Context, build CloudBuild) (fs.FS, error) }
type CloudBuildOptions ¶
type CloudBuildOptions struct {
AvailableSecrets *cloudbuildpb.Secrets
}
CloudBuildOptions allows to customize CloudBuild configurations.
type CommunicationTasks ¶
type CommunicationTasks struct { AnnounceMailTasks SocialMediaTasks }
CommunicationTasks combines communication tasks together.
type Date ¶
type Date struct { Year int // Year (for example, 2009). Month time.Month // Month of the year (January = 1, ...). Day int // Day of the month, starting at 1. }
A Date represents a single calendar day (year, month, day).
This type does not include location information, and therefore does not describe a unique 24-hour timespan.
TODO(go.dev/issue/19700): Start using time.Day or so when available.
type FakeBinary ¶
type FakeBuildBucketClient ¶
type FakeBuildBucketClient struct { Bucket string FailBuilds []string MissingBuilds []string GerritURL, Branch string Projects []string // contains filtered or unexported fields }
func NewFakeBuildBucketClient ¶
func NewFakeBuildBucketClient(major int, url, bucket string, projects []string) *FakeBuildBucketClient
func (*FakeBuildBucketClient) ListBuilders ¶
func (c *FakeBuildBucketClient) ListBuilders(ctx context.Context, bucket string) (map[string]*pb.BuilderConfig, error)
func (*FakeBuildBucketClient) SearchBuilds ¶
func (c *FakeBuildBucketClient) SearchBuilds(ctx context.Context, pred *pb.BuildPredicate) ([]int64, error)
type FakeCloudBuild ¶
type FakeCloudBuild struct {
// contains filtered or unexported fields
}
func NewFakeCloudBuild ¶
func NewFakeCloudBuild(t *testing.T, gerrit *FakeGerrit, project string, allowedTriggers map[string]map[string]string, fakeBinaries ...FakeBinary) *FakeCloudBuild
func (*FakeCloudBuild) Completed ¶
func (cb *FakeCloudBuild) Completed(ctx context.Context, build CloudBuild) (string, bool, error)
func (*FakeCloudBuild) ResultFS ¶
func (c *FakeCloudBuild) ResultFS(ctx context.Context, build CloudBuild) (fs.FS, error)
func (*FakeCloudBuild) RunBuildTrigger ¶
func (cb *FakeCloudBuild) RunBuildTrigger(ctx context.Context, project string, trigger string, substitutions map[string]string) (CloudBuild, error)
func (*FakeCloudBuild) RunCustomSteps ¶
func (cb *FakeCloudBuild) RunCustomSteps(ctx context.Context, steps func(resultURL string) []*cloudbuildpb.BuildStep, _ *CloudBuildOptions) (CloudBuild, error)
func (*FakeCloudBuild) RunScript ¶
func (cb *FakeCloudBuild) RunScript(ctx context.Context, script string, gerritProject string, outputs []string) (CloudBuild, error)
type FakeGerrit ¶
type FakeGerrit struct {
// contains filtered or unexported fields
}
func NewFakeGerrit ¶
func NewFakeGerrit(t *testing.T, repos ...*FakeRepo) *FakeGerrit
func (*FakeGerrit) CreateAutoSubmitChange ¶
func (g *FakeGerrit) CreateAutoSubmitChange(_ *wf.TaskContext, input gerrit.ChangeInput, reviewers []string, contents map[string]string) (string, error)
func (*FakeGerrit) CreateBranch ¶
func (g *FakeGerrit) CreateBranch(ctx context.Context, project, branch string, input gerrit.BranchInput) (string, error)
func (*FakeGerrit) GerritURL ¶
func (g *FakeGerrit) GerritURL() string
func (*FakeGerrit) GetChange ¶
func (*FakeGerrit) GetChange(_ context.Context, _ string, _ ...gerrit.QueryChangesOpt) (*gerrit.ChangeInfo, error)
func (*FakeGerrit) GetCommitsInRefs ¶
func (*FakeGerrit) GitilesURL ¶
func (g *FakeGerrit) GitilesURL() string
func (*FakeGerrit) ListBranches ¶
func (g *FakeGerrit) ListBranches(ctx context.Context, project string) ([]gerrit.BranchInfo, error)
func (*FakeGerrit) ListProjects ¶
func (g *FakeGerrit) ListProjects(ctx context.Context) ([]string, error)
func (*FakeGerrit) QueryChanges ¶
func (*FakeGerrit) QueryChanges(_ context.Context, query string) ([]*gerrit.ChangeInfo, error)
func (*FakeGerrit) ReadBranchHead ¶
func (*FakeGerrit) SetHashtags ¶
func (*FakeGerrit) SetHashtags(_ context.Context, changeID string, _ gerrit.HashtagsInput) error
type FakeGitHub ¶
type FakeGitHub struct { // Milestones is a map from milestone ID to milestone name. Milestones map[int]string // Issues is a map from issue number to issue details. // this map contains all the Issues attached to all milestones and Issues that // does not attach to milestone. Issues map[int]*github.Issue DisallowComments bool // if set, return an error from PostComment // contains filtered or unexported fields }
func (*FakeGitHub) CreateIssue ¶
func (*FakeGitHub) CreateRelease ¶
func (*FakeGitHub) CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, error)
func (*FakeGitHub) EditMilestone ¶
func (*FakeGitHub) FetchMilestone ¶
func (*FakeGitHub) FetchMilestoneIssues ¶
func (*FakeGitHub) PostComment ¶
func (*FakeGitHub) UploadReleaseAsset ¶
type FakeRepo ¶
type FakeRepo struct {
// contains filtered or unexported fields
}
func (*FakeRepo) CommitOnBranch ¶
type FakeSignService ¶
type FakeSignService struct {
// contains filtered or unexported fields
}
func NewFakeSignService ¶
func NewFakeSignService(t *testing.T, outputDir string) *FakeSignService
NewFakeSignService returns a fake signing service that can sign PKGs, MSIs, and generate GPG signatures. MSIs are "signed" by adding a suffix to them. PKGs must actually be tarballs with a prefix of "I'm a PKG!\n". Any files they contain that look like binaries will be "signed".
func (*FakeSignService) ArtifactSigningStatus ¶
func (*FakeSignService) CancelSigning ¶
func (s *FakeSignService) CancelSigning(_ context.Context, jobID string) error
func (*FakeSignService) SignArtifact ¶
type FakeSwarmingClient ¶
type FakeSwarmingClient struct {
// contains filtered or unexported fields
}
func NewFakeSwarmingClient ¶
func NewFakeSwarmingClient(t *testing.T, fakeGo string) *FakeSwarmingClient
type GerritClient ¶
type GerritClient interface { // GitilesURL returns the URL to the Gitiles server for this Gerrit instance. GitilesURL() string // CreateAutoSubmitChange creates a change with the given metadata and // contents, starts trybots with auto-submit enabled, and returns its change ID. // If the content of a file is empty, that file will be deleted from the repository. // If the requested contents match the state of the repository, no change // is created and the returned change ID will be empty. // Reviewers is the username part of a golang.org or google.com email address. CreateAutoSubmitChange(ctx *wf.TaskContext, input gerrit.ChangeInput, reviewers []string, contents map[string]string) (string, error) // Submitted checks if the specified change has been submitted or failed // trybots. If the CL is submitted, returns the submitted commit hash. // If parentCommit is non-empty, the submitted CL's parent must match it. Submitted(ctx context.Context, changeID, parentCommit string) (string, bool, error) // GetTag returns tag information for a specified tag. GetTag(ctx context.Context, project, tag string) (gerrit.TagInfo, error) // Tag creates a tag on project at the specified commit. Tag(ctx context.Context, project, tag, commit string) error // ListTags returns all the tags on project. ListTags(ctx context.Context, project string) ([]string, error) // ReadBranchHead returns the head of a branch in project. // If the branch doesn't exist, it returns an error matching gerrit.ErrResourceNotExist. ReadBranchHead(ctx context.Context, project, branch string) (string, error) // ListBranches returns the branch info for all the branch in a project. ListBranches(ctx context.Context, project string) ([]gerrit.BranchInfo, error) // CreateBranch create the given branch and returns the created branch's revision. CreateBranch(ctx context.Context, project, branch string, input gerrit.BranchInput) (string, error) // ListProjects lists all the projects on the server. ListProjects(ctx context.Context) ([]string, error) // ReadFile reads a file from project at the specified commit. // If the file doesn't exist, it returns an error matching gerrit.ErrResourceNotExist. ReadFile(ctx context.Context, project, commit, file string) ([]byte, error) // GetCommitsInRefs gets refs in which the specified commits were merged into. GetCommitsInRefs(ctx context.Context, project string, commits, refs []string) (map[string][]string, error) // QueryChanges gets changes which match the query. QueryChanges(ctx context.Context, query string) ([]*gerrit.ChangeInfo, error) SetHashtags(ctx context.Context, changeID string, hashtags gerrit.HashtagsInput) error // GetChange gets information about a specific change. GetChange(ctx context.Context, changeID string, opts ...gerrit.QueryChangesOpt) (*gerrit.ChangeInfo, error) }
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
A Git manages a set of Git repositories.
func (*Git) Clone ¶
Clone checks out the repository at origin into a temporary directory owned by the resulting GitDir.
func (*Git) UseOAuth2Auth ¶
func (g *Git) UseOAuth2Auth(ts oauth2.TokenSource) error
UseOAuth2Auth configures Git authentication using ts.
type GitDir ¶
type GitDir struct {
// contains filtered or unexported fields
}
A GitDir is a single Git repository.
type GitHubClient ¶
func (*GitHubClient) CreateIssue ¶
func (*GitHubClient) CreateRelease ¶
func (c *GitHubClient) CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, error)
func (*GitHubClient) EditMilestone ¶
func (*GitHubClient) FetchMilestone ¶
func (*GitHubClient) FetchMilestoneIssues ¶
func (*GitHubClient) PostComment ¶
func (*GitHubClient) UploadReleaseAsset ¶
type GitHubClientInterface ¶
type GitHubClientInterface interface { // FetchMilestone returns the number of the GitHub milestone with the specified name. // If create is true, and the milestone doesn't exist, it will be created. FetchMilestone(ctx context.Context, owner, repo, name string, create bool) (int, error) // FetchMilestoneIssues returns all the open issues in the specified milestone // and their labels. FetchMilestoneIssues(ctx context.Context, owner, repo string, milestoneID int) (map[int]map[string]bool, error) // See github.Client.Issues.Create. CreateIssue(ctx context.Context, owner string, repo string, issue *github.IssueRequest) (*github.Issue, *github.Response, error) // See github.Client.Issues.Edit. EditIssue(ctx context.Context, owner string, repo string, number int, issue *github.IssueRequest) (*github.Issue, *github.Response, error) // See github.Client.Issues.Get. GetIssue(ctx context.Context, owner string, repo string, number int) (*github.Issue, *github.Response, error) // See github.Client.Issues.EditMilestone. EditMilestone(ctx context.Context, owner string, repo string, number int, milestone *github.Milestone) (*github.Milestone, *github.Response, error) // PostComment creates a comment on a GitHub issue or pull request // identified by the given GitHub Node ID. PostComment(_ context.Context, id githubv4.ID, body string) error // See github.Client.Repositories.CreateRelease. CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, error) // UploadReleaseAsset uploads an fs.File to a GitHub release as a release // asset. // It uses NewUploadRequest as github.Client.Repositories.UploadReleaseAsset // only supports uploading from an os.File. // Parameters: // - owner: The account owner of the repository. // - repo: The name of the repository. // - releaseID: The ID of the github release. // - fileName: The name of the asset as it will appear in the release. // - file: The content of the file to upload. UploadReleaseAsset(ctx context.Context, owner, repo string, releaseID int64, fileName string, file fs.File) (*github.ReleaseAsset, error) }
GitHubClientInterface is a wrapper around the GitHub v3 and v4 APIs, for testing and dry-run support.
type LogWriter ¶
LogWriter is an io.Writer that writes to a workflow task's log, flushing its buffer periodically to avoid too many writes.
type MailContent ¶
A MailContent holds the content of an email.
type MailHeader ¶
type MailHeader struct { From mail.Address // An RFC 5322 address. For example, "Barry Gibbs <bg@example.com>". To mail.Address BCC []mail.Address }
A MailHeader is an email header.
type MilestoneTasks ¶
type MilestoneTasks struct { Client GitHubClientInterface RepoOwner, RepoName string ApproveAction func(*wf.TaskContext) error }
MilestoneTasks contains the tasks used to check and modify GitHub issues' milestones.
func (*MilestoneTasks) CheckBlockers ¶
func (m *MilestoneTasks) CheckBlockers(ctx *wf.TaskContext, milestones ReleaseMilestones, version string, kind ReleaseKind) error
CheckBlockers returns an error if there are open release blockers in the current milestone.
func (*MilestoneTasks) FetchMilestones ¶
func (m *MilestoneTasks) FetchMilestones(ctx *wf.TaskContext, currentVersion string, kind ReleaseKind) (ReleaseMilestones, error)
FetchMilestones returns the milestone numbers for the version currently being released, and the next version that outstanding issues should be moved to. If this is a major release, it also creates its first minor release milestone.
func (*MilestoneTasks) PingEarlyIssues ¶
func (m *MilestoneTasks) PingEarlyIssues(ctx *wf.TaskContext, develVersion int, openTreeURL string) (result struct{}, _ error)
PingEarlyIssues pings early-in-cycle issues in the development major release milestone. This is done once at the opening of a release cycle, currently via a standalone workflow.
develVersion is a value like 22 representing that Go 1.22 is the major version whose development has recently started, and whose early-in-cycle issues are to be pinged.
func (*MilestoneTasks) PushIssues ¶
func (m *MilestoneTasks) PushIssues(ctx *wf.TaskContext, milestones ReleaseMilestones, version string, kind ReleaseKind) error
PushIssues updates issues to reflect a finished release. For major and minor releases, it moves issues to the next milestone and closes the current milestone. For pre-releases, it cleans up any "okay-after-..." labels in the current milestone that are done serving their purpose.
type Poster ¶
type Poster interface { // PostTweet posts a tweet with the given text and PNG image, // both of which must be non-empty, and returns the tweet URL. // // ErrTweetTooLong error is returned if posting fails // due to the tweet text length exceeding Twitter's limit. PostTweet(text string, imagePNG []byte, altText string) (tweetURL string, _ error) }
type PrivXPatch ¶
type PrivXPatch struct { Git *Git PublicGerrit GerritClient PrivateGerrit GerritClient // PublicRepoURL returns a git clone URL for repo PublicRepoURL func(repo string) string ApproveAction func(*wf.TaskContext) error SendMail func(MailHeader, MailContent) error AnnounceMailHeader MailHeader }
func (*PrivXPatch) NewDefinition ¶
func (x *PrivXPatch) NewDefinition(tagx *TagXReposTasks) *wf.Definition
type PrivateMasterSyncTask ¶
func (*PrivateMasterSyncTask) NewDefinition ¶
func (t *PrivateMasterSyncTask) NewDefinition() *wf.Definition
type Published ¶
type Published struct { Version string // Version that's published, in the same format as Go tags. For example, "go1.21rc1". Files []WebsiteFile // Files that are published. }
Published holds information for a Go release that by this time has already been published.
Published in this context refers to it being available for download at https://go.dev/dl/. It doesn't mean it has been announced by now; that step happens sometime after publication.
type RealBuildBucketClient ¶
type RealBuildBucketClient struct { BuildersClient pb.BuildersClient BuildsClient pb.BuildsClient }
func (*RealBuildBucketClient) ListBuilders ¶
func (c *RealBuildBucketClient) ListBuilders(ctx context.Context, bucket string) (map[string]*pb.BuilderConfig, error)
func (*RealBuildBucketClient) SearchBuilds ¶
func (c *RealBuildBucketClient) SearchBuilds(ctx context.Context, pred *pb.BuildPredicate) ([]int64, error)
type RealCloudBuildClient ¶
type RealCloudBuildClient struct { BuildClient *cloudbuild.Client StorageClient *storage.Client ScriptProject string ScriptAccount string ScratchURL string }
func (*RealCloudBuildClient) Completed ¶
func (c *RealCloudBuildClient) Completed(ctx context.Context, build CloudBuild) (string, bool, error)
func (*RealCloudBuildClient) ResultFS ¶
func (c *RealCloudBuildClient) ResultFS(ctx context.Context, build CloudBuild) (fs.FS, error)
func (*RealCloudBuildClient) RunBuildTrigger ¶
func (c *RealCloudBuildClient) RunBuildTrigger(ctx context.Context, project, trigger string, substitutions map[string]string) (CloudBuild, error)
func (*RealCloudBuildClient) RunCustomSteps ¶
func (c *RealCloudBuildClient) RunCustomSteps(ctx context.Context, steps func(resultURL string) []*cloudbuildpb.BuildStep, options *CloudBuildOptions) (CloudBuild, error)
func (*RealCloudBuildClient) RunScript ¶
func (c *RealCloudBuildClient) RunScript(ctx context.Context, script string, gerritProject string, outputs []string) (CloudBuild, error)
type RealGerritClient ¶
type RealGerritClient struct { Gitiles string // Gitiles server URL, without trailing slash. For example, "https://go.googlesource.com". Client *gerrit.Client }
func (*RealGerritClient) CreateAutoSubmitChange ¶
func (c *RealGerritClient) CreateAutoSubmitChange(ctx *wf.TaskContext, input gerrit.ChangeInput, reviewers []string, files map[string]string) (_ string, err error)
func (*RealGerritClient) CreateBranch ¶
func (c *RealGerritClient) CreateBranch(ctx context.Context, project, branch string, input gerrit.BranchInput) (string, error)
func (*RealGerritClient) GetChange ¶
func (c *RealGerritClient) GetChange(ctx context.Context, changeID string, opts ...gerrit.QueryChangesOpt) (*gerrit.ChangeInfo, error)
func (*RealGerritClient) GetCommitsInRefs ¶
func (*RealGerritClient) GitilesURL ¶
func (c *RealGerritClient) GitilesURL() string
func (*RealGerritClient) ListBranches ¶
func (c *RealGerritClient) ListBranches(ctx context.Context, project string) ([]gerrit.BranchInfo, error)
func (*RealGerritClient) ListProjects ¶
func (c *RealGerritClient) ListProjects(ctx context.Context) ([]string, error)
func (*RealGerritClient) QueryChanges ¶
func (c *RealGerritClient) QueryChanges(ctx context.Context, query string) ([]*gerrit.ChangeInfo, error)
func (*RealGerritClient) ReadBranchHead ¶
func (*RealGerritClient) SetHashtags ¶
func (c *RealGerritClient) SetHashtags(ctx context.Context, changeID string, hashtags gerrit.HashtagsInput) error
type RealSwarmingClient ¶
type RealSwarmingClient struct { SwarmingClient swarming.Client SwarmingURL, ServiceAccount, Realm, Pool string }
type ReleaseGoplsTasks ¶
type ReleaseGoplsTasks struct { Github GitHubClientInterface Gerrit GerritClient CloudBuild CloudBuildClient SendMail func(MailHeader, MailContent) error AnnounceMailHeader MailHeader ApproveAction func(*wf.TaskContext) error }
ReleaseGoplsTasks provides workflow definitions and tasks for releasing gopls.
func (*ReleaseGoplsTasks) NewPrereleaseDefinition ¶
func (r *ReleaseGoplsTasks) NewPrereleaseDefinition() *wf.Definition
NewPrereleaseDefinition create a new workflow definition for gopls pre-release.
func (*ReleaseGoplsTasks) NewReleaseDefinition ¶
func (r *ReleaseGoplsTasks) NewReleaseDefinition() *wf.Definition
NewReleaseDefinition create a new workflow definition for gopls release.
type ReleaseKind ¶
type ReleaseKind int
ReleaseKind is the type of release being run.
const ( KindUnknown ReleaseKind = iota KindBeta KindRC KindMajor KindMinor )
func (ReleaseKind) GoString ¶
func (k ReleaseKind) GoString() string
type ReleaseMilestones ¶
type ReleaseMilestones struct { // Current is the GitHub milestone number for the current Go release. // For example, 279 for the "Go1.21" milestone (https://github.com/golang/go/milestone/279). Current int // Next is the GitHub milestone number for the next Go release of the same kind. Next int }
type ReleaseVSCodeGoTasks ¶
type ReleaseVSCodeGoTasks struct { Gerrit GerritClient GitHub GitHubClientInterface CloudBuild CloudBuildClient ApproveAction func(*wf.TaskContext) error SendMail func(MailHeader, MailContent) error AnnounceMailHeader MailHeader }
ReleaseVSCodeGoTasks implements a set of vscode-go release workflow definitions.
* pre-release workflow: creates a pre-release version of a stable version. * release workflow: creates a release version of a stable version. * insider workflow: creates a insider version. There are no pre-releases for insider versions.
func (*ReleaseVSCodeGoTasks) NewInsiderDefinition ¶
func (r *ReleaseVSCodeGoTasks) NewInsiderDefinition() *wf.Definition
NewInsiderDefinition create a new workflow definition for vscode-go insider version release.
func (*ReleaseVSCodeGoTasks) NewPrereleaseDefinition ¶
func (r *ReleaseVSCodeGoTasks) NewPrereleaseDefinition() *wf.Definition
NewPrereleaseDefinition create a new workflow definition for vscode-go pre-release.
func (*ReleaseVSCodeGoTasks) NewReleaseDefinition ¶
func (r *ReleaseVSCodeGoTasks) NewReleaseDefinition() *wf.Definition
NewReleaseDefinition creates a new workflow definition for vscode-go stable version release.
type ScratchFS ¶
type ScratchFS struct { BaseURL string // BaseURL is a gs:// or file:// URL, no trailing slash. E.g., "gs://golang-release-staging/relui-scratch". GCS *storage.Client }
ScratchFS manages scratch storage for workflows.
func (*ScratchFS) OpenWrite ¶
func (s *ScratchFS) OpenWrite(ctx *wf.TaskContext, baseName string) (name string, _ gcsfs.WriterFile, _ error)
OpenWrite creates a new file in the workflow's scratch storage, with a name based on baseName. It returns that name, as well as the open file.
func (*ScratchFS) URL ¶
func (s *ScratchFS) URL(ctx *wf.TaskContext, name string) string
URL returns the URL of a file in the workflow's scratch storage, suitable for passing to external systems.
func (*ScratchFS) WriteFilename ¶
func (s *ScratchFS) WriteFilename(ctx *wf.TaskContext, baseName string) string
WriteFilename returns a filename that can be used to write a new scratch file suitable for writing from an external systems.
type SentMail ¶
type SentMail struct {
Subject string // Subject of the email. Expected to be unique so it can be used to identify the email.
}
SentMail represents an email that was sent.
type SocialMediaTasks ¶
type SocialMediaTasks struct { // TwitterClient can be used to post a tweet. TwitterClient Poster MastodonClient Poster // RandomSeed is the pseudo-random number generator seed to use for presentational // choices, such as selecting one out of many available emoji or release archives. // The zero value means to use time.Now().UnixNano(). RandomSeed int64 }
SocialMediaTasks contains tasks related to the release tweet.
func (SocialMediaTasks) TrumpetRelease ¶
func (t SocialMediaTasks) TrumpetRelease(ctx *workflow.TaskContext, kind ReleaseKind, published []Published, security string, announcement string) (_ string, _ error)
TrumpetRelease posts a tweet announcing that a Go release has been published.
func (SocialMediaTasks) TweetRelease ¶
func (t SocialMediaTasks) TweetRelease(ctx *workflow.TaskContext, kind ReleaseKind, published []Published, security string, announcement string) (_ string, _ error)
TweetRelease posts a tweet announcing that a Go release has been published. ErrTweetTooLong is returned if the inputs result in a tweet that's too long.
type SwarmingClient ¶
type SwarmingClient interface { // RunTask runs script on a machine running port with env set. // The script will have the latest version of Go and some version of gsutil // on $PATH. To facilitate Windows/Unix compatibility, . will be at the end // of $PATH. RunTask(ctx context.Context, dims map[string]string, script string, env map[string]string) (string, error) // Completed reports whether a build has finished, returning an error if // it's failed. It's suitable for use with AwaitCondition. Completed(ctx context.Context, id string) (string, bool, error) }
type TagDep ¶
type TagDep struct { ModPath string // Module path, e.g., "golang.org/x/sys". Wait bool // Wait controls whether to wait for this dependency to be processed first. }
TagDep represents a dependency of a repo being updated and possibly tagged.
type TagRepo ¶
type TagRepo struct { Name string // Gerrit project name, e.g., "tools". ModPath string // Module path, e.g., "golang.org/x/tools". Deps []*TagDep // Dependency modules. StartVersion string // The version of the module when the workflow started. Empty string means repo hasn't begun release version tagging yet. NewerVersion string // The version of the module that will be tagged, or the empty string when the repo is being updated only and not tagged. }
TagRepo contains information about a repo that can be updated and possibly tagged.
func (TagRepo) UpdateOnlyAndNotTag ¶
UpdateOnlyAndNotTag reports whether repo r should be updated only, and not tagged.
type TagTelemetryTasks ¶
type TagTelemetryTasks struct { Gerrit GerritClient CloudBuild CloudBuildClient }
TagTelemetryTasks implements a new workflow definition to tag x/telemetry/config whenever the generated config.json changes.
func (*TagTelemetryTasks) AwaitSubmission ¶
func (t *TagTelemetryTasks) AwaitSubmission(ctx *wf.TaskContext, changeID string) error
AwaitSubmission waits for the CL with the given change ID to be submitted.
The return value is the submitted commit hash, or "" if changeID is "".
func (*TagTelemetryTasks) GenerateConfig ¶
func (t *TagTelemetryTasks) GenerateConfig(ctx *wf.TaskContext, reviewers []string) (string, error)
GenerateConfig runs the upload config generator in a buildlet, extracts the resulting config.json, and creates a CL with the result if anything changed.
It returns the change ID, or "" if the CL was not created.
func (*TagTelemetryTasks) MaybeTag ¶
func (t *TagTelemetryTasks) MaybeTag(ctx *wf.TaskContext) (string, error)
MaybeTag tags x/telemetry/config with the next version if config/config.json has changed.
It returns the tag that was created, or "" if no tagging occurred.
func (*TagTelemetryTasks) NewDefinition ¶
func (t *TagTelemetryTasks) NewDefinition() *wf.Definition
type TagXReposTasks ¶
type TagXReposTasks struct { IgnoreProjects map[string]bool // project name -> ignore Gerrit GerritClient CloudBuild CloudBuildClient BuildBucket BuildBucketClient }
func (*TagXReposTasks) AwaitGoMod ¶
func (x *TagXReposTasks) AwaitGoMod(ctx *wf.TaskContext, changeID, repo, branch string) (string, error)
func (*TagXReposTasks) AwaitGreen ¶
func (x *TagXReposTasks) AwaitGreen(ctx *wf.TaskContext, repo TagRepo, commit string) (string, error)
func (*TagXReposTasks) BuildPlan ¶
func (x *TagXReposTasks) BuildPlan(wd *wf.Definition, repos []TagRepo, reviewers []string) (wf.Value[string], error)
BuildPlan adds the tasks needed to update repos to wd.
func (*TagXReposTasks) BuildSingleRepoPlan ¶
func (*TagXReposTasks) MailGoMod ¶
func (x *TagXReposTasks) MailGoMod(ctx *wf.TaskContext, repo, branch string, files map[string]string, reviewers []string) (string, error)
func (*TagXReposTasks) MaybeTag ¶
func (x *TagXReposTasks) MaybeTag(ctx *wf.TaskContext, repo TagRepo, commit string) (TagRepo, error)
MaybeTag tags repo at commit with the next version, unless commit is already the latest tagged version. repo is returned with NewerVersion populated.
func (*TagXReposTasks) NewDefinition ¶
func (x *TagXReposTasks) NewDefinition() *wf.Definition
func (*TagXReposTasks) NewSingleDefinition ¶
func (x *TagXReposTasks) NewSingleDefinition() *wf.Definition
func (*TagXReposTasks) SelectRepos ¶
func (x *TagXReposTasks) SelectRepos(ctx *wf.TaskContext) ([]TagRepo, error)
func (*TagXReposTasks) UpdateGoMod ¶
func (x *TagXReposTasks) UpdateGoMod(ctx *wf.TaskContext, repo TagRepo, deps []TagRepo, branch string) (files map[string]string, _ error)
type UpdateProxyTestRepoTasks ¶
func (*UpdateProxyTestRepoTasks) UpdateProxyTestRepo ¶
func (t *UpdateProxyTestRepoTasks) UpdateProxyTestRepo(ctx *wf.TaskContext, published Published) (string, error)
type VSCodeGoReleaseTask ¶
type VSCodeGoReleaseTask struct { CloudBuild CloudBuildClient *ScratchFS Revision string }
VSCodeGoReleaseTask releases vscode go.
1. cross-compile github.com/golang/vscode-go/vscgo and store the artifacts in the scratchFS. 2. (TODO) sign the artifacts. 3. (TODO) tag the repository. 4. (TODO) trigger the GCB workflow that reads the signed artifacts, packages, and publishes them. 5. (TODO) announce (SNS)
func (*VSCodeGoReleaseTask) NewDefinition ¶
func (t *VSCodeGoReleaseTask) NewDefinition() *wf.Definition
type VersionTasks ¶
type VersionTasks struct { Gerrit GerritClient CloudBuild CloudBuildClient GoProject string UpdateProxyTestRepoTasks }
VersionTasks contains tasks related to versioning the release.
func (*VersionTasks) AwaitCL ¶
func (t *VersionTasks) AwaitCL(ctx *workflow.TaskContext, changeID, baseCommit string) (string, error)
AwaitCL waits for the specified CL to be submitted, and returns the new branch head. Callers can pass baseCommit, the current branch head, to verify that no CLs were submitted between when the CL was created and when it was merged. If changeID is blank because the intended CL was a no-op, baseCommit is returned immediately.
func (*VersionTasks) CreateAutoSubmitVersionCL ¶
func (t *VersionTasks) CreateAutoSubmitVersionCL(ctx *workflow.TaskContext, branch, version string, reviewers []string, versionFile string) (string, error)
CreateAutoSubmitVersionCL mails an auto-submit change to update VERSION file on branch.
func (*VersionTasks) CreateUpdateStdlibIndexCL ¶
func (t *VersionTasks) CreateUpdateStdlibIndexCL(ctx *workflow.TaskContext, reviewers []string, version string) (string, error)
func (*VersionTasks) GenerateVersionFile ¶
func (t *VersionTasks) GenerateVersionFile(_ *workflow.TaskContext, version string, timestamp time.Time) (string, error)
func (*VersionTasks) GetCurrentMajor ¶
GetCurrentMajor returns the most recent major Go version, and the time at which its tag was created.
func (*VersionTasks) GetDevelVersion ¶
func (t *VersionTasks) GetDevelVersion(ctx context.Context) (int, error)
GetDevelVersion returns the current major Go 1.x version in development.
This value is determined by reading the value of the Version constant in the internal/goversion package of the main Go repository at HEAD commit.
func (*VersionTasks) GetNextMinorVersions ¶
GetNextMinorVersions returns the next minor for each of the given major series. It uses the same format as Go tags (for example, "go1.23.4").
func (*VersionTasks) GetNextVersion ¶
func (t *VersionTasks) GetNextVersion(ctx context.Context, major int, kind ReleaseKind) (string, error)
GetNextVersion returns the next for the given major series and kind of release. It uses the same format as Go tags (for example, "go1.23.4").
func (*VersionTasks) MailDLCL ¶
func (t *VersionTasks) MailDLCL(ctx *workflow.TaskContext, major int, kind ReleaseKind, version string, reviewers []string, dryRun bool) (changeID string, _ error)
MailDLCL mails a golang.org/dl CL that adds commands for the specified Go version.
The version string must use the same format as Go tags. For example:
- "go1.21rc2" for a pre-release
- "go1.21.0" for a major Go release
- "go1.21.1" for a minor Go release
On success, the ID of the change is returned, like "dl~1234".
func (*VersionTasks) ReadBranchHead ¶
func (t *VersionTasks) ReadBranchHead(ctx *workflow.TaskContext, branch string) (string, error)
ReadBranchHead returns the current HEAD revision of branch.
func (*VersionTasks) TagRelease ¶
func (t *VersionTasks) TagRelease(ctx *workflow.TaskContext, version, commit string) error
TagRelease tags commit as version.
func (*VersionTasks) UnwaitWaitReleaseCLs ¶
func (t *VersionTasks) UnwaitWaitReleaseCLs(ctx *workflow.TaskContext) (result struct{}, _ error)
UnwaitWaitReleaseCLs changes all open Gerrit CLs with hashtag "wait-release" into "ex-wait-release". This is done once at the opening of a release cycle, currently via a standalone workflow.
type WebsiteFile ¶
type WebsiteFile struct { Filename string `json:"filename"` OS string `json:"os"` Arch string `json:"arch"` Version string `json:"version"` ChecksumSHA256 string `json:"sha256"` Size int64 `json:"size"` Kind string `json:"kind"` // "archive", "installer", "source" }
WebsiteFile represents a file on the go.dev downloads page. It should be kept in sync with the download code in x/website/internal/dl.
func (WebsiteFile) GOARCH ¶
func (f WebsiteFile) GOARCH() string
type WebsiteRelease ¶
type WebsiteRelease struct { Version string `json:"version"` Stable bool `json:"stable"` Files []WebsiteFile `json:"files"` Visible bool `json:"-"` // show files on page load SplitPortTable bool `json:"-"` // whether files should be split by primary/other ports. }
Source Files ¶
- announce.go
- buildbucket.go
- buildrelease.go
- cloudbuild.go
- darwin.go
- dl2mod.go
- dlcl.go
- fakes.go
- gerrit.go
- git.go
- milestones.go
- privx.go
- releasegopls.go
- releasevscodego.go
- scratchfs.go
- swarming.go
- sync_private.go
- tagtelemetry.go
- tagx.go
- task.go
- tweet.go
- updateproxytestrepo.go
- version.go
- vscodego.go
- x509bundle.go