Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build/cmd/coordinator: doesn't support trybots on custom branches in golang.org/x repos #37512

Closed
dmitshur opened this issue Feb 27, 2020 · 8 comments
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dmitshur
Copy link
Contributor

There appears to be no support for running trybots on branches other than master and release-branch.goX.Y in golang.org/x repos. It may be a matter of configuring more than 0 builders to run for such branches, or it may require more work in coordinator; this needs investigation.

This happened in https://golang.org/cl/221378, which was a CL into the gopls-release-branch.0.3 branch of golang.org/x/tools repo.

/cc @toothrot @cagedmantis @stamblerre @heschik

@dmitshur dmitshur added Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. FeatureRequest labels Feb 27, 2020
@dmitshur dmitshur added this to the Unreleased milestone Feb 27, 2020
@stamblerre
Copy link
Contributor

I can take a look at implementing this if it's not prioritized. It'd be really helpful to have TryBots run before I make agopls release.

@stamblerre stamblerre self-assigned this Apr 3, 2020
@dmitshur
Copy link
Contributor Author

dmitshur commented Apr 3, 2020

It may be a matter of configuring more than 0 builders to run for such branches, or it may require more work in coordinator; this needs investigation.

It would be helpful to figure out the reason this isn't working now. Feel free to investigate this and update the issue. Once we know what needs to be done, it'll be easier to fix this. Thanks!

@stamblerre
Copy link
Contributor

I'm not very familiar with the code in cmd/coordinator.go, but my suspicion is that https://cs.opensource.google/go/build/+/master:cmd/coordinator/coordinator.go;drc=2c615328112ac3d7af87e5cf172d69f0e1bc8364;l=1205 might be the problem. From what I understand, work.Branch will be something like gopls-release-branch.0.4, while work.GoBranch will contain other branch names that never match. When goRev is empty, newBuild fails, resulting in no TryBots in the set. It seems like it works for x/ repos on master because it matches on "master".

@dmitshur: How do you suggest we fix this issue? Should x/repo branches run only with Go at tip or with previous releases as well?

@dmitshur
Copy link
Contributor Author

dmitshur commented Apr 7, 2020

@stamblerre Thanks for looking into this, that's very helpful.

What you described above sounds plausible. As a next step, let's try to confirm it. When newBuild fails, it prints a "can't create build for ..." message to the logs. We can try starting a trybot run on a "gopls-release-branch.0.4" branch, then check coordinator logs for that message.

Should x/repo branches run only with Go at tip or with previous releases as well?

The current policy explicitly mentions that it applies to "master" branch only:

// For subrepos on the "master" branch, test against prior releases of Go too.

So let's start by fixing this issue so that golang.org/x repo CLs on non-master branches are tested with Go at tip only. Afterwards, we can consider expanding it to cover prior Go releases.

It may be a matter of configuring more than 0 builders to run for such branches, or it may require more work in coordinator

I've checked the dashboard configuration, and it reports that many builders should run for this target configuration:

// +build ignore

package main

import (
	"fmt"

	"golang.org/x/build/dashboard"
)

func main() {
	// TryBuildersForProject returns the builders that should run as part of
	// a TryBot set for the given project.
	// The project argument is of the form "go", "net", "sys", etc.
	// The branch is the branch of that project ("master", "release-branch.go1.12", etc)
	// The goBranch is the branch of Go to use. If proj == "go", then branch == goBranch.
	const (
		proj     = "tools"
		branch   = "gopls-release-branch.0.4"
		goBranch = "master"
	)
	builders := dashboard.TryBuildersForProject(proj, branch, goBranch)
	for _, b := range builders {
		fmt.Println(b.Name)
	}

	// Output:
	// freebsd-amd64-12_0
	// linux-386
	// linux-amd64
	// linux-amd64-race
	// openbsd-amd64-64
	// windows-386-2008
	// windows-amd64-2016
}

Which suggests this is indeed a bug in cmd/coordinator rather than a misconfiguration in x/build/dashboard.

@stamblerre
Copy link
Contributor

Yep, I saw the same thing when I tried writing a test for this. I just triggered TryBots on https://golang.org/cl/227418 - I'm not sure how to see the logs though - would you mind taking a look?

Having the tests run with tip Go sounds reasonable to me. I think I should be able to put together a CL for that.

