Skip to content
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
19 changes: 10 additions & 9 deletions examples/manifests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ per entity kind.
`acme` holds no bounded context. Every other namespace is one bounded
context that realizes one `acme` subdomain across namespaces.

Apply a namespace in one atomic batch, check it without writing, or detect
drift between the files and a running server:

```sh
trogon-atlas apply -f examples/manifests/acme-storefront/ # idempotent
trogon-atlas apply -f examples/manifests/acme-storefront/ --dry-run # validate only
trogon-atlas diff -f examples/manifests/acme-storefront/ # exit 1 on drift
```

Apply `acme` first, because every context realizes one of its subdomains.
`acme-fulfillment` references entities in `acme-storefront`, and
`acme-reviews` references entities in `acme-fulfillment`, so apply them
Expand All @@ -37,6 +28,16 @@ trogon-atlas apply -f examples/manifests/acme/ examples/manifests/acme-storefron
examples/manifests/acme-fulfillment/ examples/manifests/acme-reviews/
```

Once its dependencies are in the store, apply a namespace in one atomic
batch, check it without writing, or detect drift between the files and a
running server:

```sh
trogon-atlas apply -f examples/manifests/acme-storefront/ # idempotent
trogon-atlas apply -f examples/manifests/acme-storefront/ --dry-run # validate only
trogon-atlas diff -f examples/manifests/acme-storefront/ # exit 1 on drift
```

`acme-customer-data-deletion` and `acme-wishlist` only need `acme`. To
build `acme-wishlist` step by step, follow
[start an event model from scratch](../../docs/how-to/start-a-model-from-scratch.md).
Expand Down
13 changes: 8 additions & 5 deletions rsworkspace/crates/trogon-atlas-server/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2370,7 +2370,7 @@ fn merge_strategic_findings(
.map(|m| (m.kind, m.id.clone()))
.collect();
let mut findings: Vec<pb::ValidationIssue> =
validation::strategic_issues_by_change(&changes, post_world)
validation::strategic_issues_by_change(&changes, pre_world, post_world)
.into_iter()
.flatten()
.collect();
Expand Down Expand Up @@ -4480,7 +4480,7 @@ impl pb::event_model_service_server::EventModelService for EventModelServiceImpl
let all = self.snapshot_for(branch.as_deref(), &vis).await?;
let world = world_after(&all, &[(kind, &id, Some(&entity))]);
scenario_issues.extend(
validation::strategic_issues_by_change(&[(kind, id.clone())], &world)
validation::strategic_issues_by_change(&[(kind, id.clone())], &all, &world)
.into_iter()
.flatten(),
);
Expand Down Expand Up @@ -5225,9 +5225,12 @@ impl pb::event_model_service_server::EventModelService for EventModelServiceImpl
.iter()
.map(|i| (metas[*i].kind, metas[*i].id.clone()))
.collect();
for (op_index, issues) in strategic_ops
.iter()
.zip(validation::strategic_issues_by_change(&changes, &world))
for (op_index, issues) in
strategic_ops
.iter()
.zip(validation::strategic_issues_by_change(
&changes, &base, &world,
))
{
per_op_validation[*op_index] = issues;
}
Expand Down
Loading
Loading