Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 7157f02

Browse files
merge: #3491
3491: Rename ChangeSetPointer to ChangeSet (ENG-2409) r=nickgerace a=nickgerace ## Description This PR renames `ChangeSetPointer` to `ChangeSet`. It removes the old `change_set` module in the dal and replaces it with the `change_set_pointer` module. Events and status enums, structs and functions are moved to two new submodules. In addition, `force_changeset_pk` is replaced with `force_change_set_id` in both sdf and the frontend. <img src="https://media0.giphy.com/media/NsGxDa83fS0B13yIQ5/giphy.gif"/> ## History This PR is what #3453 set out to do. It is the direct continuation of #3490 #3450 (and indirect continuation of #3446 #3433). ## Disclaimer Only cosmetic changes are present (other than `force_change_set_id`). Migrations are untouched. Methods are struct are left intact, barring renamed fields and types. Co-authored-by: Nick Gerace <nick@systeminit.com>
2 parents 2748150 + ff81d51 commit 7157f02

81 files changed

Lines changed: 1115 additions & 1217 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/web/src/store/apis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ function injectBearerTokenAuth(config: InternalAxiosRequestConfig) {
3838
sdfApiInstance.interceptors.request.use(injectBearerTokenAuth);
3939

4040
async function handleForcedChangesetRedirection(response: AxiosResponse) {
41-
if (response.headers.force_changeset_pk) {
41+
if (response.headers.force_change_set_id) {
4242
const changeSetsStore = useChangeSetsStore();
4343
await changeSetsStore.setActiveChangeset(
44-
response.headers.force_changeset_pk,
44+
response.headers.force_change_set_id,
4545
);
4646
}
4747

lib/dal-test/src/helpers.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use color_eyre::Result;
2-
use dal::change_set_pointer::{ChangeSetId, ChangeSetPointer};
2+
use dal::change_set::{ChangeSet, ChangeSetId};
33
use dal::{DalContext, UserClaim};
44
use jwt_simple::algorithms::RSAKeyPairLike;
55
use jwt_simple::{claims::Claims, reexports::coarsetime::Duration};
@@ -143,13 +143,13 @@ pub async fn create_change_set_and_update_ctx(
143143
ctx: &mut DalContext,
144144
base_change_set_id: ChangeSetId,
145145
) {
146-
let base_change_set = ChangeSetPointer::find(ctx, base_change_set_id)
146+
let base_change_set = ChangeSet::find(ctx, base_change_set_id)
147147
.await
148148
.expect("could not perform find change set")
149149
.expect("no change set found");
150-
let mut change_set = ChangeSetPointer::new(ctx, generate_fake_name(), Some(base_change_set_id))
150+
let mut change_set = ChangeSet::new(ctx, generate_fake_name(), Some(base_change_set_id))
151151
.await
152-
.expect("could not create change set pointer");
152+
.expect("could not create change set");
153153
change_set
154154
.update_pointer(
155155
ctx,

lib/dal/src/action.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub mod batch;
1111
pub mod prototype;
1212
pub mod runner;
1313

14-
use crate::change_set_pointer::ChangeSetError;
14+
use crate::change_set::ChangeSetError;
1515
use crate::layer_db_types::ComponentContent;
1616
use crate::workspace_snapshot::content_address::{ContentAddress, ContentAddressDiscriminants};
1717
use crate::workspace_snapshot::edge_weight::EdgeWeightKindDiscriminants;
@@ -130,7 +130,7 @@ impl Action {
130130
)
131131
.await?;
132132

133-
let change_set = ctx.change_set_pointer()?;
133+
let change_set = ctx.change_set()?;
134134
let id = change_set.generate_ulid()?;
135135
let node_weight = NodeWeight::new_content(change_set, id, ContentAddress::Action(hash))?;
136136
let action_prototype = ActionPrototype::get_by_id(ctx, prototype_id).await?;
@@ -170,7 +170,7 @@ impl Action {
170170

171171
pub async fn delete(self, ctx: &DalContext) -> ActionResult<()> {
172172
let workspace_snapshot = ctx.workspace_snapshot()?;
173-
let change_set = ctx.change_set_pointer()?;
173+
let change_set = ctx.change_set()?;
174174
workspace_snapshot
175175
.remove_node_by_id(change_set, self.id)
176176
.await?;

lib/dal/src/action/batch.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::sync::Arc;
1111
use telemetry::prelude::*;
1212
use thiserror::Error;
1313

14-
use crate::change_set_pointer::ChangeSetError;
14+
use crate::change_set::ChangeSetError;
1515
use crate::workspace_snapshot::content_address::{ContentAddress, ContentAddressDiscriminants};
1616
use crate::workspace_snapshot::edge_weight::{
1717
EdgeWeight, EdgeWeightError, EdgeWeightKind, EdgeWeightKindDiscriminants,
@@ -152,7 +152,7 @@ impl ActionBatch {
152152
)
153153
.await?;
154154

155-
let change_set = ctx.change_set_pointer()?;
155+
let change_set = ctx.change_set()?;
156156
let id = change_set.generate_ulid()?;
157157
let node_weight =
158158
NodeWeight::new_content(change_set, id, ContentAddress::ActionBatch(hash))?;
@@ -273,7 +273,7 @@ impl ActionBatch {
273273
.await?;
274274

275275
ctx.workspace_snapshot()?
276-
.update_content(ctx.change_set_pointer()?, self.id.into(), hash)
276+
.update_content(ctx.change_set()?, self.id.into(), hash)
277277
.await?;
278278

279279
Ok(())

lib/dal/src/action/prototype.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::sync::Arc;
88
use strum::{AsRefStr, Display};
99
use thiserror::Error;
1010

11-
use crate::change_set_pointer::ChangeSetError;
11+
use crate::change_set::ChangeSetError;
1212
use crate::workspace_snapshot::content_address::ContentAddress;
1313
use crate::workspace_snapshot::edge_weight::EdgeWeightKindDiscriminants;
1414
use crate::workspace_snapshot::edge_weight::{EdgeWeight, EdgeWeightError, EdgeWeightKind};
@@ -185,7 +185,7 @@ impl ActionPrototype {
185185
)
186186
.await?;
187187

188-
let change_set = ctx.change_set_pointer()?;
188+
let change_set = ctx.change_set()?;
189189
let id = change_set.generate_ulid()?;
190190
let node_weight =
191191
NodeWeight::new_content(change_set, id, ContentAddress::ActionPrototype(hash))?;

lib/dal/src/action/runner.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use telemetry::prelude::*;
1313
use thiserror::Error;
1414

1515
use crate::action::batch::ActionBatchId;
16-
use crate::change_set_pointer::ChangeSetError;
16+
use crate::change_set::ChangeSetError;
1717
use crate::func::binding_return_value::FuncBindingReturnValueError;
1818
use crate::workspace_snapshot::content_address::ContentAddress;
1919
use crate::workspace_snapshot::edge_weight::EdgeWeightKindDiscriminants;
@@ -236,7 +236,7 @@ impl ActionRunner {
236236
)
237237
.await?;
238238

239-
let change_set = ctx.change_set_pointer()?;
239+
let change_set = ctx.change_set()?;
240240
let id = change_set.generate_ulid()?;
241241
let node_weight =
242242
NodeWeight::new_content(change_set, id, ContentAddress::ActionRunner(hash))?;
@@ -366,7 +366,7 @@ impl ActionRunner {
366366
.await?;
367367

368368
ctx.workspace_snapshot()?
369-
.update_content(ctx.change_set_pointer()?, self.id.into(), hash)
369+
.update_content(ctx.change_set()?, self.id.into(), hash)
370370
.await?;
371371

372372
Ok(())

lib/dal/src/attribute/prototype.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use thiserror::Error;
2121

2222
use crate::attribute::prototype::argument::value_source::ValueSource;
2323
use crate::attribute::prototype::argument::AttributePrototypeArgument;
24-
use crate::change_set_pointer::ChangeSetError;
24+
use crate::change_set::ChangeSetError;
2525
use crate::layer_db_types::{AttributePrototypeContent, AttributePrototypeContentV1};
2626
use crate::workspace_snapshot::content_address::{ContentAddress, ContentAddressDiscriminants};
2727
use crate::workspace_snapshot::edge_weight::{
@@ -124,7 +124,7 @@ impl AttributePrototype {
124124
)
125125
.await?;
126126

127-
let change_set = ctx.change_set_pointer()?;
127+
let change_set = ctx.change_set()?;
128128
let id = change_set.generate_ulid()?;
129129
let node_weight =
130130
NodeWeight::new_content(change_set, id, ContentAddress::AttributePrototype(hash))?;
@@ -280,7 +280,7 @@ impl AttributePrototype {
280280
attribute_prototype_id,
281281
))?;
282282

283-
let change_set = ctx.change_set_pointer()?;
283+
let change_set = ctx.change_set()?;
284284
workspace_snapshot
285285
.remove_edge(
286286
change_set,
@@ -414,7 +414,7 @@ impl AttributePrototype {
414414
ctx: &DalContext,
415415
prototype_id: AttributePrototypeId,
416416
) -> AttributePrototypeResult<()> {
417-
let change_set = ctx.change_set_pointer()?;
417+
let change_set = ctx.change_set()?;
418418

419419
ctx.workspace_snapshot()?
420420
.remove_node_by_id(change_set, prototype_id)

lib/dal/src/attribute/prototype/argument.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use thiserror::Error;
1111
use ulid::Ulid;
1212

1313
use crate::{
14-
change_set_pointer::ChangeSetError,
14+
change_set::ChangeSetError,
1515
func::argument::{FuncArgument, FuncArgumentError, FuncArgumentId},
1616
pk,
1717
socket::input::InputSocketId,
@@ -176,7 +176,7 @@ impl AttributePrototypeArgument {
176176
prototype_id: AttributePrototypeId,
177177
arg_id: FuncArgumentId,
178178
) -> AttributePrototypeArgumentResult<Self> {
179-
let change_set = ctx.change_set_pointer()?;
179+
let change_set = ctx.change_set()?;
180180
let id = change_set.generate_ulid()?;
181181
let node_weight = NodeWeight::new_attribute_prototype_argument(change_set, id, None)?;
182182

@@ -212,7 +212,7 @@ impl AttributePrototypeArgument {
212212
destination_component_id: ComponentId,
213213
destination_attribute_prototype_id: AttributePrototypeId,
214214
) -> AttributePrototypeArgumentResult<Self> {
215-
let change_set = ctx.change_set_pointer()?;
215+
let change_set = ctx.change_set()?;
216216
let id = change_set.generate_ulid()?;
217217
let node_weight = NodeWeight::new_attribute_prototype_argument(
218218
change_set,
@@ -361,7 +361,7 @@ impl AttributePrototypeArgument {
361361
value_id: Ulid,
362362
) -> AttributePrototypeArgumentResult<Self> {
363363
let workspace_snapshot = ctx.workspace_snapshot()?;
364-
let change_set = ctx.change_set_pointer()?;
364+
let change_set = ctx.change_set()?;
365365

366366
for existing_value_source in workspace_snapshot
367367
.outgoing_targets_for_edge_weight_kind(
@@ -554,7 +554,7 @@ impl AttributePrototypeArgument {
554554

555555
// Remove the argument
556556
ctx.workspace_snapshot()?
557-
.remove_node_by_id(ctx.change_set_pointer()?, apa_id)
557+
.remove_node_by_id(ctx.change_set()?, apa_id)
558558
.await?;
559559
// Update the destination attribute values
560560
for av_id_to_update in &avs_to_update {

lib/dal/src/attribute/prototype/argument/static_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl StaticArgumentValue {
5656
)
5757
.await?;
5858

59-
let change_set = ctx.change_set_pointer()?;
59+
let change_set = ctx.change_set()?;
6060
let id = change_set.generate_ulid()?;
6161
let node_weight =
6262
NodeWeight::new_content(change_set, id, ContentAddress::StaticArgumentValue(hash))?;

lib/dal/src/attribute/value.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use ulid::Ulid;
5252
pub use dependent_value_graph::DependentValueGraph;
5353

5454
use crate::attribute::prototype::AttributePrototypeError;
55-
use crate::change_set_pointer::ChangeSetError;
55+
use crate::change_set::ChangeSetError;
5656
use crate::func::argument::{FuncArgument, FuncArgumentError};
5757
use crate::func::before_funcs_for_component;
5858
use crate::func::binding::{FuncBinding, FuncBindingError};
@@ -296,7 +296,7 @@ impl AttributeValue {
296296
maybe_parent_attribute_value: Option<AttributeValueId>,
297297
key: Option<String>,
298298
) -> AttributeValueResult<Self> {
299-
let change_set = ctx.change_set_pointer()?;
299+
let change_set = ctx.change_set()?;
300300
let id = change_set.generate_ulid()?;
301301
let node_weight = NodeWeight::new_attribute_value(change_set, id, None, None, None, None)?;
302302
let is_for = is_for.into();
@@ -1025,7 +1025,7 @@ impl AttributeValue {
10251025

10261026
workspace_snapshot
10271027
.remove_edge(
1028-
ctx.change_set_pointer()?,
1028+
ctx.change_set()?,
10291029
current_node_index,
10301030
current_target_idx,
10311031
EdgeWeightKindDiscriminants::Contain,
@@ -1662,7 +1662,7 @@ impl AttributeValue {
16621662
ctx.workspace_snapshot()?
16631663
.add_edge(
16641664
attribute_value_id,
1665-
EdgeWeight::new(ctx.change_set_pointer()?, EdgeWeightKind::Prototype(None))?,
1665+
EdgeWeight::new(ctx.change_set()?, EdgeWeightKind::Prototype(None))?,
16661666
attribute_prototype_id,
16671667
)
16681668
.await?;
@@ -1682,7 +1682,7 @@ impl AttributeValue {
16821682

16831683
ctx.workspace_snapshot()?
16841684
.remove_edge_for_ulids(
1685-
ctx.change_set_pointer()?,
1685+
ctx.change_set()?,
16861686
attribute_value_id,
16871687
prototype_id,
16881688
EdgeWeightKindDiscriminants::Prototype,
@@ -1847,7 +1847,7 @@ impl AttributeValue {
18471847
);
18481848

18491849
let mut new_av_node_weight =
1850-
av_node_weight.new_with_incremented_vector_clock(ctx.change_set_pointer()?)?;
1850+
av_node_weight.new_with_incremented_vector_clock(ctx.change_set()?)?;
18511851

18521852
new_av_node_weight.set_materialized_view(view_address.map(ContentAddress::JsonValue));
18531853

@@ -1920,7 +1920,7 @@ impl AttributeValue {
19201920
};
19211921

19221922
let mut new_av_node_weight =
1923-
av_node_weight.new_with_incremented_vector_clock(ctx.change_set_pointer()?)?;
1923+
av_node_weight.new_with_incremented_vector_clock(ctx.change_set()?)?;
19241924

19251925
new_av_node_weight.set_value(value_address.map(ContentAddress::JsonValue));
19261926
new_av_node_weight
@@ -2113,7 +2113,7 @@ impl AttributeValue {
21132113
let av = Self::get_by_id(ctx, id).await?;
21142114

21152115
ctx.workspace_snapshot()?
2116-
.remove_node_by_id(ctx.change_set_pointer()?, av.id)
2116+
.remove_node_by_id(ctx.change_set()?, av.id)
21172117
.await?;
21182118

21192119
ctx.enqueue_dependent_values_update(vec![parent_av_id])

0 commit comments

Comments
 (0)