@gopherbot
Copy link

Change https://golang.org/cl/227397 mentions this issue: cmd/coordinator: support running TryBots on x/ repo branches

@dmitshur
Copy link
Contributor Author

dmitshur commented Apr 7, 2020

I just triggered TryBots on https://golang.org/cl/227418 - I'm not sure how to see the logs though - would you mind taking a look?

Sure. I couldn't see logs far enough back for that CL, but I just sent CL 227444 while tailing logs, and saw this:

2020/04/07 21:39:01 Starting new trybot set for {tools gopls-release-branch.0.4 Idb726bed70bab8880d752f346026b66e1885425c 54a1afaa050ab8df50ca7358372cc305d184717c}
2020/04/07 21:39:01 can't create build for {"freebsd-amd64-12_0" "" "tools" "54a1afaa050ab8df50ca7358372cc305d184717c"}: required field Rev is empty; got {Name:freebsd-amd64-12_0 Rev: SubName:tools SubRev:54a1afaa050ab8df50ca7358372cc305d184717c}
2020/04/07 21:39:01 can't create build for {"linux-386" "" "tools" "54a1afaa050ab8df50ca7358372cc305d184717c"}: required field Rev is empty; got {Name:linux-386 Rev: SubName:tools SubRev:54a1afaa050ab8df50ca7358372cc305d184717c}
2020/04/07 21:39:01 can't create build for {"linux-amd64" "" "tools" "54a1afaa050ab8df50ca7358372cc305d184717c"}: required field Rev is empty; got {Name:linux-amd64 Rev: SubName:tools SubRev:54a1afaa050ab8df50ca7358372cc305d184717c}
2020/04/07 21:39:01 can't create build for {"linux-amd64-race" "" "tools" "54a1afaa050ab8df50ca7358372cc305d184717c"}: required field Rev is empty; got {Name:linux-amd64-race Rev: SubName:tools SubRev:54a1afaa050ab8df50ca7358372cc305d184717c}
2020/04/07 21:39:01 can't create build for {"openbsd-amd64-64" "" "tools" "54a1afaa050ab8df50ca7358372cc305d184717c"}: required field Rev is empty; got {Name:openbsd-amd64-64 Rev: SubName:tools SubRev:54a1afaa050ab8df50ca7358372cc305d184717c}
2020/04/07 21:39:01 can't create build for {"windows-386-2008" "" "tools" "54a1afaa050ab8df50ca7358372cc305d184717c"}: required field Rev is empty; got {Name:windows-386-2008 Rev: SubName:tools SubRev:54a1afaa050ab8df50ca7358372cc305d184717c}
2020/04/07 21:39:01 can't create build for {"windows-amd64-2016" "" "tools" "54a1afaa050ab8df50ca7358372cc305d184717c"}: required field Rev is empty; got {Name:windows-amd64-2016 Rev: SubName:tools SubRev:54a1afaa050ab8df50ca7358372cc305d184717c}

Thank you for making a CL, I'll review it next.

@gopherbot
Copy link

Change https://golang.org/cl/227537 mentions this issue: cmd/coordinator: add test for trybot release-branch.go1.N branch matching

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 8, 2020
gopherbot pushed a commit to golang/build that referenced this issue Apr 8, 2020
…hing

Issue golang.org/issue/28891 was that golang.org/x repo trybots were
always using Go tip, even when testing release-branch.go1.N branches.
It should instead be using Go version 1.N in those situations.

This was fixed in CL 167382. However, that change also caused there
to not be any builder coverage for golang.org/x repo branches other
than "master" and "release-branch.go1.N" ones.

There was no test coverage for that behavior, and we didn't really
have any other branches, so no one noticed. By now, there are some
golang.org/x repos that have other branches, so this was reported
in issue golang.org/issue/37512. Fixing that issue is made harder
because we don't have a regression test for issue 28891 yet.

To make it easier to fix both of these overlapping issues without
having one undo the other, start by adding a test for issue 28891.
CL 227397 fixes issue 37512 and adds a test for it, so hopefully
neither will regress from now on.

For golang/go#28891.
For golang/go#37512.

Change-Id: I3475820a840a25532fb7e722c18b3d0dee3e0734
Reviewed-on: https://go-review.googlesource.com/c/build/+/227537
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
@golang golang locked and limited conversation to collaborators Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants