Skip to content

Improve lint job performance - #394

Merged
currantw merged 13 commits into
valkey-io:mainfrom
currantw:currantw/134_improve_lint_performance
May 13, 2026
Merged

Improve lint job performance#394
currantw merged 13 commits into
valkey-io:mainfrom
currantw:currantw/134_improve_lint_performance

Conversation

@currantw

@currantw currantw commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Improve lint job performance by replacing slow tool installations with pre-built binary downloads and adding caching where applicable.

Issue Link

Closes #134.

Features and Behaviour Changes

  • Lint CI job runs faster due to pre-built binary installs instead of compiling from source.
  • cargo clippy uses --locked to skip registry index updates.
  • prettier --write uses --cache for faster local formatting iterations.
  • Lint job timeout reduced from 20 to 10 minutes.

Implementation

  • taiki-e/install-action: Replaces cargo install --locked cargo-deny and the manual actionlint curl/tar download with a single action step that downloads pre-built binaries.
  • go-task/setup-task@v2: Replaces the curl-based Task installation script across all workflows (lint.yml, check-examples.yml, run-coverage/action.yml) with the official GitHub Action from the Task team.
  • --locked on clippy: Prevents Cargo from updating the registry index during lint, saving time on dependency resolution.
  • --cache on prettier: Enables prettier's built-in file hash cache for local format:yaml runs so only changed files are re-checked.

Limitations

⚪ None.

Testing

  • Verified task lint:yaml and task lint:actions pass locally with the updated workflow files.
  • CI will validate the full lint pipeline on this PR.

Related Issues

Checklist

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated and all checks pass.
  • CHANGELOG.md, README.md, DEVELOPER.md, and other documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Summary by CodeRabbit

  • Chores

    • CI now uses pinned setup actions for tooling instead of installer scripts
    • Improved caching and cache keys for faster runs
    • Reduced lint job timeout from 20 to 10 minutes
    • Formatting task now runs with caching for better performance
  • Tests

    • Adjusted integration tests for multi-field expiry command call patterns and assertions

Review Change Stack

currantw added 7 commits May 12, 2026 09:39
Signed-off-by: currantw <taylor.curran@improving.com>
…olution

Signed-off-by: currantw <taylor.curran@improving.com>
Signed-off-by: currantw <taylor.curran@improving.com>
Signed-off-by: currantw <taylor.curran@improving.com>
Signed-off-by: currantw <taylor.curran@improving.com>
…hash expiry

HashFieldGetAndSetExpiryAsync_MultiField and
HashFieldSetAndSetExpiryAsync_MultiField were calling the same
TimeSpan-based overload twice. The second assertion now calls the
DateTime-based overload to cover both signatures.

Signed-off-by: currantw <taylor.curran@improving.com>
Signed-off-by: currantw <taylor.curran@improving.com>
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Workflows/actions switch Task installation to pinned go-task/setup-task; lint workflow timeout, Rust setup/cache, and tool installs are reworked; Taskfile prettier adds --cache; two integration tests updated to call explicit-expiry overloads alongside UnsupportedFlag.

Changes

CI/Build Infrastructure Modernization

Layer / File(s) Summary
Task Installation Modernization
.github/actions/run-coverage/action.yml, .github/workflows/check-examples.yml
The "Install Task" steps switch from executing the installer via curl to using the pinned go-task/setup-task action (v2.0.0 / specific commit).
Lint Workflow Changes
.github/workflows/lint.yml
lint job timeout lowered to 10 minutes; adds an explicit Rust install step; Rust cache key changed to rust-lint-${{ hashFiles('rust/Cargo.toml') }}; cargo-deny and actionlint installs reworked; Task setup switched to go-task/setup-task; final step renamed to "Run lint".
Taskfile formatting option
Taskfile.yml
format:yaml prettier invocation adds --cache while retaining --write and the YAML glob.

Hash CommandFlags Test Updates

