-
Notifications
You must be signed in to change notification settings - Fork 248
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
fix: move component filtering methods to crates #2892
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,10 +91,14 @@ impl<T: RuntimeFactors> TestEnvironment<T> { | |
} | ||
|
||
pub async fn build_locked_app(&self) -> anyhow::Result<LockedApp> { | ||
let toml_str = toml::to_string(&self.manifest).context("failed serializing manifest")?; | ||
let dir = tempfile::tempdir().context("failed creating tempdir")?; | ||
let path = dir.path().join("spin.toml"); | ||
std::fs::write(&path, toml_str).context("failed writing manifest")?; | ||
spin_loader::from_file(&path, FilesMountStrategy::Direct, None).await | ||
build_locked_app(&self.manifest).await | ||
} | ||
} | ||
|
||
pub async fn build_locked_app(manifest: &toml::Table) -> anyhow::Result<LockedApp> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont see us using it anywhere outside of tests so it may make sense to avoid moving up to the crate |
||
let toml_str = toml::to_string(manifest).context("failed serializing manifest")?; | ||
let dir = tempfile::tempdir().context("failed creating tempdir")?; | ||
let path = dir.path().join("spin.toml"); | ||
std::fs::write(&path, toml_str).context("failed writing manifest")?; | ||
spin_loader::from_file(&path, FilesMountStrategy::Direct, None).await | ||
} |
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.
It might be desirable to give this a more specific name but the doc comment covers it well and the only names I can think of are a bit verbose (e.g.
validate_retained_components_include_service_chaining_dependencies
!). Not a blocker, just if inspiration strikes!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.
Even though this is used by Spin when retaining only a set of components, technically this could be used elsewhere to establish that a set of components have satisfied service chaining. Maybe a runtime implementor would use this for app splitting ... but i like the vague name because technically the functionality could be used in another objective