Skip to content

Commit b150df2

Browse files
committed
fmt
1 parent fab69ff commit b150df2

9 files changed

Lines changed: 223 additions & 237 deletions

File tree

cli/golem-cli/src/model/component.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@
1313
// limitations under the License.
1414

1515
use crate::agent_id_display::SourceLanguage;
16+
use crate::agent_id_display::render_type_for_language;
17+
use crate::model::app_raw;
1618
use crate::model::environment::ResolvedEnvironmentIdentity;
1719
use crate::model::worker::RawAgentId;
1820
use chrono::{DateTime, Utc};
1921
use golem_common::base_model::component_metadata::AgentTypeProvisionConfig;
2022
use golem_common::model::agent::AgentTypeName;
21-
use golem_common::model::card::{PolymorphicCard, PolymorphicManifestCard};
22-
use golem_common::model::card::recipient::RecipientMonomorphizationContext;
23-
use golem_common::model::agent::{
24-
AgentType, ComponentModelElementSchema, DataSchema, ElementSchema,
25-
};
2623
use golem_common::model::card::PolymorphicManifestPermissionPattern;
2724
use golem_common::model::card::recipient::{RecipientMonomorphizationContext, RecipientPattern};
28-
use golem_common::model::card::{PolymorphicCard, PolymorphicManifestPermissionPattern};
2925
use golem_common::model::component::{
3026
AgentConfigEntryDto, ComponentDto, ComponentId, ComponentRevision,
3127
};
@@ -34,12 +30,9 @@ use golem_common::model::component::{
3430
ArchiveFilePath, PluginInstallation,
3531
};
3632
use golem_common::model::component::{AgentFilePermissions, ComponentName};
33+
use golem_common::model::environment::EnvironmentId;
3734
use golem_common::schema::agent::{AgentTypeSchema, FieldSource, InputSchema, OutputSchema};
3835
use golem_common::schema::graph::SchemaGraph;
39-
use golem_common::model::component_metadata::default_agent_initial_card;
40-
use crate::agent_id_display::render_type_for_language;
41-
use crate::model::app_raw;
42-
use golem_common::model::environment::EnvironmentId;
4336
use heck::{ToLowerCamelCase, ToSnakeCase};
4437
use itertools::Itertools;
4538
use serde::{Deserialize, Serialize};
@@ -433,7 +426,6 @@ pub fn agent_interface_name(component: &ComponentDto, agent_type_name: &str) ->
433426
}
434427
}
435428

