Skip to content
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

feat: use loader to verify https checksums #486

Merged
merged 13 commits into from
May 27, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented May 24, 2024

This should be a perf improvement, but also it allows modifying https specifiers in the vendor folder without causing lockfile issues similar to jsr specifiers.

));
})
.boxed_local(),
);
Copy link
Member Author

Choose a reason for hiding this comment

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

This will be a perf improvement.

@@ -159,33 158,87 @@ impl Range {
}
}

#[derive(Debug, Clone)]
pub enum ModuleError {
Copy link
Member Author

Choose a reason for hiding this comment

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

I split this up into way more targeted error classes so that I could more easily tell when an integrity check fails. This will make things easier in the CLI.

@dsherret dsherret requested a review from bartlomieju May 27, 2024 16:09
@dsherret dsherret marked this pull request as ready for review May 27, 2024 16:09
- name: Get tag version
if: contains(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> "$GITHUB_OUTPUT"
Copy link
Member Author

Choose a reason for hiding this comment

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

This is unrealted to this PR. I just noticed it was not used.

Comment on lines 87 to 94
},
{
let package_name = package_name.to_string();
|e| JsrLoadError::PackageManifestLoad(package_name, Arc::new(e))
},
{
let package_name = package_name.to_string();
|| JsrLoadError::PackageNotFound(package_name)
Copy link
Member

Choose a reason for hiding this comment

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

This read very strange, I wonder if it would make more sense to assign them to variables before hand. But maybe not very important.

Comment on lines 188 to 189
#[derive(Debug, Default, Clone)]
pub struct HashMapLocker(HashMap<ModuleSpecifier, LoaderChecksum>);
Copy link
Member

Choose a reason for hiding this comment

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

Where would we use this one? In deno vendor?

Copy link
Member Author

@dsherret dsherret May 27, 2024

Choose a reason for hiding this comment

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

Just in the tests probably (it's used in the tests in this repo)

reporter: Option<&'a dyn Reporter>,
workspace_members: &'a [WorkspaceMember],
executor: &'a dyn Executor,
options: BuildOptions<'a>,
Copy link
Member

Choose a reason for hiding this comment

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

Nice cleanup 👍

@dsherret dsherret merged commit 226780c into denoland:main May 27, 2024
16 checks passed
@dsherret dsherret deleted the move_checksums_deno_graph branch May 27, 2024 20:15
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