fix(buildspec-golang): update outdated Go job suggestion #107
Merged
Work Horse opened 1 month 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]>
    1 month ago
  • Unknown commented 1 month 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.

  • Unknown requested for changes 1 month 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]>
    1 month ago
  • Work Horse commented 1 month ago

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

  • Unknown commented 1 month 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.

  • Unknown approved 1 month ago
  • Robin Shen merged 1 month ago (merge commit: f927c7c3 )
  • Corentin B commented 1 month 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 (3)
Reference
PR OD-107
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover