Scope go:generate, cgo, assembly and plugin fallbacks to the affected package

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
go, typescript
Domain
tooling

Research direction

Start in src/repo/adapters/go.ts at analyzeGoMetadata, then read AdapterContribution in src/repo/adapters/types.ts and the vue.ts usage of subjectBlockers / fileBlockers. Trace how the current global blockers list forces fallback, and identify the existing fixture setup for adapter tests. Done when fixtures prove a change in package a stays selective when unrelated package b has //go:generate or cgo files, while a change in b or its dependents still falls back; //go:linkname remains global.

Written by the indexing model from the issue text.

Description

adapter enhancement help wanted

Part of #76.

analyzeGoMetadata in src/repo/adapters/go.ts pushes these to the global blockers list:

  • Go <pkg>: cgo dependencies require full validation
  • Go <pkg>: native assembly/object dependencies require full validation
  • Go <pkg>: runtime plugins require full validation
  • Go <file>: generated or linked dependencies require full validation

A global blocker makes every change fall back, so one //go:generate stringer or mockgen line anywhere disables selection for the whole repository. Most medium-sized Go repositories have at least one.

Proposal

  • Report these through subjectBlockers / fileBlockers (see AdapterContribution in src/repo/adapters/types.ts and how vue.ts uses them). Changes that can't reach the package then stay selective.
  • //go:generate: the generated output is usually committed, so go list already sees it as a normal source. Fall back only when the file with the directive, or the generator's inputs, change.
  • //go:linkname: keep a global blocker. It can reach into any package, so scoping isn't safe.

Must fall back (blocker)

  • A change to a package with cgo/assembly/plugin, or to anything that reaches it.
  • Any //go:linkname use (still global).

Done when

  • Fixtures show that a change in package a stays selective when unrelated package b has a //go:generate line or cgo files, and that a change in b (or a package b imports) still falls back.
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.