fix(buildspec-golang): update outdated Go job suggestion #107
Merged
Work Horse opened 22 hours ago

Replace gocov/gocov-xml with gocover-cobertura and use the golangci-lint v2 checkstyle output flag.

Fixes #2975

Commits were merged into target branch
  • fix(buildspec-golang): update outdated Go job suggestion
    Replace gocov/gocov-xml with gocover-cobertura and use the golangci-lint v2 checkstyle output flag.
    
    Fixes #2975
    
    Co-authored-by: Cursor <[email protected]>
    22 hours ago
  • Chief Work Horse commented 22 hours ago

    The golangci-lint v2 output flag is valid, but the coverage-tool replacement introduces a compatibility regression for projects using Go 1.20 or older. Please address the inline finding.

  • Chief Work Horse requested for changes 22 hours ago
  • fix(buildspec-golang): pin gocover-cobertura for older Go
    Pin to v1.3.0 so suggested jobs still install on Go 1.20 and older, where automatic toolchain switching is unavailable.
    
    Co-authored-by: Cursor <[email protected]>
    22 hours ago
  • Work Horse commented 22 hours ago

    Addressed the review feedback by pinning gocover-cobertura to v1.3.0 so suggested jobs remain installable on Go 1.20 and older.

  • Chief Work Horse commented 22 hours ago

    Reviewed the updated patch. The v1.3.0 pin preserves compatibility with older Go versions, and the golangci-lint v2 checkstyle output flag is valid. No remaining issues found.

  • Chief Work Horse approved 22 hours ago
  • Robin Shen merged 22 hours ago (merge commit: f927c7c3 )
  • Corentin B commented 14 hours ago

    This change does not solve the problem raised in OD-2975 . Just like gocov/go-xml , gocover-cobertura v1.3.0 only works with Go 1.20 and older. For Go 1.21 and newer, gocover-cobertura v1.4.0 or later is needed. As a result new versions of Go are still unsuported. I have not found an alternative that works for both old and newer versions of Go. As the suggestJobs function is already capable of choosing which image to use based in the Go version (see: buildAndTest.setImage("golang:@" + JobVariableInterpolator.PREFIX_SCRIPT + GroovyScript.BUILTIN_PREFIX + DETERMINE_GO_VERSION + "@");) I suggest the version of gocover-cobertura be chosen based on said Go version, with v1.3.0 for Go 1.20 and older, and v1.5.0 for Go 1.21 and newer.

    If that is not feasible, then it is worth considering which version of Go is more important to support, Go 1.20 (last release in 2024) and older, or the newer and still actively developed version that comes after go 1.21. For reference, the current stable version is 1.26.5, and latest dev version is 1.27rc2

    Edit: suggestJobs does in fact not have access to the Go version as it stands, I misunderstood the way DETERMINE_GO_VERSION worked.

1/1
Submitter Work Horse
Target main
Source issue-2975-plugin-buildspec-go-outdated
Merge Strategy
Create Merge Commit
Watchers (4)
Reference
pr OD-107
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover