Skip to content

feat(core): Go language support#173

Closed
Saloed wants to merge 32 commits into
mainfrom
saloed/go-clean
Closed

feat(core): Go language support#173
Saloed wants to merge 32 commits into
mainfrom
saloed/go-clean

Conversation

@Saloed

@Saloed Saloed commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Saloed Saloed force-pushed the saloed/go-clean branch from e36b2ca to db49b9a Compare June 8, 2026 23:11
Saloed added 29 commits June 10, 2026 18:44
…solution, and pull support

Register a new GoServer ArtifactDef (kind "goserver", Unpack:false) and add a
"go-server" key to versions.yaml parsed into globals.GoServerBindVersion.
Add globals.GoServerAssetName() returning go-ssa-server_<GOOS>_<GOARCH>
(+.exe on windows) using raw runtime.GOOS/GOARCH. Add utils.GetGoServerPath
and a public cmd.EnsureGoServerAvailable() that downloads the per-platform
binary if absent, chmod 0755 on unix, and returns the absolute path.
Integrate go-ssa-server into 'opentaint pull'.

Task 02 of go-server-binary-release.
…-bump

Add .github/workflows/publish-go-server.yaml which cross-compiles the
go-ssa-server binary for linux/darwin/windows x amd64/arm64 from a single
ubuntu job (CGO_ENABLED=0, GOOS/GOARCH, -trimpath -ldflags="-s -w") after
regenerating proto/gRPC stubs with protoc + protoc-gen-go@v1.36.1 +
protoc-gen-go-grpc@v1.5.1, and uploads the 6 assets + checksums.txt to the
scoped tag go-server/<version> (plus a floating go-server/latest), mirroring
publish-analyzer.yaml (check-scoped-commits, softprops/action-gh-release@v2,
floating-latest recreation).

Extend update-cli-versions.yaml to resolve the latest go-server/* tag and
patch the existing go-server key in cli/internal/globals/versions.yaml,
mirroring analyzer/autobuilder/rules.

Task 01 of go-server-binary-release.
…nused permission

update-cli-versions.yaml: remove go-server from the mandatory empty-check hard-fail and guard the go-server read/diff/patch with [ -n "$GO_SERVER" ] so a missing go-server/* tag no longer fails the job (which regressed analyzer/autobuilder/rules auto-bump). analyzer/autobuilder/rules behavior unchanged.

publish-go-server.yaml: tighten permissions to only contents: write (packages: write was unused).
…go-server-binary override

For Go projects (validation.IsGoProject), the scan command now runs a friendly
preflight that fails early with an actionable message when the go toolchain is
absent, resolves the go-ssa-server binary via EnsureGoServerAvailable(), and
passes its absolute path to the analyzer JAR run through the new
JavaRunner.WithExtraEnv API as GOIR_SERVER_BINARY. Non-Go scans are unaffected
(no download, no env var, no preflight) and --dry-run stays side-effect-free.

Adds the --go-server-binary dev-override flag (mirrors --analyzer-jar): when set,
EnsureGoServerAvailable() validates the path, returns its absolute form, and
skips download/manifest-tag/chmod.
…ver-binary override

Regression tests for Task 03 (f4a4700):
- validation.IsGoProject: go.mod true; pom.xml/empty/missing false; nested go.mod within depth.
- java.WithExtraEnv: nil/empty no-op, merge with later-wins; extra env reaches the child on System (seeded from os.Environ, inherited vars preserved) and Specific (after clean env) strategies via a TestHelperProcess re-exec.
- EnsureGoServerAvailable: --go-server-binary override returns absolute path with no download; errors on missing path.
…g, tests

Export validation.DetectLanguages wrapping the unexported detectLanguages so
scan.go can tell Go-only from polyglot projects. Hoist the Go/go-toolchain
decision to just after the --dry-run early return: Go-only + missing go now
hard-fails before the autobuilder compile and analyzer download, while polyglot
+ missing go warns and skips Go wiring (no fatal, no download). The go preflight
is independent of --go-server-binary. Binary resolution + GOIR_SERVER_BINARY env
injection stay at the analyzer-runner build site, guarded by needGoServer.

Harden EnsureGoServerAvailable override: reject a directory and, on non-windows,
a non-executable file (chmod +x hint); still filepath.Abs, no chmod, no download.

Add polyglot DetectLanguages tests and an override-directory regression test.
@Saloed Saloed force-pushed the saloed/go-clean branch from 5428077 to e7bdc36 Compare June 10, 2026 15:44
@Saloed Saloed closed this Jun 10, 2026
@Saloed Saloed deleted the saloed/go-clean branch June 10, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant