Repository: go
Issue: proposal: decide policy for sub-repositories
Labels: Proposal

[this is not a proposal yet, just a problem statement]

There are several proposals to add new packages to the `x/foo` "sub-repositories". (See: #16353, #13432, #12332, #16257, #15985, #15406, and more.) The proposals are all different, but they circle around the same issue: what should and should not be in a sub-repository.

Currently, the sub-repositories contain x different things:
1. Packages and tools that are part of a loose set of Go tools (godoc, goimports, benchcmp, x/debug, etc)
2. Packages and tools that support the Go web services (godoc, present, x/playground, x/tour, etc)
3. Tools that support Go project development (x/build, x/benchmarks, x/review, etc).
4. Packages that augment the standard library (x/text, x/image, x/crypto, x/sys, etc).
5. Other projects worked on by Go team members at Google (x/exp, x/mobile, etc).

To me, it's clear that 1-2 belong in the sub-repositories, and should be an official part of the Go project.

For 4-5, this code only lives in the sub-repositories either for historical reasons or mere convenience. The Go contributors are accustomed to the process (tools and reviews) of writing code in that style, so the sub-repos were just the obvious place to go.

(3 is a fringe case, as the tools could be worked on elsewhere, but the people working on them work on Go full time and work on that code solely to support the project, so I am inclined to ignore this code for the purposes of this issue.)

As the project grows, it attracts people who want to contribute new packages to these sub-repositories (see the issues cited at the beginning of this issue). The reasons for inclusion include:
1. To provide an official package for doing X.
2. To provide a supported package for doing X.
3. To contribute to the Go project.
4. To use the project's development processes (gerrit, etc).
5. To have their code reviewed by other Go contributors and to benefit from their expertise.
6. To use the same consistent license (with CLA) that the project uses.
7. To provide a single package for a single purpose, and avoid duplicate effort.
8. To provide an official package for interoperating about (but not necessarily doing) X.
9. To act as a dependency for something else under x/.

[What are the other reasons? I'd like to enumerate them all here.]

---

My opinion begins here:

None of the above reasons are good arguments to add new packages to the sub-repositories. Taking each in turn:
1. The "official" packages, such as they are, are generally of high quality because a small group of dedicated contributors have invested constant energy in them. But there are other high quality packages elsewhere in the Go ecosystem (many of higher quality than some of those in the sub-repos), it's just harder for people to find them and they don't have "prestigious" import paths. Rather than moving more stuff into the Go project, _I'd think we should address this issue by making it easier to find and recognize high quality packages._ (One way to do this is to improve godoc.org, but there are many other ways.)
2. Putting something in the sub-repositories does not imply support. People are not more or less inclined to work on a package just because it's in a sub-repository. The current set of Go contributors are stretched pretty thin as it is. I think that _by moving more stuff into the sub-repositories we set expectations of support where there is none._ That's bad for our users.
3. Moving more code into the project just for the sake of contributing is _not a net win_. There's plenty of work to be done on the code that is already part of the project (and the many, many open issues).
4. If people want to use our processes, I think that a better approach is to _find a way to use those processes outside of the project_. That's a solution that scales much better.

[see discussion below for other points]

In general, I'd like to make the Go project smaller rather than bigger. (In the same sense that we would remove stuff from the standard library, if we could.)

As I said, this is just my opinion and perspective. I have created this issue to gather feedback from other [potential] contributors.

Personal opinion ends.

---

We need to set a policy for what belongs in the sub-repositories, and in doing so more clearly define the boundaries of the Go project.