Skip to content

Commit bc09ea8

Browse files
heschigopherbot
authored andcommitted
internal/task: remove initial tagging support
With the first run done this code is now dead. We can create manual tags for future bootstrapping. For golang/go#48523. Change-Id: Iff147d095205f3e3687136d85eaaa08bae207069 Reviewed-on: https://go-review.googlesource.com/c/build/+/444117 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Heschi Kreinick <[email protected]> Auto-Submit: Heschi Kreinick <[email protected]>
1 parent c1ee1b7 commit bc09ea8

File tree

1 file changed

+13
-33
lines changed

1 file changed

+13
-33
lines changed

Diff for: internal/task/tagx.go

+13-33
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,6 @@ func (x *TagXReposTasks) SelectRepos(ctx *wf.TaskContext) ([]TagRepo, error) {
7979
return repos, nil
8080
}
8181

82-
// TODO(heschi): delete after first use
83-
var initialTags = map[string]bool{
84-
"arch": true,
85-
"crypto": true,
86-
"image": true,
87-
"net": true,
88-
"oauth2": true,
89-
"sync": true,
90-
"sys": true,
91-
"term": true,
92-
"time": true,
93-
}
94-
9582
func (x *TagXReposTasks) readRepo(ctx *wf.TaskContext, project string) (*TagRepo, error) {
9683
head, err := x.Gerrit.ReadBranchHead(ctx, project, "master")
9784
if errors.Is(err, gerrit.ErrResourceNotExist) {
@@ -106,9 +93,6 @@ func (x *TagXReposTasks) readRepo(ctx *wf.TaskContext, project string) (*TagRepo
10693
if err != nil {
10794
return nil, err
10895
}
109-
if tag == "" && initialTags[project] {
110-
tag = "PLACEHOLDER"
111-
}
11296
if tag == "" {
11397
ctx.Printf("ignoring %v: no semver tag", project)
11498
return nil, nil
@@ -566,23 +550,19 @@ func (x *TagXReposTasks) MaybeTag(ctx *wf.TaskContext, repo TagRepo, commit stri
566550
}
567551

568552
if highestRelease == "" {
569-
if !initialTags[repo.Name] {
570-
return TagRepo{}, fmt.Errorf("no semver tags found in %v", repo.Name)
571-
}
572-
repo.Version = "v0.1.0"
573-
} else {
574-
tagInfo, err := x.Gerrit.GetTag(ctx, repo.Name, highestRelease)
575-
if err != nil && !initialTags[repo.Name] {
576-
return TagRepo{}, fmt.Errorf("reading project %v tag %v: %v", repo.Name, highestRelease, err)
577-
}
578-
if tagInfo.Revision == commit {
579-
repo.Version = highestRelease
580-
return repo, nil
581-
}
582-
repo.Version, err = nextMinor(highestRelease)
583-
if err != nil {
584-
return TagRepo{}, fmt.Errorf("couldn't pick next version for %v: %v", repo.Name, err)
585-
}
553+
return TagRepo{}, fmt.Errorf("no semver tags found in %v", repo.Name)
554+
}
555+
tagInfo, err := x.Gerrit.GetTag(ctx, repo.Name, highestRelease)
556+
if err != nil {
557+
return TagRepo{}, fmt.Errorf("reading project %v tag %v: %v", repo.Name, highestRelease, err)
558+
}
559+
if tagInfo.Revision == commit {
560+
repo.Version = highestRelease
561+
return repo, nil
562+
}
563+
repo.Version, err = nextMinor(highestRelease)
564+
if err != nil {
565+
return TagRepo{}, fmt.Errorf("couldn't pick next version for %v: %v", repo.Name, err)
586566
}
587567

588568
// TODO(heschi): delete after first couple uses

0 commit comments

Comments
 (0)