feat(core): Go language support#173
Closed
Saloed wants to merge 32 commits into
Closed
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.