Skip to content

[raft/scd] Extract update and create constraint - #1650

Merged
mickmis merged 1 commit into
interuss:masterfrom
Orbitalize:scd_extract_update_create_constraint
Sep 2, 2026
Merged

[raft/scd] Extract update and create constraint#1650
mickmis merged 1 commit into
interuss:masterfrom
Orbitalize:scd_extract_update_create_constraint

Conversation

@MariemBaccari

@MariemBaccari MariemBaccari commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Chained PR: #1627 -> #1642 -> #1643 -> #1644 -> #1645 -> #1646 -> #1649 -> #1650 -> #1651 -> #1653 -> #1654 -> #1656 -> #1657 -> #1655 -> #1666 -> #1667 -> #1668 -> #1669

Extract update and create constraint business logic.

@MariemBaccari
MariemBaccari marked this pull request as ready for review August 20, 2026 08:21
@barroco barroco added the dss-raft Relating to the application-layer consensus implemenation based on raft label Aug 20, 2026
@MariemBaccari
MariemBaccari force-pushed the scd_extract_update_create_constraint branch from b03192b to 2056183 Compare August 28, 2026 10:08

@mickmis mickmis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo clarification.
But what this shows is that we may want to come up with something better for deduplicating validation/parsing of those parameters.
LMK if you agree and have any idea. But in any case for after this PR train is merged
Maybe a Validate field on the OperationHandler?

Comment on lines -300 to -314
// Start and end times are required for each volume
// The end time may not be in the past
valid.uExtent, err = scdmodels.UnionVolumes4DFromSCDRest(
params.Extents,
scdmodels.WithRequireTimeBounds(),
scdmodels.WithRequireEndTimeAfter(now),
)
if err != nil {
return nil, stacktrace.Propagate(err, "Invalid extents")
}

valid.cells, err = valid.uExtent.CalculateSpatialCovering()
if err != nil {
return nil, stacktrace.Propagate(err, "Invalid area")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for not validating here with UnionVolumes4DFromSCDRest and CalculateSpatialCovering anymore?

IIUC the strategy for validation is:

  • keep in REST handlers whatever validation there is, even if it is a side effect of the parsing
  • duplicate in ExecuteXXX functions what is needed for parsing

Is this correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the strategy, I aim to do as much validation as possible on the handler side, especially for bad request cases to avoid doing a consensus round just to end up rejecting the request for such a reason. Indeed, duplication occurs in the operation because the validation also comes with parsing (ID etc.).
For this specific case, not validating the volumes was a mistake on my part (fixed in latest push) as I kept these checks for the subscription side as well. I also merged the validation between the handler and the action / operation and kept the handler specific part (AllowHTTPBaseUrls check) there. 



I just opened issue #1676 to track this duplication issue.

@MariemBaccari
MariemBaccari force-pushed the scd_extract_update_create_constraint branch from 73a9bf9 to f38fd15 Compare September 2, 2026 06:20
@mickmis

mickmis commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Note: ignored failed CI check, see #1660

@mickmis
mickmis merged commit 00dfbc8 into interuss:master Sep 2, 2026
17 of 18 checks passed
@mickmis
mickmis deleted the scd_extract_update_create_constraint branch September 2, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dss-raft Relating to the application-layer consensus implemenation based on raft

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants