Skip to content

[scd] Factorize volume4D union from rest#1381

Merged
mickmis merged 5 commits intointeruss:masterfrom
skyguide-ansp:rest-volume-union
Apr 9, 2026
Merged

[scd] Factorize volume4D union from rest#1381
mickmis merged 5 commits intointeruss:masterfrom
skyguide-ansp:rest-volume-union

Conversation

@RustedBones
Copy link
Copy Markdown
Contributor

@RustedBones RustedBones commented Feb 25, 2026

Fix TODO from the code:

TODO to factor out logic below into common multi-vol4d parse

Remove unused extents field when unioning
Add validator for expired 4D extent

@RustedBones RustedBones force-pushed the rest-volume-union branch 2 times, most recently from a99b97c to d712e54 Compare February 26, 2026 16:29
@RustedBones RustedBones force-pushed the rest-volume-union branch 2 times, most recently from 415c243 to 81eac87 Compare April 8, 2026 06:46
@RustedBones RustedBones marked this pull request as ready for review April 8, 2026 07:00
Copy link
Copy Markdown
Contributor

@mickmis mickmis left a comment

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 +104 to +108
for _, validator := range validators {
if err := validator(union); err != nil {
return nil, err
}
}
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.

Possible behavior change: before this PR the validators are invoked on each individual volume, and after it is on the aggregated one. Could we face a scenario where some individually invalid volumes are unionized into a valid one? Or the opposite?
Out of caution and since this is used as well as validation of parameters, I would actually do the validation on both individual and unionized volumes. And in any case, make clear in the function doc what is the expected behavior. WDYT?

Also, factor away this loop? Duplicated with function above.

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.

Could we face a scenario where some individually invalid volumes are unionized into a valid one? Or the opposite?

Yes, that was my concern in #1380 (comment). I think extent with some expired volumes should not be rejected by the DSS, that's why I moved the validation on the unioned volume. Is that fine ?

I'll add some doc and factor the loop.

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.

Just to be sure we're alligned on this one, the doc states:

Spacetime extents that bound this operational intent. Start and end times, as well as lower and upper altitudes, are required for each volume. The end time may not be in the past.

I think to move the validation on the unioned extent so we can accept composite extens with some expired volumes but not all. is that correct ?

Hum that's an interesting case. IMO with a strict interpretation of the wording, the API would require all individual volumes to not end in the past. Now, implementation-wise, I do agree we should accept it as long as the aggregated volume is not in the past. And that's indeed what the current implementation is doing. So, agree with you for the 'end time not in the past' check.

As far as the other validations are concerned (time and altitude bounds), if they fail on an individual volume, they will fail for the aggregated one. So there will be no behavior change with the changes in this PR.

All in all LGTM with the clarification in the function doc of the behavior.

@mickmis mickmis merged commit 955aed1 into interuss:master Apr 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants