Skip to content

Conversation

junhaoliao
Copy link
Member

@junhaoliao junhaoliao commented Jun 16, 2025

Description

As the title suggests

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Repeated the reproduction steps in #68 with the intended checksum exclude path passed in an array to CHECKSUM_EXCLUDE_PATTERNS and observed the task core logic did not get re-run.

Summary by CodeRabbit

  • New Features
    • Added an optional parameter to exclude specified files or directories from checksum validation when downloading and extracting tar or zip archives.
    • Introduced a new test to ensure consistent checksum results when excluding files from both extraction and checksum calculation.

…tasks to exclude paths in checksum calculations.
@junhaoliao junhaoliao requested a review from a team as a code owner June 16, 2025 20:11
Copy link
Contributor

coderabbitai bot commented Jun 16, 2025

Walkthrough

A new optional parameter, CHECKSUM_EXCLUDE_PATTERNS, has been added to the download-and-extract-tar and download-and-extract-zip tasks. This parameter allows users to specify path patterns to exclude from checksum computations during archive extraction. Associated documentation and variable declarations have been updated accordingly. A new test task was added to validate this functionality for zip archives.

Changes

File(s) Change Summary
exports/taskfiles/utils/remote.yaml Added CHECKSUM_EXCLUDE_PATTERNS parameter to download-and-extract-tar and download-and-extract-zip tasks; updated documentation and checksum-related steps to use this exclusion list.
taskfiles/remote/tests.yaml Added test task download-and-extract-zip-test-checksum-exclude to verify checksum exclusion patterns work correctly with zip extraction and checksum comparison.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Task (download-and-extract-tar/zip)
    participant Checksum Validator

    User->>Task (download-and-extract-tar/zip): Provide URL, OUTPUT_DIR, (optional) CHECKSUM_EXCLUDE_PATTERNS
    Task (download-and-extract-tar/zip)->>Task (download-and-extract-tar/zip): Download and extract archive
    Task (download-and-extract-tar/zip)->>Checksum Validator: Compute/validate checksum, excluding patterns in CHECKSUM_EXCLUDE_PATTERNS
    Checksum Validator-->>Task (download-and-extract-tar/zip): Return checksum result
    Task (download-and-extract-tar/zip)-->>User: Extraction and checksum status
Loading

Possibly related PRs

Suggested reviewers

  • kirkrodrigues
  • davidlion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

Would you mind adding a test to taskfiles/remote/tests.yaml?

Comment on lines +61 to +62
# @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS] Path wildcard patterns, relative to `OUTPUT_DIR`,
# to exclude from the checksum.
Copy link
Member

Choose a reason for hiding this comment

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

Hm, are they relative to OUTPUT_DIR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, CHECKSUM_EXCLUDE_PATTERNS is relative to OUTPUT_DIR. By looking at the checksum:validate task's docstring:

# @param {string[]} [EXCLUDE_PATTERNS] Path wildcard patterns, relative to any `INCLUDE_PATTERNS`,
# to exclude from the checksum.

Since OUTPUT_DIR is passed as one of the INCLUDE_PATTERNS to the checksum tasks, and the docstring states that EXCLUDE_PATTERNS are "relative to any INCLUDE_PATTERNS", the CHECKSUM_EXCLUDE_PATTERNS are indeed relative to OUTPUT_DIR.

or are you saying that this can be better expressed?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, no, I just got confused with INCLUDE_PATTERNS.

@junhaoliao junhaoliao requested a review from kirkrodrigues June 17, 2025 04:19
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5917644 and 0c650e9.

📒 Files selected for processing (1)
  • taskfiles/remote/tests.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: unit-tests (ubuntu-22.04)
  • GitHub Check: unit-tests (ubuntu-24.04)
🔇 Additional comments (2)
taskfiles/remote/tests.yaml (2)

86-94: Well-structured new test task for checksum exclusion.

The download-and-extract-zip-test-checksum-exclude task is clearly defined with its own OUTPUT_DIR and CHECKSUM_FILE vars, matching the pattern of the other zip tests.


106-121: Checksum comparison logic is clear and robust.

Moving the first checksum file to .ref and then diffing against the second run is a simple, effective validation of the new CHECKSUM_EXCLUDE_PATTERNS feature.

Comment on lines +95 to +105
# Download the zip file, extract all files, and compute the checksum with some exclude
# patterns.
- task: "remote:download-and-extract-zip"
vars:
CHECKSUM_EXCLUDE_PATTERNS: &checksum_exclude_patterns
- ".github/CODEOWNERS"
- ".github/PULL_REQUEST_TEMPLATE.md"
OUTPUT_DIR: "{{.OUTPUT_DIR}}"
URL: "{{.G_TEST_ZIP_FILE_URL}}"
FILE_SHA256: "{{.G_TEST_ZIP_FILE_SHA256}}"
- "mv '{{.CHECKSUM_FILE}}' '{{.CHECKSUM_FILE}}.ref'"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

❓ Verification inconclusive

Ensure checksum exclude patterns align with extracted file paths.

The anchored patterns ".github/CODEOWNERS" and ".github/PULL_REQUEST_TEMPLATE.md" may not match the top-level folder prefix (e.g. yscope-dev-utils-main/.github/...). To guarantee the exclude rules apply both during extraction and in checksum computation, update the anchor to use a wildcard or reference the existing vars:

  vars:
-   CHECKSUM_EXCLUDE_PATTERNS: &checksum_exclude_patterns
-     - ".github/CODEOWNERS"
-     - ".github/PULL_REQUEST_TEMPLATE.md"
+   CHECKSUM_EXCLUDE_PATTERNS: &checksum_exclude_patterns
+     - "*/.github/CODEOWNERS"
+     - "*/.github/PULL_REQUEST_TEMPLATE.md"

Run a quick grep on the extracted directory name to confirm your anchors match:


🏁 Script executed:

rg -A1 'yscope-dev-utils-main' -g '*.md'

Length of output: 40


Ensure checksum exclude patterns align with extracted file paths.

The anchored patterns ".github/CODEOWNERS" and ".github/PULL_REQUEST_TEMPLATE.md" may not match the top-level folder prefix (e.g. yscope-dev-utils-main/.github/...). To guarantee the exclude rules apply both during extraction and in checksum computation, update the anchor to use a wildcard or reference the existing vars:

  vars:
-   CHECKSUM_EXCLUDE_PATTERNS: &checksum_exclude_patterns
-     - ".github/CODEOWNERS"
-     - ".github/PULL_REQUEST_TEMPLATE.md"
+   CHECKSUM_EXCLUDE_PATTERNS: &checksum_exclude_patterns
+     - "*/.github/CODEOWNERS"
+     - "*/.github/PULL_REQUEST_TEMPLATE.md"

Run a quick grep on the extracted directory name to confirm your anchors match:

rg -A1 'yscope-dev-utils-main' -g '*.md'
🤖 Prompt for AI Agents
In taskfiles/remote/tests.yaml around lines 95 to 105, the anchored checksum
exclude patterns do not account for the top-level extracted folder prefix,
causing mismatches during checksum computation. Update the
CHECKSUM_EXCLUDE_PATTERNS anchor to include a wildcard prefix (e.g.,
"yscope-dev-utils-main/.github/CODEOWNERS") or adjust the patterns to match the
actual extracted file paths. Verify the updated patterns by running a grep or
ripgrep command on the extracted directory to ensure they correctly exclude the
intended files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants