feat(remote): Add checksum path filters for download and extract tasks (fixes #68).#113
Conversation
WalkthroughThe tar and zip extraction tasks now accept Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
junhaoliao
left a comment
There was a problem hiding this comment.
let's refer to #69 and add tests to cover those parameters
the title should include (resolves #68).
junhaoliao
left a comment
There was a problem hiding this comment.
waiting for tests to be ported over then this is good to go
junhaoliao
left a comment
There was a problem hiding this comment.
the rest lgtm. just docstring issues
| # @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS=[]] Path wildcard patterns, relative to any | ||
| # `CHECKSUM_INCLUDE_PATTERNS`, to exclude from the checksum. |
There was a problem hiding this comment.
the "relative to any CHECKSUM_INCLUDE_PATTERNS" wording seems ambiguous. since whether CHECKSUM_INCLUDE_PATTERNS is specified or not, those patterns will be excluded, i think it's fine to remove the wording to avoid confusion?
| # @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS=[]] Path wildcard patterns, relative to any | |
| # `CHECKSUM_INCLUDE_PATTERNS`, to exclude from the checksum. | |
| # @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS=[]] Path wildcard patterns to exclude from the | |
| # checksum computation. |
| # @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS=[]] Path wildcard patterns, relative to any | ||
| # `CHECKSUM_INCLUDE_PATTERNS`, to exclude from the checksum. |
There was a problem hiding this comment.
| # @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS=[]] Path wildcard patterns, relative to any | |
| # `CHECKSUM_INCLUDE_PATTERNS`, to exclude from the checksum. | |
| # @param {string[]} [CHECKSUM_EXCLUDE_PATTERNS=[]] Path wildcard patterns to exclude from the | |
| # checksum computation. |
| FILE_SHA256: "{{.G_TEST_ZIP_FILE_SHA256}}" | ||
|
|
||
| # Test that the checksums from the two cases match | ||
| - "diff -q '{{.CHECKSUM_FILE_0}}' '{{.CHECKSUM_FILE_1}}'" |
There was a problem hiding this comment.
seems we prefer using cmp in the utils?
| - "diff -q '{{.CHECKSUM_FILE_0}}' '{{.CHECKSUM_FILE_1}}'" | |
| - "cmp -s '{{.CHECKSUM_FILE_0}}' '{{.CHECKSUM_FILE_1}}'" |
| URL: "{{.G_TEST_ZIP_FILE_URL}}" | ||
| FILE_SHA256: "{{.G_TEST_ZIP_FILE_SHA256}}" | ||
|
|
||
| # Case 1: Eexclude the same paths during extraction, and compute the checksum of the whole |
There was a problem hiding this comment.
| # Case 1: Eexclude the same paths during extraction, and compute the checksum of the whole | |
| # Case 1: Exclude the same paths during extraction, and compute the checksum of the whole |
Description
(closes #69 )
For
npmpackages, sometimes we only want to checksum a subset of the downloaded source, or ignorein-place updates in known locations such as
node_modules.node_modulesshould live inside the source tree because package managers likenpmandYarninstall relative to the project root, and many tools assume this layout.However, these updates can cause checksum drift. Adding
CHECKSUM_EXCLUDE_PATTERNSto download and extract tasks is the most direct and practical way to handle this. Beyondnode_modules, it can filter out build outputs, caches, logs, generated docs, and other nonessential files that do not affect the core content of the source tree.Alongside this, we introduce
CHECKSUM_INCLUDE_PATTERNSfor completeness, but it is more narrow in scope. It is useful when only a small, well defined portion of a larger directory is the actual artifact of interest and the rest is generated. Currently, it defaults to the entire extraction output directory, preserving the original behavior before this PR.Checklist
breaking change.
Validation performed
Summary by CodeRabbit
New Features
Tests