Layer / File(s) Summary
Hash CommandFlags multi-field overloads
tests/Valkey.Glide.IntegrationTests/StackExchange/CommandFlagsTests.cs
Two tests (HashFieldGetAndSetExpiryAsync_MultiField_ThrowsOnCommandFlags, HashFieldSetAndSetExpiryAsync_MultiField_ThrowsOnCommandFlags) updated to call overloads that pass DateTime.MinValue together with flags: UnsupportedFlag instead of flags-only overloads.

Sequence Diagram

sequenceDiagram
  participant Runner as GitHub Runner
  participant SetupAction as go-task/setup-task
  participant TaskCLI as task (CLI)
  Runner->>SetupAction: checkout pinned action (v2.0.0 SHA)
  SetupAction->>TaskCLI: provision `task` binary on runner
  Runner->>TaskCLI: run subsequent `task` commands (e.g., `task lint`, `task coverage`)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

🐰
I pinned the steps and nudged the time,
The runner hops to a cleaner rhyme.
Prettier caches, linters hum,
Tests now pass expiry with flags to come. 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive Test file changes in CommandFlagsTests.cs appear unrelated to the stated goal of improving lint job performance and CI workflow optimization. Clarify whether the CommandFlagsTests.cs changes address issue #134 or represent a separate concern that should be split into a different PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Improve lint job performance' directly and concisely describes the main objective of the PR, which aligns with the primary changes throughout the codebase.
Description check ✅ Passed The PR description is comprehensive and includes all required template sections: Summary, Issue Link, Features and Behaviour Changes, Implementation, Limitations, Testing, and Related Issues. The checklist is also properly filled out.
Linked Issues check ✅ Passed The PR successfully addresses the main coding objectives from issue #134: using pre-built binaries via taiki-e/install-action [#134], pinning Task via go-task/setup-task [#134], adding --locked to clippy [#134], and enabling prettier caching [#134]. The commit also pins cargo-deny to v0.19 for CVSS 4.0 support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@currantw currantw self-assigned this May 12, 2026
@currantw currantw added ci CI/CD pipelines and GitHub Actions performance Improves performance release-1.2 labels May 12, 2026
@currantw
currantw requested a review from Copilot May 12, 2026 19:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/lint.yml (1)

47-47: ⚡ Quick win

Add explicit Task CLI version input to go-task/setup-task for reproducible CI behavior.

Line 47 uses go-task/setup-task pinned to action commit dc4f00a24b1b0b5e1a9265f6f4e81d65c0862414 (v2.0.0), but does not specify an explicit Task CLI version via with.version. The action defaults to 3.x, allowing the installed Task version to drift over time. For better reproducibility, add the with.version input with an exact version number. This concern applies to multiple workflow files in this PR (also present in .github/workflows/check-examples.yml).

🔧 Suggested change
             - name: Install Task
               uses: go-task/setup-task@dc4f00a24b1b0b5e1a9265f6f4e81d65c0862414 # v2.0.0
+              with:
+                  version: "3.x"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/lint.yml at line 47, The workflow step using the GitHub
Action reference "uses:
go-task/setup-task@dc4f00a24b1b0b5e1a9265f6f4e81d65c0862414" should explicitly
pin the Task CLI by adding a "with.version" input (e.g., a specific semantic
version like "3.11.0") so the installed Task binary is reproducible; update this
step in .github/workflows/lint.yml (and the same step in
.github/workflows/check-examples.yml) to include the with.version key with an
exact version string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/lint.yml:
- Line 47: The workflow step using the GitHub Action reference "uses:
go-task/setup-task@dc4f00a24b1b0b5e1a9265f6f4e81d65c0862414" should explicitly
pin the Task CLI by adding a "with.version" input (e.g., a specific semantic
version like "3.11.0") so the installed Task binary is reproducible; update this
step in .github/workflows/lint.yml (and the same step in
.github/workflows/check-examples.yml) to include the with.version key with an
exact version string.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 32888c80-f2c5-43e6-be81-872ec1c0a82c

📥 Commits

Reviewing files that changed from the base of the PR and between 9665edd and c76817d.

