From aec7f93d482187cd39c9b46ce0e4fc1c9d09f8b8 Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Fri, 20 Sep 2024 12:01:05 -0400 Subject: [PATCH 1/5] Map file to package and affected packages --- crates/tower-uds/Cargo.toml | 2 +- crates/turborepo-lib/src/query/file.rs | 115 ++++++++++++++++-- crates/turborepo-lib/src/query/mod.rs | 59 +++++++++ crates/turborepo-lib/src/query/package.rs | 25 ++-- .../src/anchored_system_path.rs | 4 + .../src/change_mapper/mod.rs | 5 +- 6 files changed, 184 insertions(+), 26 deletions(-) diff --git a/crates/tower-uds/Cargo.toml b/crates/tower-uds/Cargo.toml index c07c5762cdf0b..451fea5c71a18 100644 --- a/crates/tower-uds/Cargo.toml +++ b/crates/tower-uds/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tower-uds" version = "0.1.0" -edition = "2024" +edition = "2021" license = "MPL-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/turborepo-lib/src/query/file.rs b/crates/turborepo-lib/src/query/file.rs index 7be10fba8389e..9f6c3db0b80ae 100644 --- a/crates/turborepo-lib/src/query/file.rs +++ b/crates/turborepo-lib/src/query/file.rs @@ -1,15 +1,19 @@ use std::sync::Arc; -use async_graphql::{Enum, Object, SimpleObject}; +use async_graphql::{Enum, Object, SimpleObject, Union}; use camino::Utf8PathBuf; use miette::SourceCode; use swc_ecma_ast::EsVersion; use swc_ecma_parser::{EsSyntax, Syntax, TsSyntax}; use turbo_trace::Tracer; use turbopath::AbsoluteSystemPathBuf; +use turborepo_repository::{ + change_mapper::{ChangeMapper, GlobalDepsPackageChangeMapper}, + package_graph::PackageNode, +}; use crate::{ - query::{Array, Diagnostic, Error}, + query::{package::Package, Array, Diagnostic, Error, PackageChangeReason}, run::Run, }; @@ -166,23 +170,114 @@ impl From for turbo_trace::ImportTraceType { } } +#[derive(SimpleObject)] +struct All { + reason: PackageChangeReason, + count: usize, +} + +#[derive(Union)] +enum PackageMapping { + All(All), + Package(Package), +} + +impl File { + fn get_package(&self) -> Result, Error> { + let change_mapper = ChangeMapper::new( + self.run.pkg_dep_graph(), + vec![], + GlobalDepsPackageChangeMapper::new( + self.run.pkg_dep_graph(), + self.run + .root_turbo_json() + .global_deps + .iter() + .map(|dep| dep.as_str()), + )?, + ); + + // If the file is not in the repo, we can't get the package + let Ok(anchored_path) = self.run.repo_root().anchor(&self.path) else { + return Ok(None); + }; + + let package = change_mapper + .package_detector() + .detect_package(&anchored_path); + + match package { + turborepo_repository::change_mapper::PackageMapping::All(reason) => { + Ok(Some(PackageMapping::All(All { + reason: reason.into(), + count: self.run.pkg_dep_graph().len(), + }))) + } + turborepo_repository::change_mapper::PackageMapping::Package((package, _)) => Ok(Some( + PackageMapping::Package(Package::new(self.run.clone(), package.name.clone())?), + )), + turborepo_repository::change_mapper::PackageMapping::None => Ok(None), + } + } +} + #[Object] impl File { async fn contents(&self) -> Result { - let contents = self.path.read_to_string()?; - Ok(contents) + Ok(self.path.read_to_string()?) } - async fn path(&self) -> Result { - Ok(self - .run + // This is `Option` because the file may not be in the repo + async fn repo_relative_path(&self) -> Option { + self.run .repo_root() .anchor(&self.path) - .map(|path| path.to_string())?) + .ok() + .map(|path| path.to_string()) } - async fn absolute_path(&self) -> Result { - Ok(self.path.to_string()) + async fn absolute_path(&self) -> String { + self.path.to_string() + } + + async fn package(&self) -> Result, Error> { + self.get_package() + } + + /// Gets the affected packages for the file, i.e. all packages that depend + /// on the file. + async fn affected_packages(&self) -> Result, Error> { + // This is technically doable with the `package` field, but this is a nice bit + // of syntactic sugar + match self.get_package() { + Ok(Some(PackageMapping::All(_))) => { + let packages: Result, _> = self + .run + .pkg_dep_graph() + .packages() + .map(|(name, _)| Package::new(self.run.clone(), name.clone())) + .collect(); + Ok(Array::from(packages?)) + }, + Ok(Some(PackageMapping::Package(package))) => { + let node: PackageNode = PackageNode::Workspace(package.get_name().clone()); + let mut ancestors = self + .run + .pkg_dep_graph() + .ancestors(&node) + .iter() + .map(|package| { + Package::new(self.run.clone(), package.as_package_name().clone()) + }) + .collect::, _>>()?; + + ancestors.sort_by(|a, b| a.get_name().cmp(b.get_name())); + + Ok(ancestors) + } + Ok(None) => Ok(Array::default()), + Err(e) => Err(e), + } } async fn dependencies( diff --git a/crates/turborepo-lib/src/query/mod.rs b/crates/turborepo-lib/src/query/mod.rs index a8c2da0abe846..f775d31795089 100644 --- a/crates/turborepo-lib/src/query/mod.rs +++ b/crates/turborepo-lib/src/query/mod.rs @@ -63,6 +63,8 @@ pub enum Error { Parse(swc_ecma_parser::error::Error), #[error(transparent)] SignalListener(#[from] turborepo_signals::listeners::Error), + #[error(transparent)] + ChangeMapper(#[from] turborepo_repository::change_mapper::Error), } pub struct RepositoryQuery { @@ -164,6 +166,15 @@ pub struct Array { length: usize, } +impl Default for Array { + fn default() -> Self { + Self { + items: Vec::new(), + length: 0, + } + } +} + impl From> for Array { fn from(value: Vec) -> Self { Self { @@ -193,6 +204,16 @@ impl FromIterator for Array { Self { items, length } } } + +impl Array { + pub fn sort_by(&mut self, f: F) + where + F: FnMut(&T, &T) -> std::cmp::Ordering, + { + self.items.sort_by(f); + } +} + #[derive(Enum, Copy, Clone, Eq, PartialEq, Debug)] enum PackageFields { Name, @@ -515,6 +536,44 @@ enum PackageChangeReason { InFilteredDirectory(InFilteredDirectory), } +impl From for PackageChangeReason { + fn from(reason: AllPackageChangeReason) -> Self { + match reason { + AllPackageChangeReason::GlobalDepsChanged { file } => { + PackageChangeReason::GlobalDepsChanged(GlobalDepsChanged { + file_path: file.to_string(), + }) + } + AllPackageChangeReason::DefaultGlobalFileChanged { file } => { + PackageChangeReason::DefaultGlobalFileChanged(DefaultGlobalFileChanged { + file_path: file.to_string(), + }) + } + + AllPackageChangeReason::LockfileChangeDetectionFailed => { + PackageChangeReason::LockfileChangeDetectionFailed(LockfileChangeDetectionFailed { + empty: false, + }) + } + + AllPackageChangeReason::GitRefNotFound { from_ref, to_ref } => { + PackageChangeReason::GitRefNotFound(GitRefNotFound { from_ref, to_ref }) + } + + AllPackageChangeReason::LockfileChangedWithoutDetails => { + PackageChangeReason::LockfileChangedWithoutDetails(LockfileChangedWithoutDetails { + empty: false, + }) + } + AllPackageChangeReason::RootInternalDepChanged { root_internal_dep } => { + PackageChangeReason::RootInternalDepChanged(RootInternalDepChanged { + root_internal_dep: root_internal_dep.to_string(), + }) + } + } + } +} + #[derive(SimpleObject)] struct ChangedPackage { reason: PackageChangeReason, diff --git a/crates/turborepo-lib/src/query/package.rs b/crates/turborepo-lib/src/query/package.rs index b7ada0b07e876..7bc6afef95147 100644 --- a/crates/turborepo-lib/src/query/package.rs +++ b/crates/turborepo-lib/src/query/package.rs @@ -149,32 +149,29 @@ impl Package { async fn all_dependents(&self) -> Result, Error> { let node: PackageNode = PackageNode::Workspace(self.name.clone()); - Ok(self + let mut dependents: Array = self .run .pkg_dep_graph() .ancestors(&node) .iter() - .map(|package| Package { - run: self.run.clone(), - name: package.as_package_name().clone(), - }) - .sorted_by(|a, b| a.name.cmp(&b.name)) - .collect()) + .map(|package| Package::new(self.run.clone(), package.as_package_name().clone())) + .collect::, _>>()?; + dependents.sort_by(|a, b| a.get_name().cmp(b.get_name())); + Ok(dependents) } async fn all_dependencies(&self) -> Result, Error> { let node: PackageNode = PackageNode::Workspace(self.name.clone()); - Ok(self + let mut dependencies: Array = self .run .pkg_dep_graph() .dependencies(&node) .iter() - .map(|package| Package { - run: self.run.clone(), - name: package.as_package_name().clone(), - }) - .sorted_by(|a, b| a.name.cmp(&b.name)) - .collect()) + .map(|package| Package::new(self.run.clone(), package.as_package_name().clone())) + .collect::, _>>()?; + + dependencies.sort_by(|a, b| a.get_name().cmp(b.get_name())); + Ok(dependencies) } /// The downstream packages that depend on this package, indirectly diff --git a/crates/turborepo-paths/src/anchored_system_path.rs b/crates/turborepo-paths/src/anchored_system_path.rs index 4f9e379ce23bd..ae70a5161f45e 100644 --- a/crates/turborepo-paths/src/anchored_system_path.rs +++ b/crates/turborepo-paths/src/anchored_system_path.rs @@ -102,6 +102,10 @@ impl AnchoredSystemPath { buf.unwrap_or_else(|_| panic!("anchored system path is relative: {}", self.0.as_str())) } + pub fn extension(&self) -> Option<&str> { + self.0.extension() + } + pub fn join_component(&self, segment: &str) -> AnchoredSystemPathBuf { debug_assert!(!segment.contains(std::path::MAIN_SEPARATOR)); AnchoredSystemPathBuf(self.0.join(segment)) diff --git a/crates/turborepo-repository/src/change_mapper/mod.rs b/crates/turborepo-repository/src/change_mapper/mod.rs index db84bd5afbeb1..a432fd09067a9 100644 --- a/crates/turborepo-repository/src/change_mapper/mod.rs +++ b/crates/turborepo-repository/src/change_mapper/mod.rs @@ -106,7 +106,6 @@ pub enum PackageChanges { pub struct ChangeMapper<'a, PD> { pkg_graph: &'a PackageGraph, - ignore_patterns: Vec, package_detector: PD, } @@ -132,6 +131,10 @@ impl<'a, PD: PackageChangeMapper> ChangeMapper<'a, PD> { .find(|f| DEFAULT_GLOBAL_DEPS.iter().any(|dep| *dep == f.as_str())) } + pub fn package_detector(&self) -> &dyn PackageChangeMapper { + &self.package_detector + } + pub fn changed_packages( &self, changed_files: HashSet, From c1dac29b8f66a80398a9e6b75c19ab4d8f28838c Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Fri, 20 Sep 2024 15:49:51 -0400 Subject: [PATCH 2/5] Adding tests and fixing up types Fixing up and adding tests Fix test PR feedback Fix test Revert test --- crates/turborepo-lib/src/query/file.rs | 18 ++-- crates/turborepo-lib/src/query/mod.rs | 52 +++++++++++ turborepo-tests/integration/tests/affected.t | 87 +++++++++++++++++++ .../integration/tests/command-query.t | 25 ++++++ 4 files changed, 174 insertions(+), 8 deletions(-) diff --git a/crates/turborepo-lib/src/query/file.rs b/crates/turborepo-lib/src/query/file.rs index 9f6c3db0b80ae..c5801d57cc3f1 100644 --- a/crates/turborepo-lib/src/query/file.rs +++ b/crates/turborepo-lib/src/query/file.rs @@ -228,7 +228,7 @@ impl File { } // This is `Option` because the file may not be in the repo - async fn repo_relative_path(&self) -> Option { + async fn path(&self) -> Option { self.run .repo_root() .anchor(&self.path) @@ -247,17 +247,17 @@ impl File { /// Gets the affected packages for the file, i.e. all packages that depend /// on the file. async fn affected_packages(&self) -> Result, Error> { - // This is technically doable with the `package` field, but this is a nice bit - // of syntactic sugar match self.get_package() { Ok(Some(PackageMapping::All(_))) => { - let packages: Result, _> = self + let mut packages: Vec<_> = self .run .pkg_dep_graph() .packages() .map(|(name, _)| Package::new(self.run.clone(), name.clone())) - .collect(); - Ok(Array::from(packages?)) + .collect::, Error>>()?; + + packages.sort_by(|a, b| a.get_name().cmp(b.get_name())); + Ok(Array::from(packages)) }, Ok(Some(PackageMapping::Package(package))) => { let node: PackageNode = PackageNode::Workspace(package.get_name().clone()); @@ -269,11 +269,13 @@ impl File { .map(|package| { Package::new(self.run.clone(), package.as_package_name().clone()) }) - .collect::, _>>()?; + // Add the package itself to the list + .chain(std::iter::once(Ok(package.clone()))) + .collect::, Error>>()?; ancestors.sort_by(|a, b| a.get_name().cmp(b.get_name())); - Ok(ancestors) + Ok(Array::from(ancestors)) } Ok(None) => Ok(Array::default()), Err(e) => Err(e), diff --git a/crates/turborepo-lib/src/query/mod.rs b/crates/turborepo-lib/src/query/mod.rs index f775d31795089..3df0b84218c6d 100644 --- a/crates/turborepo-lib/src/query/mod.rs +++ b/crates/turborepo-lib/src/query/mod.rs @@ -7,6 +7,7 @@ mod server; mod task; use std::{ + borrow::Cow, io, ops::{Deref, DerefMut}, sync::Arc, @@ -65,6 +66,8 @@ pub enum Error { SignalListener(#[from] turborepo_signals::listeners::Error), #[error(transparent)] ChangeMapper(#[from] turborepo_repository::change_mapper::Error), + #[error(transparent)] + Scm(#[from] turborepo_scm::Error), } pub struct RepositoryQuery { @@ -214,6 +217,12 @@ impl Array { } } +impl TypeName for Array { + fn type_name() -> Cow<'static, str> { + Cow::Owned(format!("Array<{}>", T::type_name())) + } +} + #[derive(Enum, Copy, Clone, Eq, PartialEq, Debug)] enum PackageFields { Name, @@ -659,6 +668,49 @@ impl RepositoryQuery { File::new(self.run.clone(), abs_path) } + /// Get the files that have changed between the `base` and `head` commits. + /// + /// # Arguments + /// + /// * `base`: Defaults to `main` or `master` + /// * `head`: Defaults to `HEAD` + /// * `include_uncommitted`: Defaults to `true` if `head` is not provided + /// * `allow_unknown_objects`: Defaults to `false` + /// * `merge_base`: Defaults to `true` + /// + /// returns: Result, Error> + async fn affected_files( + &self, + base: Option, + head: Option, + include_uncommitted: Option, + merge_base: Option, + ) -> Result, Error> { + let base = base.as_deref(); + let head = head.as_deref(); + let include_uncommitted = include_uncommitted.unwrap_or_else(|| head.is_none()); + let merge_base = merge_base.unwrap_or(true); + + let repo_root = self.run.repo_root(); + let change_result = self + .run + .scm() + .changed_files( + repo_root, + base, + head, + include_uncommitted, + false, + merge_base, + )? + .expect("set allow unknown objects to false"); + + Ok(change_result + .into_iter() + .map(|file| File::new(self.run.clone(), self.run.repo_root().resolve(&file))) + .collect()) + } + /// Gets a list of packages that match the given filter async fn packages(&self, filter: Option) -> Result, Error> { let Some(filter) = filter else { diff --git a/turborepo-tests/integration/tests/affected.t b/turborepo-tests/integration/tests/affected.t index 81a21e4159903..8e4b98e472686 100644 --- a/turborepo-tests/integration/tests/affected.t +++ b/turborepo-tests/integration/tests/affected.t @@ -58,6 +58,27 @@ Do the same thing with the `query` command } } +Also with `affectedFiles` in `turbo query` + $ ${TURBO} query "query { affectedFiles { items { path, affectedPackages { items { name } } } } }" + WARNING query command is experimental and may change in the future + { + "data": { + "affectedFiles": { + "items": [ + { + "path": "apps(\/|\\\\)my-app(\/|\\\\)new.js", (re) + "affectedPackages": { + "items": [ + { + "name": "my-app" + } + ] + } + } + ] + } + } + } Remove the new file $ rm apps/my-app/new.js @@ -139,6 +160,28 @@ Do the same thing with the `query` command } } +Also with `affectedFiles` in `turbo query` + $ ${TURBO} query "query { affectedFiles { items { path, affectedPackages { items { name } } } } }" + WARNING query command is experimental and may change in the future + { + "data": { + "affectedFiles": { + "items": [ + { + "path": "apps(\/|\\\\)my-app(\/|\\\\)package.json", (re) + "affectedPackages": { + "items": [ + { + "name": "my-app" + } + ] + } + } + ] + } + } + } + Commit the change $ git add . $ git commit -m "add foo" --quiet @@ -212,6 +255,17 @@ Do the same thing with the `query` command } } +Also with `affectedFiles` in `turbo query` + $ ${TURBO} query "query { affectedFiles(base: \"HEAD\") { items { path, affectedPackages { items { name } } } } }" + WARNING query command is experimental and may change in the future + { + "data": { + "affectedFiles": { + "items": [] + } + } + } + Override the SCM head to be main, so nothing runs $ TURBO_SCM_HEAD="main" ${TURBO} run build --affected --log-order grouped \xe2\x80\xa2 Packages in scope: (esc) @@ -242,6 +296,17 @@ Do the same thing with the `query` command } } +Also with `affectedFiles` in `turbo query` + $ ${TURBO} query "query { affectedFiles(head: \"main\") { items { path, affectedPackages { items { name } } } } }" + WARNING query command is experimental and may change in the future + { + "data": { + "affectedFiles": { + "items": [] + } + } + } + Now add a commit to `main` so the merge base is different from `main` $ git checkout main --quiet $ echo "foo" >> packages/util/index.js @@ -290,6 +355,28 @@ Do the same thing with the `query` command } } +Also with `affectedFiles` in `turbo query` + $ ${TURBO} query "query { affectedFiles { items { path, affectedPackages { items { name } } } } }" + WARNING query command is experimental and may change in the future + { + "data": { + "affectedFiles": { + "items": [ + { + "path": "apps(\/|\\\\)my-app(\/|\\\\)package.json", (re) + "affectedPackages": { + "items": [ + { + "name": "my-app" + } + ] + } + } + ] + } + } + } + Now do some magic to change the repo to be shallow $ SHALLOW=$(git rev-parse --show-toplevel)/.git/shallow $ git rev-parse HEAD > "$SHALLOW" diff --git a/turborepo-tests/integration/tests/command-query.t b/turborepo-tests/integration/tests/command-query.t index 2ba498b247464..5a22bcabcc313 100644 --- a/turborepo-tests/integration/tests/command-query.t +++ b/turborepo-tests/integration/tests/command-query.t @@ -34,3 +34,28 @@ Run the query $ VERSION=${MONOREPO_ROOT_DIR}/version.txt $ diff --strip-trailing-cr <(head -n 1 ${VERSION}) <(${TURBO} --version) +Query a file + $ ${TURBO} query "query { file(path: \"apps/my-app/package.json\") { path, contents } }" + WARNING query command is experimental and may change in the future + { + "data": { + "file": { + "path": "apps(\/|\\\\)my-app(\/|\\\\)package.json", (re) + "contents": "{\n \"name\": \"my-app\",\n \"scripts\": {\n \"build\": \"echo building\",\n \"maybefails\": \"exit 4\"\n },\n \"dependencies\": {\n \"util\": \"*\"\n }\n}\n" + } + } + } + +Get the file's package + $ ${TURBO} query "query { file(path: \"apps/my-app/package.json\") { path, package { ... on Package { name } } } }" + WARNING query command is experimental and may change in the future + { + "data": { + "file": { + "path": "apps(\/|\\\\)my-app(\/|\\\\)package.json", (re) + "package": { + "name": "my-app" + } + } + } + } From 1bc07f7bd7d6ab9753702864843d5fe2ebb76523 Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Mon, 10 Mar 2025 12:36:50 -0400 Subject: [PATCH 3/5] Fix error --- crates/turborepo-lib/src/query/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/turborepo-lib/src/query/mod.rs b/crates/turborepo-lib/src/query/mod.rs index 3df0b84218c6d..a184555f6d6fc 100644 --- a/crates/turborepo-lib/src/query/mod.rs +++ b/crates/turborepo-lib/src/query/mod.rs @@ -705,10 +705,12 @@ impl RepositoryQuery { )? .expect("set allow unknown objects to false"); - Ok(change_result + let files = change_result .into_iter() .map(|file| File::new(self.run.clone(), self.run.repo_root().resolve(&file))) - .collect()) + .collect::, _>>()?; + + Ok(Array::from(files)) } /// Gets a list of packages that match the given filter From 158c6fe3776414285ec2f13d939e58e492d50d48 Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Tue, 11 Mar 2025 10:17:36 -0400 Subject: [PATCH 4/5] Fix up --- crates/turborepo-lib/src/query/file.rs | 4 +- ...asic_monorepo_get_schema_(npm@10.5.0).snap | 151 +++++++++++++++++- 2 files changed, 150 insertions(+), 5 deletions(-) diff --git a/crates/turborepo-lib/src/query/file.rs b/crates/turborepo-lib/src/query/file.rs index c5801d57cc3f1..ded97fee9f42c 100644 --- a/crates/turborepo-lib/src/query/file.rs +++ b/crates/turborepo-lib/src/query/file.rs @@ -255,10 +255,10 @@ impl File { .packages() .map(|(name, _)| Package::new(self.run.clone(), name.clone())) .collect::, Error>>()?; - + packages.sort_by(|a, b| a.get_name().cmp(b.get_name())); Ok(Array::from(packages)) - }, + } Ok(Some(PackageMapping::Package(package))) => { let node: PackageNode = PackageNode::Workspace(package.get_name().clone()); let mut ancestors = self diff --git a/crates/turborepo/tests/snapshots/query__basic_monorepo_get_schema_(npm@10.5.0).snap b/crates/turborepo/tests/snapshots/query__basic_monorepo_get_schema_(npm@10.5.0).snap index f2d5207f514a7..3afd693400d49 100644 --- a/crates/turborepo/tests/snapshots/query__basic_monorepo_get_schema_(npm@10.5.0).snap +++ b/crates/turborepo/tests/snapshots/query__basic_monorepo_get_schema_(npm@10.5.0).snap @@ -11,6 +11,49 @@ expression: query_output "mutationType": null, "subscriptionType": null, "types": [ + { + "kind": "OBJECT", + "name": "All", + "description": null, + "fields": [ + { + "name": "reason", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "PackageChangeReason", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "count", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "SCALAR", "name": "Boolean", @@ -725,6 +768,18 @@ expression: query_output "name": "path", "description": null, "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "absolutePath", + "description": null, + "args": [], "type": { "kind": "NON_NULL", "name": null, @@ -738,15 +793,27 @@ expression: query_output "deprecationReason": null }, { - "name": "absolutePath", + "name": "package", "description": null, "args": [], + "type": { + "kind": "UNION", + "name": "PackageMapping", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "affectedPackages", + "description": "Gets the affected packages for the file, i.e. all packages that depend\non the file.", + "args": [], "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", + "kind": "OBJECT", + "name": "Packages", "ofType": null } }, @@ -1619,6 +1686,27 @@ expression: query_output "enumValues": null, "possibleTypes": null }, + { + "kind": "UNION", + "name": "PackageMapping", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "All", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Package", + "ofType": null + } + ] + }, { "kind": "INPUT_OBJECT", "name": "PackagePredicate", @@ -1960,6 +2048,63 @@ expression: query_output "isDeprecated": false, "deprecationReason": null }, + { + "name": "affectedFiles", + "description": "Get the files that have changed between the `base` and `head` commits.\n\n# Arguments\n\n* `base`: Defaults to `main` or `master`\n* `head`: Defaults to `HEAD`\n* `include_uncommitted`: Defaults to `true` if `head` is not provided\n* `allow_unknown_objects`: Defaults to `false`\n* `merge_base`: Defaults to `true`\n\nreturns: Result, Error>", + "args": [ + { + "name": "base", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "head", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "includeUncommitted", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "mergeBase", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Files", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "packages", "description": "Gets a list of packages that match the given filter", From a6c6287b8522cf9c3e8622ff8e8d25ad80ae2511 Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Tue, 11 Mar 2025 12:27:03 -0400 Subject: [PATCH 5/5] Whoops claude --- crates/tower-uds/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tower-uds/Cargo.toml b/crates/tower-uds/Cargo.toml index 451fea5c71a18..c07c5762cdf0b 100644 --- a/crates/tower-uds/Cargo.toml +++ b/crates/tower-uds/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tower-uds" version = "0.1.0" -edition = "2021" +edition = "2024" license = "MPL-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html