-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: replace the bazelisk, disk and repo cache with sticky disks #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 7e07ea7 in 1 minute and 31 seconds
More details
- Looked at
423
lines of code in6
files - Skipped
8
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. config.js:44
- Draft comment:
The change fromdiskCacheName !== 'true'
todiskCacheConfig !== 'true'
is a bug fix. The original condition was incorrect as it was checking the wrong variable. This change ensures the logic aligns with the intended behavior. - Reason this comment was not posted:
Comment did not seem useful.
2. index.js:150
- Draft comment:
UsingsetTimeout
with an async function is incorrect as it does not await the async function. Consider refactoring to ensure the async function is awaited properly. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_PHoPQPG1NLdBKSUN
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
7e07ea7
to
2ff84e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 2ff84e4 in 57 seconds
More details
- Looked at
937
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. post.js:14
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process abruptly, potentially skipping pending asynchronous operations. Let the process exit naturally instead. - Reason this comment was not posted:
Comment was on unchanged code.
2. util.js:9
- Draft comment:
Consider using asynchronous methods instead oflstatSync
to avoid blocking the event loop, especially if this function is used in a performance-sensitive context. - Reason this comment was not posted:
Comment was on unchanged code.
3. stickydisk.js:83
- Draft comment:
Ensure to clear the timeout if the operation completes before the timeout duration to avoid unnecessary operations. - Reason this comment was not posted:
Comment did not seem useful.
4. index.js:151
- Draft comment:
Consider using a promise-based approach withsetTimeout
for better control over asynchronous execution. - Reason this comment was not posted:
Confidence changes required:50%
Inindex.js
, theloadStickyDisk
function usessetTimeout
with a callback function. This can lead to unexpected behavior if the callback is not executed in the intended context. Consider usingsetTimeout
with a promise-based approach for better control.
Workflow ID: wflow_1rXi9mjrjZnnDNvK
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
2ff84e4
to
d32fc67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on d32fc67 in 55 seconds
More details
- Looked at
942
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. post.js:14
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process abruptly, potentially skipping pending operations. Let the process exit naturally instead. - Reason this comment was not posted:
Comment was on unchanged code.
2. stickydisk.js:106
- Draft comment:
Consider reusing a single client instance forcreateStickyDiskClient()
to avoid creating a new client for each call. - Reason this comment was not posted:
Confidence changes required:50%
ThecommitStickydisk
andcleanupStickyDiskWithoutCommit
functions instickydisk.js
both usecreateStickyDiskClient()
to create a new client for each call. This could be optimized by reusing a single client instance if possible.
3. stickydisk.js:46
- Draft comment:
Ensure thedevice
variable is properly sanitized to prevent command injection vulnerabilities when usingexecAsync
. - Reason this comment was not posted:
Comment did not seem useful.
4. index.js:154
- Draft comment:
Ensure that the files specified forglob.hashFiles
are correct and that the hashing process is efficient for large file sets. - Reason this comment was not posted:
Confidence changes required:50%
Inindex.js
, theloadStickyDisk
function usesglob.hashFiles
to generate a hash. Ensure that the files being hashed are correctly specified and that the hashing process is efficient for large file sets.
Workflow ID: wflow_ZICKE5FviSMhcoSB
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
try { | ||
// Check if path is mounted | ||
try { | ||
const { stdout: mountOutput } = await execAsync(`mount | grep ${path}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using grep
to check if a path is mounted is not portable across different OS. Consider using a cross-platform method.
d32fc67
to
7276e91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 7276e91 in 51 seconds
More details
- Looked at
941
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. post.js:13
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process abruptly, potentially skipping pending asynchronous operations. Let the process exit naturally instead. - Reason this comment was not posted:
Comment was on unchanged code.
2. stickydisk.js:21
- Draft comment:
Consider using a configuration object or module to manage environment variables instead of directly accessingprocess.env
. This improves testability and maintainability. - Reason this comment was not posted:
Confidence changes required:50%
ThegetStickyDisk
function instickydisk.js
usesprocess.env
to access environment variables. It would be more robust to use a configuration object or a dedicated configuration module to manage these variables, making the code more testable and maintainable.
3. stickydisk.js:164
- Draft comment:
Consider making the retry delay inunmountAndCommitStickyDisk
configurable to allow flexibility in handling different environments or conditions. - Reason this comment was not posted:
Confidence changes required:40%
TheunmountAndCommitStickyDisk
function instickydisk.js
uses a loop with retries for unmounting. It would be beneficial to add a delay between retries to avoid rapid consecutive attempts, which is already done but could be more configurable.
4. index.js:150
- Draft comment:
Consider using a structured backoff strategy, like exponential backoff, instead of a random delay to handle contention more effectively. - Reason this comment was not posted:
Confidence changes required:50%
TheloadStickyDisk
function inindex.js
usessetTimeout
with a random delay to reduce contention. This approach can be improved by using a more structured backoff strategy, such as exponential backoff, to handle contention more effectively.
5. __tests__/restore-cache.test.js:34
- Draft comment:
Consolidate thejest.mock
setup for@actions/core
to avoid repetition and improve clarity. - Reason this comment was not posted:
Confidence changes required:30%
Thejest.mock
for@actions/core
inrestore-cache.test.js
is repeated twice, which is unnecessary and can lead to confusion. Consolidating the mock setup would improve clarity and maintainability.
Workflow ID: wflow_fZo4EhYog6Ox6aDe
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
7276e91
to
0a80e72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 0a80e72 in 1 minute and 38 seconds
More details
- Looked at
942
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. post.js:13
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process abruptly, potentially skipping pending operations. Let the process exit naturally instead. - Reason this comment was not posted:
Comment was on unchanged code.
2. stickydisk.js:83
- Draft comment:
Ensure to clear the timeout if the operation completes before the timeout duration to prevent unexpected behavior. - Reason this comment was not posted:
Comment did not seem useful.
3. stickydisk.js:106
- Draft comment:
Consider reusing a single client instance forcreateStickyDiskClient
to reduce overhead, instead of creating a new client for each call. - Reason this comment was not posted:
Confidence changes required:50%
Instickydisk.js
, thecommitStickydisk
andcleanupStickyDiskWithoutCommit
functions both usecreateStickyDiskClient
to create a new client for each call. This can be optimized by reusing a single client instance if possible, to reduce overhead.
4. stickydisk.js:166
- Draft comment:
Ensure that inputs to shell commands are sanitized to prevent command injection vulnerabilities. - Reason this comment was not posted:
Comment did not seem useful.
5. index.js:154
- Draft comment:
Ensure that the file patterns forglob.hashFiles
are correctly specified and efficient, especially for large file sets. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_tn84Urt1F4MmR9Dg
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
0a80e72
to
a347c1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on a347c1e in 1 minute and 35 seconds
More details
- Looked at
942
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. __tests__/restore-cache.test.js:34
- Draft comment:
The '@actions/core' module is mocked twice in this file (lines 1 and 34). This is redundant and can lead to unexpected behavior. Consider consolidating these into a single mock definition. - Reason this comment was not posted:
Comment looked like it was already resolved.
2. post.js:13
- Draft comment:
Usingprocess.exit(0)
can prevent pending asynchronous operations from completing. Consider allowing the Node.js process to exit naturally after cleanup. - Reason this comment was not posted:
Comment was on unchanged code.
3. stickydisk.js:83
- Draft comment:
Consider clearing the timeout if the operation completes successfully before the 15-second timeout to prevent unnecessary aborts. - Reason this comment was not posted:
Comment looked like it was already resolved.
4. stickydisk.js:106
- Draft comment:
ThecreateStickyDiskClient()
function is asynchronous but is not awaited. Consider awaiting this function to ensure the client is ready before proceeding. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment assumescreateStickyDiskClient()
is asynchronous, but there is no evidence in the provided code that it is. The function is used synchronously, suggesting it might not be asynchronous. Without further context or evidence, the comment seems speculative.
I might be missing the implementation details ofcreateStickyDiskClient()
, which could indeed be asynchronous. However, based on the current file, there is no indication that it is asynchronous.
Given the lack of evidence in the current file, it's reasonable to assume the function is not asynchronous unless proven otherwise. The comment should be removed unless further evidence is provided.
Remove the comment as there is no strong evidence thatcreateStickyDiskClient()
is asynchronous and needs to be awaited.
Workflow ID: wflow_HgLDKsBZh0l88nEN
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
try { | ||
// Check if path is mounted | ||
try { | ||
const { stdout: mountOutput } = await execAsync(`mount | grep ${path}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path
variable is used in shell commands without proper sanitization. Ensure that the path is controlled or sanitized to prevent command injection vulnerabilities.
a347c1e
to
0a78627
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on 0a78627 in 1 minute and 10 seconds
More details
- Looked at
944
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. util.js:18
- Draft comment:
lstatSync
is used but not imported or defined in this file. Ensure it is imported or defined to avoid runtime errors. - Reason this comment was not posted:
Comment was on unchanged code.
2. post.js:13
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process immediately, potentially skipping pending asynchronous operations. Let the process exit naturally unless necessary. - Reason this comment was not posted:
Comment was on unchanged code.
3. stickydisk.js:83
- Draft comment:
Ensure to clear the timeout if the operation completes before the 15-second mark to prevent unexpected behavior. - Reason this comment was not posted:
Comment did not seem useful.
4. index.js:151
- Draft comment:
UsingsetTimeout
with an async function can lead to unexpected behavior. Consider using a different approach to handle delays with async functions. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_5KCKj2xP9wsTtj5W
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
stickydisk.js
Outdated
} | ||
|
||
try { | ||
const client = await createStickyDiskClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createStickyDiskClient
is not an async function, so await
is unnecessary here. Remove await
to avoid confusion.
break; | ||
} catch (error) { | ||
if (attempt === 10) { | ||
throw error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider logging the error if unmount fails after 10 attempts to aid in debugging.
0a78627
to
f1342f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on f1342f9 in 46 seconds
More details
- Looked at
943
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. index.js:145
- Draft comment:
Consider removing therestoreCache
function if it is no longer used or needed, to avoid confusion and potential misuse. - Reason this comment was not posted:
Comment looked like it was already resolved.
2. post.js:2
- Draft comment:
Remove the unused import ofconfig
since it is no longer used in this file. - Reason this comment was not posted:
Confidence changes required:50%
Thepost.js
file has removed thesaveCache
function but did not remove the import ofconfig
. This import is now unused and should be removed to clean up the code.
3. stickydisk.js:83
- Draft comment:
Consider usingAbortSignal.timeout(15000)
instead ofsetTimeout
for better readability and maintainability. - Reason this comment was not posted:
Confidence changes required:50%
Thestickydisk.js
file usessetTimeout
for aborting the controller, but it should useAbortSignal.timeout
for better readability and maintainability.
4. stickydisk.js:21
- Draft comment:
Consider extracting environment variables into constants for better readability and maintainability. - Reason this comment was not posted:
Confidence changes required:50%
ThegetStickyDisk
function instickydisk.js
usesprocess.env
directly multiple times. It would be better to extract these into variables for better readability and maintainability.
5. util.js:18
- Draft comment:
Ensure thatlstatSync
handles cases where the path might not exist to prevent unhandled exceptions. - Reason this comment was not posted:
Confidence changes required:50%
ThegetFolderSize
function inutil.js
useslstatSync
but does not handle the case where the path might not exist. This could lead to unhandled exceptions.
Workflow ID: wflow_xqm5MqPGHjqu5lmN
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
f1342f9
to
2bb489a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on 2bb489a in 48 seconds
More details
- Looked at
1046
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. post.js:13
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process abruptly, potentially skipping pending operations. Let the process exit naturally instead. - Reason this comment was not posted:
Comment was on unchanged code.
2. index.js:170
- Draft comment:
Avoid usingsetTimeout
with an async function as the callback. This can lead to unhandled promise rejections. Consider refactoring to use a different approach for delaying execution. - Reason this comment was not posted:
Comment was on unchanged code.
3. stickydisk.js:83
- Draft comment:
Ensure to clear the timeout if the operation completes before the timeout duration to prevent unnecessary aborts. - Reason this comment was not posted:
Comment did not seem useful.
4. stickydisk.js:131
- Draft comment:
Remove the unnecessaryawait
beforecreateStickyDiskClient()
as it is not an async function. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_KLRNlkGgwhSAMTGF
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
2bb489a
to
84e4b43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on 84e4b43 in 47 seconds
More details
- Looked at
1047
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. post.js:12
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process abruptly, potentially skipping pending asynchronous operations. Let the process exit naturally instead. - Reason this comment was not posted:
Comment was on unchanged code.
2. index.js:11
- Draft comment:
Themutex
implementation lacks error handling, which could lead to deadlocks if an error occurs betweenlock
andunlock
. Consider adding error handling to ensureunlock
is always called. - Reason this comment was not posted:
Comment looked like it was already resolved.
3. stickydisk.js:164
- Draft comment:
Consider adding a mechanism to log or alert if unmounting fails after all retries, as the current implementation retries up to 10 times but doesn't handle consistent failures. - Reason this comment was not posted:
Confidence changes required:50%
Instickydisk.js
, theunmountAndCommitStickyDisk
function retries unmounting up to 10 times with a delay. However, it doesn't handle the case where the unmounting consistently fails. Consider adding a mechanism to log or alert if unmounting fails after all retries.
4. index.js:173
- Draft comment:
Ensure that the files being hashed withglob.hashFiles
are consistent and relevant to avoid unnecessary cache misses. - Reason this comment was not posted:
Confidence changes required:40%
Inindex.js
, theloadStickyDisk
function usesglob.hashFiles
to generate a hash for cache keys. Ensure that the files being hashed are consistent and relevant to avoid unnecessary cache misses.
Workflow ID: wflow_GWSbVaRF95fXsCsD
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
* @param {string} device - Path to the block device | ||
* @returns {Promise<string>} - Returns the device path | ||
*/ | ||
async function maybeFormatBlockDevice(device) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of sudo
in maybeFormatBlockDevice
requires elevated privileges, which might not be available in all environments. Consider handling permission errors gracefully.
84e4b43
to
53abca7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 53abca7 in 40 seconds
More details
- Looked at
1026
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. index.js:168
- Draft comment:
ThesetTimeout
function is used incorrectly here. It should not be awaited as it doesn't return a promise. Consider using a separate delay function for the timeout.
await new Promise(resolve => setTimeout(resolve, delay));
- Reason this comment was not posted:
Comment looked like it was already resolved.
2. post.js:12
- Draft comment:
Avoid usingprocess.exit(0)
as it can lead to abrupt termination of the process, potentially skipping important cleanup tasks. Let the process exit naturally. - Reason this comment was not posted:
Comment was on unchanged code.
3. stickydisk.js:83
- Draft comment:
ThesetTimeout
function is used incorrectly here. It should not be used withclearTimeout
in this context. Consider using a promise-based delay function for better control.
await new Promise((resolve, reject) => {
const timeoutId = setTimeout(() => reject(new Error('Timeout')), 15000);
// Your async operation here
clearTimeout(timeoutId);
resolve();
});
- Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_5Fl3lIl62w3bVzZ6
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
53abca7
to
5324ee1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on 5324ee1 in 46 seconds
More details
- Looked at
1026
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. index.js:168
- Draft comment:
setTimeout
should be used with a callback function, not as a promise. This could lead to unexpected behavior. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment seems to misunderstand the use ofsetTimeout
from 'timers/promises', which is intended to be used as a promise. The code appears to be using it correctly according to the Node.js documentation for 'timers/promises'.
I might be missing some context about howsetTimeout
is expected to be used in this specific codebase, but based on standard Node.js usage, the code seems correct.
The use ofsetTimeout
from 'timers/promises' is standard and correct for promise-based asynchronous operations, so the comment is likely incorrect.
The comment should be deleted because it incorrectly suggests a misuse ofsetTimeout
, which is actually being used correctly as a promise.
2. post.js:12
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process before asynchronous operations complete. Let the process exit naturally. - Reason this comment was not posted:
Comment was on unchanged code.
3. stickydisk.js:83
- Draft comment:
EnsureclearTimeout(timeoutId)
is called in all code paths to prevent unexpected behavior ifgetStickyDisk
fails. - Reason this comment was not posted:
Comment did not seem useful.
4. stickydisk.js:152
- Draft comment:
Usinggrep
to check if a path is mounted is not portable. Consider using a more cross-platform method to check mount status. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment points out a potential issue with portability, which is a valid concern in cross-platform applications. However, the context of the application (e.g., if it's intended to run only on Unix-like systems) is not clear. Without strong evidence that the code is intended to be cross-platform, the comment might not be necessary.
The comment assumes the code should be cross-platform without evidence. If the code is intended for Unix-like systems, the comment is not useful.
The comment could be useful if the code is intended to be cross-platform, but without evidence of this requirement, it may not be necessary.
The comment should be removed unless there is strong evidence that the code is intended to be cross-platform, which is not provided in the diff.
Workflow ID: wflow_ns0GrzD8bcEDNpAB
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
This change teaches restoreCache to get and mount a unique stickydisk per key and mount it at the provided path. We require a stickydisk per path and so we hash the path and add it to the user configured "cache key". All other semantics around versioning of the cache and respecting the base cache key remain the same. On post, we teach the action to unmount and commit the relevant stickydisks. For the moment we leave the "external" cache alone. In a follow-up we can move that to be backed by stickydisks too. The stickydisk.js file is heavily inspired by the useblacksmith/stickydisk implementation.
5324ee1
to
ecb4f37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on ecb4f37 in 51 seconds
More details
- Looked at
1038
lines of code in9
files - Skipped
1
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. post.js:12
- Draft comment:
Avoid usingprocess.exit(0)
as it can terminate the process abruptly, potentially skipping pending asynchronous operations. Let the process exit naturally after all tasks are completed. - Reason this comment was not posted:
Comment was on unchanged code.
2. stickydisk.js:46
- Draft comment:
Ensure the environment has sufficient privileges to execute commands withsudo
, as this can cause issues if not run with the necessary permissions. - Reason this comment was not posted:
Comment did not seem useful.
3. stickydisk.js:173
- Draft comment:
Consider logging error details on each retry attempt to aid in debugging transient unmount issues. - Reason this comment was not posted:
Confidence changes required:50%
Instickydisk.js
, theunmountAndCommitStickyDisk
function retries unmounting up to 10 times with a delay. This is a good practice for handling transient issues, but it might be beneficial to log the error details on each retry to aid in debugging.
4. index.js:168
- Draft comment:
Consider implementing a backoff strategy instead of a random delay to handle contention more effectively. - Reason this comment was not posted:
Confidence changes required:50%
Inindex.js
, theloadStickyDisk
function usessetTimeout
with a random delay to reduce contention. While this can help, it might be more effective to implement a backoff strategy if contention is a significant issue.
5. index.js:179
- Draft comment:
Ensure the timeout set forAbortController
is appropriate for the operations being performed to avoid premature abortion. - Reason this comment was not posted:
Confidence changes required:50%
Inindex.js
, theloadStickyDisk
function usesAbortController
for timeout management. Ensure that the timeout is appropriate for the operations being performed, as too short a timeout might lead to premature abortion of valid operations.
Workflow ID: wflow_SOKfGKHk0DH7mJpR
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
|
This change teaches restoreCache to get and mount a unique stickydisk per key and mount it at the provided path. We require a stickydisk per path and so we hash the path and add it to the user configured "cache key". All other semantics around versioning of the cache and respecting the base cache key remain the same.
On post, we teach the action to unmount and commit the relevant stickydisks. For the moment we leave the "external" cache alone. In a follow-up we can move that to be backed by stickydisks too.
The stickydisk.js file is heavily inspired by the useblacksmith/stickydisk implementation.
Important
Replaces existing cache mechanism with sticky disks, updating mounting and unmounting logic, configuration, and adding tests.
restoreCache
withloadStickyDisk
inindex.js
to mount sticky disks per cache path.post.js
unmounts and commits sticky disks usingunmountAndCommitStickyDisk
.stickydisk.js
provides functions to manage sticky disks, includingmountStickyDisk
andunmountAndCommitStickyDisk
.createStickyDiskClient
fromutil.js
for sticky disk service interaction.config.js
updated to support sticky disk cache configuration.package.json
includes@buf/blacksmith_vm-agent.connectrpc_es
for sticky disk operations.restore-cache.test.js
added to test sticky disk functionality.jest.config.js
updated to include coverage forstickydisk.js
.config.js
fordiskCacheConfig
variable check..github/workflows/ci.yml
updated to include a test job.This description was created by for ecb4f37. It will automatically update as commits are pushed.