436-
437429
#[cfg(test)]
438430
mod tests {
439431
use super::{AgentTypeManifestProvisionConfig, ParsedInitialPermissionCard};

golem-common/src/base_model/component.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ use crate::base_model::plugin_registration::PluginRegistrationId;
2424
use crate::base_model::validate_lower_kebab_case_identifier;
2525
use crate::base_model::worker::AgentConfigEntryDto;
2626
use crate::model::agent::AgentTypeName;
27-
use crate::schema::agent::AgentTypeSchema;
2827
use crate::model::card::recipient::RecipientPattern;
2928
use crate::model::card::{
3029
PolymorphicCard, PolymorphicPermissionPattern, default_agent_initial_permission_grants,
3130
render_polymorphic_permission,
3231
};
32+
use crate::schema::agent::AgentTypeSchema;
3333
use crate::{
3434
declare_enums, declare_revision, declare_structs, declare_transparent_newtypes, declare_unions,
3535
newtype_uuid,

golem-common/src/base_model/component_metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
use crate::base_model::component::{InitialAgentFile, InstalledPlugin};
1616
use crate::base_model::worker::TypedAgentConfigEntry;
1717
use crate::model::agent::AgentTypeName;
18-
use crate::schema::AgentTypeSchema;
1918
use crate::model::card::PolymorphicCard;
19+
use crate::schema::AgentTypeSchema;
2020
use serde::{Deserialize, Serialize, Serializer};
2121
use std::collections::BTreeMap;
2222
use std::fmt;

golem-registry-service/src/services/component/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ impl ComponentWriteService {
828828
component_revision: ComponentRevision,
829829
update: AgentTypeProvisionConfigUpdate,
830830
uploaded_files: &HashMap<ArchiveFilePath, (AgentFileContentHash, u64)>,
831-
agent_type: &AgentType,
831+
agent_type: &AgentTypeSchema,
832832
environment: &Environment,
833833
auth: &AuthCtx,
834834
) -> Result<AgentTypeProvisionConfig, ComponentError> {

golem-test-framework/src/config/dsl_impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ use crate::components::redis::Redis;
1616
use crate::config::TestDependencies;
1717
use crate::dsl::{
1818
AgentResult, EnvironmentOptions, TestDsl, TestDslExtended, WorkerLogEventStream,
19-
build_ifs_archive,
20-
default_agent_type_provision_config_creation_for_account,
19+
build_ifs_archive, default_agent_type_provision_config_creation_for_account,
2120
};
2221
use crate::model::IFSEntry;
2322
use anyhow::{Context, anyhow};

golem-worker-executor-test-utils/src/dsl_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use golem_api_grpc::proto::golem::workerexecutor::v1::{
3232
use golem_common::base_model::component_metadata::AgentTypeProvisionConfig;
3333
use golem_common::base_model::worker::TypedAgentConfigEntry;
3434
use golem_common::model::PromiseId;
35-
use golem_common::model::agent::ParsedAgentId;
3635
use golem_common::model::account::AccountEmail;
36+
use golem_common::model::agent::ParsedAgentId;
3737
use golem_common::model::agent::{AgentFileContentHash, AgentTypeName};
3838
use golem_common::model::component::{
3939
AgentFilePath, AgentTypeProvisionConfigCreation, AgentTypeProvisionConfigUpdate,

integration-tests/tests/api/component.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,14 @@ async fn component_update_preserves_existing_provision_config_when_omitted(
400400
updated_component
401401
.metadata
402402
.agent_type_config(&AgentTypeName("CounterAgent".to_string()))
403-
.unwrap_or_default(),
404-
&[golem_common::model::worker::TypedAgentConfigEntry {
405-
path: vec!["var1".to_string()],
406-
value: ValueAndType::new(Value::String("value1".to_string()), str())
407-
}]
403+
.unwrap_or_default()
404+
.iter()
405+
.map(|e| (e.path.clone(), e.value.value().clone()))
406+
.collect::<Vec<_>>(),
407+
vec![(
408+
vec!["var1".to_string()],
409+
SchemaValue::String("value1".to_string())
410+
)]
408411
);
409412
assert_eq!(
410413
updated_component

openapi/golem-registry-service.yaml

Lines changed: 105 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -8163,20 +8163,6 @@ components:
81638163
format: uint64
81648164
secretValue:
81658165
$ref: '#/components/schemas/OptionalFieldUpdate_SchemaValue'
8166-
AgentTypeInitialPermissionBoundCreation:
8167-
type: object
8168-
title: AgentTypeInitialPermissionBoundCreation
8169-
properties:
8170-
positive:
8171-
type: array
8172-
default: []
8173-
items:
8174-
type: string
8175-
negative:
8176-
type: array
8177-
default: []
8178-
items:
8179-
type: string
81808166
AgentTypeInitialPermission:
81818167
type: object
81828168
title: AgentTypeInitialPermission
@@ -8199,6 +8185,51 @@ components:
81998185
- default:
82008186
negative: []
82018187
positive: []
8188+
AgentTypeInitialPermissionBoundCreation:
8189+
type: object
8190+
title: AgentTypeInitialPermissionBoundCreation
8191+
properties:
8192+
positive:
8193+
type: array
8194+
default: []
8195+
items:
8196+
type: string
8197+
negative:
8198+
type: array
8199+
default: []
8200+
items:
8201+
type: string
8202+
AgentTypeProvisionConfig:
8203+
type: object
8204+
title: AgentTypeProvisionConfig
8205+
description: |-
8206+
Per-agent-type provisioning configuration stored alongside AgentType declarations
8207+
in ComponentMetadata. Holds runtime setup data separate from agent type declarations.
8208+
required:
8209+
- initialPermission
8210+
- env
8211+
- config
8212+
- plugins
8213+
- files
8214+
properties:
8215+
initialPermission:
8216+
$ref: '#/components/schemas/PolymorphicCard'
8217+
env:
8218+
type: object
8219+
additionalProperties:
8220+
type: string
8221+
config:
8222+
type: array
8223+
items:
8224+
$ref: '#/components/schemas/TypedAgentConfigEntry'
8225+
plugins:
8226+
type: array
8227+
items:
8228+
$ref: '#/components/schemas/InstalledPlugin'
8229+
files:
8230+
type: array
8231+
items:
8232+
$ref: '#/components/schemas/InitialAgentFile'
82028233
AgentTypeProvisionConfigCreation:
82038234
type: object
82048235
title: AgentTypeProvisionConfigCreation
@@ -10174,6 +10205,26 @@ components:
1017410205
type: array
1017510206
items:
1017610207
$ref: '#/components/schemas/PathSegment'
10208+
InitialAgentFile:
10209+
type: object
10210+
title: InitialAgentFile
10211+
required:
10212+
- contentHash
10213+
- path
10214+
- permissions
10215+
- size
10216+
properties:
10217+
contentHash:
10218+
type: string
10219+
format: hash
10220+
path:
10221+
type: string
10222+
description: Absolute path in an agent's filesystem.
10223+
permissions:
10224+
$ref: '#/components/schemas/AgentFilePermissions'
10225+
size:
10226+
type: integer
10227+
format: uint64
1017710228
InputSchema:
1017810229
type: object
1017910230
oneOf:
@@ -10190,6 +10241,43 @@ components:
1019010241
type: array
1019110242
items:
1019210243
$ref: '#/components/schemas/NamedField'
10244+
InstalledPlugin:
10245+
type: object
10246+
title: InstalledPlugin
10247+
required:
10248+
- environmentPluginGrantId
10249+
- priority
10250+
- parameters
10251+
- pluginRegistrationId
10252+
- pluginName
10253+
- pluginVersion
10254+
properties:
10255+
environmentPluginGrantId:
10256+
type: string
10257+
format: uuid
10258+
priority:
10259+
type: integer
10260+
format: int32
10261+
title: |-
10262+
Priority of a given plugin. Plugins with a lower priority will be applied before plugins with a higher priority.
10263+
There can only be a single plugin with a given priority installed to a component.
10264+
parameters:
10265+
type: object
10266+
additionalProperties:
10267+
type: string
10268+
pluginRegistrationId:
10269+
type: string
10270+
format: uuid
10271+
pluginName:
10272+
type: string
10273+
pluginVersion:
10274+
type: string
10275+
oplogProcessorComponentId:
10276+
type: string
10277+
format: uuid
10278+
oplogProcessorComponentRevision:
10279+
type: integer
10280+
format: uint64
1019310281
KnownExports:
1019410282
type: object
1019510283
title: KnownExports
@@ -11100,6 +11188,8 @@ components:
1110011188
type: string
1110111189
format: uuid
1110211190
description: EnvironmentPluginGrantId to identify the plugin to update
11191+
PolymorphicCard:
11192+
type: object
1110311193
ProducerField:
1110411194
type: object
1110511195
title: ProducerField
@@ -12541,105 +12631,6 @@ components:
1254112631
- nullable: true
1254212632
metadata:
1254312633
$ref: '#/components/schemas/MetadataEnvelope'
12544-
AgentTypeProvisionConfig:
12545-
type: object
12546-
title: AgentTypeProvisionConfig
12547-
description: |-
12548-
Per-agent-type provisioning configuration stored alongside AgentType declarations
12549-
in ComponentMetadata. Holds runtime setup data separate from agent type declarations.
12550-
required:
12551-
- initialPermission
12552-
- env
12553-
- config
12554-
- plugins
12555-
- files
12556-
properties:
12557-
initialPermission:
12558-
$ref: '#/components/schemas/PolymorphicCard'
12559-
env:
12560-
type: object
12561-
additionalProperties:
12562-
type: string
12563-
config:
12564-
type: array
12565-
items:
12566-
$ref: '#/components/schemas/TypedAgentConfigEntry'
12567-
plugins:
12568-
type: array
12569-
items:
12570-
$ref: '#/components/schemas/InstalledPlugin'
12571-
files:
12572-
type: array
12573-
items:
12574-
$ref: '#/components/schemas/InitialAgentFile'
12575-
InitialAgentFile:
12576-
type: object
12577-
title: InitialAgentFile
12578-
required:
12579-
- contentHash
12580-
- path
12581-
- permissions
12582-
- size
12583-
properties:
12584-
contentHash:
12585-
type: string
12586-
format: hash
12587-
path:
12588-
type: string
12589-
description: Absolute path in an agent's filesystem.
12590-
permissions:
12591-
$ref: '#/components/schemas/AgentFilePermissions'
12592-
size:
12593-
type: integer
12594-
format: uint64
12595-
InstalledPlugin:
12596-
type: object
12597-
title: InstalledPlugin
12598-
required:
12599-
- environmentPluginGrantId
12600-
- priority
12601-
- parameters
12602-
- pluginRegistrationId
12603-
- pluginName
12604-
- pluginVersion
12605-
properties:
12606-
environmentPluginGrantId:
12607-
type: string
12608-
format: uuid
12609-
priority:
12610-
type: integer
12611-
format: int32
12612-
title: |-
12613-
Priority of a given plugin. Plugins with a lower priority will be applied before plugins with a higher priority.
12614-
There can only be a single plugin with a given priority installed to a component.
12615-
parameters:
12616-
type: object
12617-
additionalProperties:
12618-
type: string
12619-
pluginRegistrationId:
12620-
type: string
12621-
format: uuid
12622-
pluginName:
12623-
type: string
12624-
pluginVersion:
12625-
type: string
12626-
oplogProcessorComponentId:
12627-
type: string
12628-
format: uuid
12629-
oplogProcessorComponentRevision:
12630-
type: integer
12631-
format: uint64
12632-
PolymorphicCard:
12633-
type: object
12634-
ValueAndType:
12635-
type: object
12636-
required:
12637-
- typ
12638-
- value
12639-
properties:
12640-
typ:
12641-
$ref: '#/components/schemas/AnalysedType'
12642-
value: {}
1264312634
VersionInfo:
1264412635
type: object
1264512636
title: VersionInfo
@@ -12667,3 +12658,4 @@ components:
1266712658
Token:
1266812659
type: http
1266912660
scheme: bearer
12661+

0 commit comments

Comments
 (0)