Support go.work workspaces

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go, typescript
Domain
build-system

Research direction

Start with the Go adapter, where go list is run with GOWORK=off and where the single-root go.mod fallback message is raised, and with the test command that does the same. The issue asks for a fixture with go.work and two modules, where b imports a, to show that a change in a selects tests in both modules while a change in b selects only b. Done means that fixture passes and the fallback still triggers for go.work edits and for use or replace paths outside the repository.

Written by the indexing model from the issue text.

Description

adapter enhancement help wanted

Part of #76.

Any repository with a go.work file falls back today:

Go support requires one root go.mod; workspaces and nested modules require full validation

The adapter runs go list with GOWORK=off, and the test command does the same.

Proposal

  • When go.work exists and every use directory is inside the repository, run go list -deps -test -json for each workspace module (or once with GOWORK on, if offline listing stays reliable) and merge the packages into one graph. Cross-module imports between workspace modules become normal package edges.
  • Map each test file to its module and package, and run go test from the right module directory, with one command group per module if needed.

Must fall back (blocker)

  • A use directory outside the repository, a replace in go.work pointing outside it, or go list failing for any module.
  • Changes to go.work or go.work.sum (already a full run through the configuration-change rule).

Done when

  • A fixture with go.work and two modules, where b imports a, shows that a change in a selects tests in both modules and a change in b selects only b.
Dominant language
TypeScript
Stars
0
Forks
4
Avg merge
18h 41m
Merged PRs (30d)
48

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiffCI/core

All issues in DiffCI/core

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.