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

chore: add tracing to primary lockfile functions #6800

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/turborepo-lockfiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ serde = { version = "1.0.126", features = ["derive", "rc"] }
serde_json = "1.0.86"
serde_yaml = "0.9.27"
thiserror = "1.0.38"
tracing.workspace = true
turbopath = { path = "../turborepo-paths" }

[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions crates/turborepo-lockfiles/src/berry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ impl BerryLockfile {
}

impl Lockfile for BerryLockfile {
#[tracing::instrument(skip(self))]
fn resolve_package(
&self,
workspace_path: &str,
Expand Down Expand Up @@ -410,6 +411,7 @@ impl Lockfile for BerryLockfile {
}))
}

#[tracing::instrument(skip(self))]
fn all_dependencies(
&self,
key: &str,
Expand Down
2 changes: 2 additions & 0 deletions crates/turborepo-lockfiles/src/bun/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl FromStr for BunLockfile {
}

impl Lockfile for BunLockfile {
#[tracing::instrument(skip(self, _workspace_path))]
fn resolve_package(
&self,
_workspace_path: &str,
Expand All @@ -74,6 +75,7 @@ impl Lockfile for BunLockfile {
Ok(None)
}

#[tracing::instrument(skip(self))]
fn all_dependencies(
&self,
key: &str,
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-lockfiles/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ pub fn all_transitive_closures<L: Lockfile + ?Sized>(
}

// this should get replaced by petgraph in the future :)
#[tracing::instrument(skip_all)]
pub fn transitive_closure<L: Lockfile + ?Sized>(
lockfile: &L,
workspace_path: &str,
Expand Down
2 changes: 2 additions & 0 deletions crates/turborepo-lockfiles/src/npm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct NpmPackage {
}

impl Lockfile for NpmLockfile {
#[tracing::instrument(skip(self, _version))]
fn resolve_package(
&self,
workspace_path: &str,
Expand Down Expand Up @@ -78,6 +79,7 @@ impl Lockfile for NpmLockfile {
.transpose()
}

#[tracing::instrument(skip(self))]
fn all_dependencies(&self, key: &str) -> Result<Option<HashMap<String, String>>, Error> {
self.packages
.get(key)
Expand Down
2 changes: 2 additions & 0 deletions crates/turborepo-lockfiles/src/pnpm/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ struct GlobalFields<'a> {
}

impl crate::Lockfile for PnpmLockfile {
#[tracing::instrument(skip(self))]
fn resolve_package(
&self,
workspace_path: &str,
Expand Down Expand Up @@ -321,6 +322,7 @@ impl crate::Lockfile for PnpmLockfile {
}
}

#[tracing::instrument(skip(self))]
fn all_dependencies(
&self,
key: &str,
Expand Down
2 changes: 2 additions & 0 deletions crates/turborepo-lockfiles/src/yarn1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl FromStr for Yarn1Lockfile {
}

impl Lockfile for Yarn1Lockfile {
#[tracing::instrument(skip(self, _workspace_path))]
fn resolve_package(
&self,
_workspace_path: &str,
Expand All @@ -73,6 +74,7 @@ impl Lockfile for Yarn1Lockfile {
Ok(None)
}

#[tracing::instrument(skip(self))]
fn all_dependencies(
&self,
key: &str,
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-repository/src/package_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ impl PackageManager {
self.parse_lockfile(root_package_json, &contents)
}

#[tracing::instrument(skip(self, root_package_json))]
#[tracing::instrument(skip(self, root_package_json, contents))]
pub fn parse_lockfile(
&self,
root_package_json: &PackageJson,
Expand Down
Loading