📒 Files selected for processing (5)
  • .github/actions/run-coverage/action.yml
  • .github/workflows/check-examples.yml
  • .github/workflows/lint.yml
  • Taskfile.yml
  • tests/Valkey.Glide.IntegrationTests/StackExchange/CommandFlagsTests.cs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to speed up CI linting by switching to faster tool installation methods (prebuilt binaries / official setup actions), enabling caching where useful, and tightening the lint job timeout, while also adjusting an integration test to cover the intended multi-field expiry overload.

Changes:

  • Update Rust/YAML lint commands (cargo clippy --locked, prettier --cache) to reduce repeated work.
  • Optimize GitHub Actions lint workflow by using taiki-e/install-action for tool installs and go-task/setup-task for Task installation; reduce lint timeout to 10 minutes.
  • Fix integration tests to exercise the correct multi-field expiry overload when asserting CommandFlags behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Valkey.Glide.IntegrationTests/StackExchange/CommandFlagsTests.cs Adjusts NotImplementedException assertions to call the intended overloads for multi-field expiry methods.
Taskfile.yml Updates Rust clippy invocation and enables Prettier caching for YAML formatting.
.github/workflows/lint.yml Speeds up lint job via prebuilt tool installs, Task setup action, caching tweaks, and reduced timeout.
.github/workflows/check-examples.yml Switches Task installation to go-task/setup-task.
.github/actions/run-coverage/action.yml Switches Task installation to go-task/setup-task inside the composite action.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Taskfile.yml
Comment thread .github/workflows/lint.yml Outdated
Comment thread .github/workflows/lint.yml Outdated
- Revert --locked on cargo clippy (Cargo.lock is gitignored)
- Improve Rust cache key to invalidate when Cargo.toml changes
- Pin actionlint to v1.7.12 for reproducible lint results

Signed-off-by: currantw <taylor.curran@improving.com>
@currantw
currantw requested review from Aryex and xShinnRyuu May 12, 2026 20:03
Comment thread .github/workflows/lint.yml
Comment thread Taskfile.yml
currantw added 2 commits May 12, 2026 13:07
Signed-off-by: currantw <taylor.curran@improving.com>
actionlint is not in taiki-e's supported tools manifest, so version
pinning fails. Use direct curl download instead (pinned to v1.7.12).

Signed-off-by: currantw <taylor.curran@improving.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/lint.yml:
- Around line 39-41: The workflow currently installs cargo-deny without a
version pin (the with: tool: cargo-deny input for
taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1); update that
input to pin cargo-deny to a specific release by changing the tool value to
include an `@version` suffix (e.g., tool: cargo-deny@<SPECIFIC_VERSION>) so CI
uses a deterministic, tested cargo-deny release.
- Line 44: Replace the unverified pipe of the remote tarball with a
download-and-verify flow: fetch actionlint_1.7.12_linux_amd64.tar.gz and its
published checksum (or SHA256 string you add as a trusted constant), verify the
tarball against the checksum (e.g., with sha256sum or openssl dgst) and only
then extract and move actionlint into /usr/local/bin; update the workflow step
that currently runs the inline curl|tar command to perform these download,
verification and conditional-extract steps so the binary is only installed if
the checksum matches.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e52a48c-2aeb-4489-b956-08bf4119d338

📥 Commits

Reviewing files that changed from the base of the PR and between 9d2d452 and 19634ce.

📒 Files selected for processing (1)
  • .github/workflows/lint.yml

Comment thread .github/workflows/lint.yml Outdated
Comment thread .github/workflows/lint.yml Outdated
The advisory database now contains CVSS 4.0 entries which older
cargo-deny versions cannot parse.

Signed-off-by: currantw <taylor.curran@improving.com>
@currantw
currantw enabled auto-merge (squash) May 12, 2026 21:35
@currantw
currantw merged commit 3a8ca54 into valkey-io:main May 13, 2026
14 checks passed
@currantw
currantw deleted the currantw/134_improve_lint_performance branch May 13, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD pipelines and GitHub Actions performance Improves performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve lint job performance

4 participants