MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / profiles_from_import_items

Function profiles_from_import_items

crates/openshell-server/src/grpc/provider.rs:1586–1609  ·  view source on GitHub ↗
(
    items: &[ProviderProfileImportItem],
)

Source from the content-addressed store, hash-verified

1584}
1585
1586fn profiles_from_import_items(
1587 items: &[ProviderProfileImportItem],
1588) -> (
1589 Vec<(String, ProviderTypeProfile)>,
1590 Vec<ProfileValidationDiagnostic>,
1591) {
1592 let mut profiles = Vec::new();
1593 let mut diagnostics = Vec::new();
1594 for item in items {
1595 let source = item.source.clone();
1596 let Some(profile) = item.profile.as_ref() else {
1597 diagnostics.push(ProfileValidationDiagnostic {
1598 source,
1599 profile_id: String::new(),
1600 field: "profile".to_string(),
1601 message: "provider profile is required".to_string(),
1602 severity: "error".to_string(),
1603 });
1604 continue;
1605 };
1606 profiles.push((source, ProviderTypeProfile::from_proto(profile)));
1607 }
1608 (profiles, diagnostics)
1609}
1610
1611fn add_empty_profile_set_diagnostic(
1612 profiles: &[(String, ProviderTypeProfile)],

Calls 2

from_protoFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected