Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: jlumbroso/free-disk-space@v1.3.1

- uses: actions/checkout@v6

- name: setup Go
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@ on:
pull_request:

jobs:
precommit:
name: Pre-commit Gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: j178/prek-action@v2

lint-gate:
name: Lint Gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Check if .pre-commit-config.yaml exists and find golangci-lint version
fd -name ".pre-commit-config.yaml" -exec cat {} \;

Repository: devsy-org/devsy

Length of output: 289


🏁 Script executed:

# Read the pr-ci.yml file around line 32
cat -n .github/workflows/pr-ci.yml | sed -n '25,40p'

Repository: devsy-org/devsy

Length of output: 560


🏁 Script executed:

cat .pre-commit-config.yaml

Repository: devsy-org/devsy

Length of output: 1837


Pin golangci-lint to a specific version to ensure reproducible CI.

Using version: latest makes CI non-deterministic: an upstream release can fail previously-green PRs without any code changes. Pin to v2.11.4 to match the version already declared in .pre-commit-config.yaml, ensuring consistent linting across both pre-commit and CI gates.

Proposed change
       - name: golangci-lint
         uses: golangci/golangci-lint-action@v9
         with:
-          version: latest
+          version: v2.11.4
           only-new-issues: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
version: latest
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.11.4
only-new-issues: true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-ci.yml at line 32, Replace the non-deterministic
"version: latest" setting in the CI workflow with the pinned golangci-lint
release used by pre-commit; update the workflow entry that currently contains
the literal "version: latest" to use "v2.11.4" so the CI linter matches the
version in .pre-commit-config.yaml and yields reproducible linting results.

only-new-issues: true
Comment on lines +10 to +33

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Redundant golangci-lint execution between precommit and lint-gate.

Per .pre-commit-config.yaml (lines 56–60 in the provided context), the golangci-lint and golangci-lint-fmt hooks are configured as pre-commit hooks, which means j178/prek-action@v2 in the precommit job will already run golangci-lint. The separate lint-gate job then runs it again via golangci/golangci-lint-action@v9. This doubles CI time for Go linting and, worse, the two paths can disagree: the pre-commit hook pins v2.11.4 while the action uses version: latest, so a new upstream release can cause one gate to pass and the other to fail on the same SHA.

Recommendation: pick one source of truth. Either

  • drop the golangci-lint/golangci-lint-fmt hooks from .pre-commit-config.yaml and keep lint-gate, or
  • drop lint-gate and rely solely on the pre-commit hook (then build-ui/build-cli only need needs: [precommit]).

If you keep both, at minimum align the golangci-lint version between them.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-ci.yml around lines 10 - 33, The CI currently runs
golangci-lint twice (once via the precommit job using j178/prek-action@v2 which
invokes the golangci-lint pre-commit hooks, and again in the lint-gate job using
golangci/golangci-lint-action@v9), causing duplicated work and potential version
mismatches; resolve by choosing one source of truth: either remove the
golangci-lint and golangci-lint-fmt hooks from .pre-commit-config.yaml and keep
the lint-gate job, or remove the lint-gate job entirely and make
build-ui/build-cli depend on precommit (needs: [precommit]); if you must keep
both, ensure the golangci-lint version is pinned and consistent between the
precommit hooks and the lint-gate action (align versions in the pre-commit
config and the lint-gate job).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

only-new-issues: true also applies on push to main.

This workflow triggers on both pull_request and push: branches: [main] (line 4–5). only-new-issues is designed for PR diffs; on push events it can silently suppress findings you would expect the gate to catch. If the intent is to use this only as a PR gate, consider gating the flag on event type, or scope lint-gate to pull_request only (the standalone lint.yml workflow can continue covering push-to-main).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-ci.yml at line 33, The workflow sets only-new-issues:
true globally which also affects push events; change it so the flag only applies
for PR runs: either move the lint-gate job (or the only-new-issues key) to run
only for pull_request events (make the lint-gate job's runs-on/if conditional
target pull_request) or add an if-condition on the job that checks
github.event_name == 'pull_request' and only sets/enables only-new-issues in
that branch; refer to the only-new-issues setting and the lint-gate job name in
your changes.


can-read-secret:
name: Can Read Secret
runs-on: ubuntu-latest
Expand All @@ -24,6 +49,7 @@ jobs:

build-ui:
name: User Interface Build
needs: [precommit, lint-gate]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -55,6 +81,7 @@ jobs:

build-cli:
name: Build CLI Binary on ${{ matrix.runner }}
needs: [precommit, lint-gate]
strategy:
matrix:
include:
Expand Down
27 changes: 1 addition & 26 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,4 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: biomejs/setup-biome@v2

- uses: actions/setup-python@v6
with:
cache: pip
python-version: 3.x

- run: pip install -r requirements.txt

- uses: actions/setup-go@v6
with:
go-version-file: go.mod

- uses: golangci/golangci-lint-action@v9
with:
version: latest
install-only: true

- run: go install golang.org/x/tools/cmd/goimports@latest

- uses: actions/cache@v5
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- run: pre-commit run --all-files
- uses: j178/prek-action@v2
Loading