dynamically maintain list of packages (directories)

Opendmitshur opened this issue 3 years ago
dmitshur commented 3 years ago · edited

Right now, the list of packages is computed at code writing time by using the go list command, and writing the result to a map in packages.go file.

This has three problems:

  • it's missing some valid packages (with issues filed) that are hidden via build constraints
  • it's missing some previously-valid packages (with issues filed) that got moved/removed at latest version
  • it requires manual re-generation, which happens rarely, and the list is therefore often stale

It would be better to have this list of packages (directories, really) to be maintained dynamically.

This can be implemented by watching the relevant git repositories with source code for new commits to the master branch, and the release branches for the supported versions of Go (i.e., current and previous releases), and walking the tree to find all directories that exist.

Write Preview Markdown
dmitshur commented 2 years ago · edited

Commit 5275a64a has made this better. Directories are now determined by walking Go repositories at process start up.

What's left is to do it continuously while the process is running, rather than once at start up only.

Write Preview Markdown
dmitshur commented 2 years ago

Another place that can be made better is the list of release branches in initExistingDirectories. It's currently hard-coded, but should be automated:

func initExistingDirectories() error {
	// ...
	for _, branch := range []string{"master", "release-branch.go1.12", "release-branch.go1.11"} {
	// ...
Write Preview Markdown
to comment.