Skip to content

[raft/scd] Extract update and create opintent - #1655

Open
MariemBaccari wants to merge 1 commit into
interuss:masterfrom
Orbitalize:scd_extract_update_create_opintent
Open

[raft/scd] Extract update and create opintent#1655
MariemBaccari wants to merge 1 commit into
interuss:masterfrom
Orbitalize:scd_extract_update_create_opintent

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 opintent business logic.

@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_opintent branch 3 times, most recently from a3d311c to 2039b92 Compare August 20, 2026 10:50
@MariemBaccari
MariemBaccari force-pushed the scd_extract_update_create_opintent branch 6 times, most recently from 9fc4cb3 to f6c373b Compare August 21, 2026 14:49
@MariemBaccari
MariemBaccari marked this pull request as ready for review August 21, 2026 14:52
@MariemBaccari
MariemBaccari force-pushed the scd_extract_update_create_opintent branch from f6c373b to c5604fb Compare August 28, 2026 10:11

@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.

Review waiting on #1651

@MariemBaccari
MariemBaccari force-pushed the scd_extract_update_create_opintent branch 5 times, most recently from 0d6721d to 61358c3 Compare September 8, 2026 15:19

@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 comments

Comment on lines -206 to -209
manager, err := actions.CheckUpsertPermissionsAndReturnManager(authorizedManager, validParams.State)
if err != nil {
return nil, nil, stacktrace.PropagateWithCode(err, dsserr.PermissionDenied, "Caller is not allowed to upsert with the requested state")
}

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.

  • looks like this should be invoked in REST handler for validation
  • and could actually be dropped in the ExecutePutOperationalIntentReference function: if validated the only thing it returns is dssmodels.Manager(*authorizedManager.ClientID)

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.

Addressed in latest push

if err != nil {
// responseConflict is non-nil here on a dsserr.MissingOVNs error: return it alongside
// the error so the handler can still send it to the client. See the doc comment above.
return &PutOperationalIntentReferenceResult{Conflict: responseConflict}, stacktrace.PropagateWithCode(err, stacktrace.GetCode(err), "Failed to validate key")

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.

This is the only instance of returning an error from the execute function while still returning a 'valid' response. I think this is confusing, unnecessary and we should get rid of it. Of dsserr.MissingOVNs too. And in the HTTP handler we can just check for a non-nil result.Conflict. WDYT? (does not have to be in this PR)

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.

I agree, thanks for suggesting this. I just opened #1690 to address the comment.

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: No status

Development

Successfully merging this pull request may close these issues.

3 participants