← Back to Pull requests

refactor(.github/workflows/ci.yaml): Update golangci-lint to v2.0 and modify .golangci.yaml #1002

Closed
unknown closed this pull request without merging on Apr 15, 2025 05:41 UTC
View on GitHub
unknown unknown commented on Apr 14, 2025 01:22 UTC
Author

What type of PR is this?
/kind cleanup
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
-->

What this PR does / why we need it:
This pull request includes several important changes to improve the linting process, update dependencies, and refactor code for better readability and maintainability. Below are the most significant changes:

Linting and Dependency Updates:

Updated the CI workflow to use golangci-lint-action version 2.0 for linting instead of running make lint directly. (.github/workflows/ci.yaml)
Updated golangci-lint to version 2.1.1 in hack/verify-staticcheck.sh and changed the installation method to use the latest script from the repository's HEAD. (hack/verify-staticcheck.sh) [[1]](diffhunk://#diff-dd4a155c58c25cd819d2b0025bf96bba44cd82f6dc4aad132fa48b7ec9ab3bb7L21-R21) [[2]](diffhunk://#diff-dd4a155c58c25cd819d2b0025bf96bba44cd82f6dc4aad132fa48b7ec9ab3bb7L32-R32)

Configuration Changes:

Refactored the .golangci.yaml file to update the configuration format, enable specific linters, and set new linter settings. (.golangci.yaml) [[1]](diffhunk://#diff-9917ddc9f1c3304218f7269265b746d997c5c0615478177b5fceecd33ef47cb5R1-L37) [[2]](diffhunk://#diff-9917ddc9f1c3304218f7269265b746d997c5c0615478177b5fceecd33ef47cb5R34-R88)

Code Refactoring:

Replaced prometheus.NewProcessCollector and prometheus.NewGoCollector with collectors.NewProcessCollector and collectors.NewGoCollector in cmd/vGPUmonitor/testcollector/main.go for better alignment with the Prometheus client library. (cmd/vGPUmonitor/testcollector/main.go)
Simplified string formatting in pkg/device/metax/protocol.go by removing unnecessary fmt.Sprintf call. (pkg/device/metax/protocol.go)

Annotation Handling:

Simplified access to node annotations by removing ObjectMeta in pkg/device/cambricon/device.go and pkg/util/nodelock/nodelock.go. [[1]](diffhunk://#diff-18913db9fdb46323a9ebfa1c20bc35d6d05a0ab7948f00e1a2b4d1e953f90bc2L92-R92) [[2]](diffhunk://#diff-18913db9fdb46323a9ebfa1c20bc35d6d05a0ab7948f00e1a2b4d1e953f90bc2L130-R133) [[3]](diffhunk://#diff-18913db9fdb46323a9ebfa1c20bc35d6d05a0ab7948f00e1a2b4d1e953f90bc2L159-R159) [[4]](diffhunk://#diff-18913db9fdb46323a9ebfa1c20bc35d6d05a0ab7948f00e1a2b4d1e953f90bc2L169-R169) [[5]](diffhunk://#diff-d802746cca60362723c9835a0f621444a2a7dd925e12345f8dfacf50dec319f4L49-R53) [[6]](diffhunk://#diff-d802746cca60362723c9835a0f621444a2a7dd925e12345f8dfacf50dec319f4L64-R64) [[7]](diffhunk://#diff-d802746cca60362723c9835a0f621444a2a7dd925e12345f8dfacf50dec319f4L82-R82) [[8]](diffhunk://#diff-d802746cca60362723c9835a0f621444a2a7dd925e12345f8dfacf50dec319f4L91-R91) [[9]](diffhunk://#diff-d802746cca60362723c9835a0f621444a2a7dd925e12345f8dfacf50dec319f4L102-R102) [[10]](diffhunk://#diff-d802746cca60362723c9835a0f621444a2a7dd925e12345f8dfacf50dec319f4L118-R121)

Testing Improvements:

  • Improved error handling in test cases by replacing t.Error with t.Fatalf for better test failure reporting in pkg/device/nvidia/device_test.go. (pkg/device/nvidia/device_test.go)
  • These changes collectively enhance the project's code quality, maintainability, and alignment with best practices.

    Which issue(s) this PR fixes:
    Fixes #

    Special notes for your reviewer:

    Does this PR introduce a user-facing change?:

    Diff: 437 lines (+327 / -110) across 5 files Reviewer: wawa0210 Review duration: 1699m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.45) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 437 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.364
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1002"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.2% (MEDIUM) · Higher = larger blast radius
    45.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.6% · Safe to merge
    19.6%