-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return all Constraint during Compilation #1242
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goetzrrGit
changed the title
Return all Constraint Compilation
Return all Constraint during Compilation
Nov 9, 2023
goetzrrGit
added
constraints
Anything related to the constraints domain
bug
Something isn't working
database
Anything related to the database
clipper
Requests from the Europa Clipper project
labels
Nov 9, 2023
Mythicaeda
reviewed
Nov 9, 2023
merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintAction.java
Show resolved
Hide resolved
merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintAction.java
Outdated
Show resolved
Hide resolved
merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintAction.java
Outdated
Show resolved
Hide resolved
merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintAction.java
Outdated
Show resolved
Hide resolved
merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintAction.java
Outdated
Show resolved
Hide resolved
.../main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/InsertConstraintRunsAction.java
Outdated
Show resolved
Hide resolved
.../main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/InsertConstraintRunsAction.java
Outdated
Show resolved
Hide resolved
merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java
Outdated
Show resolved
Hide resolved
e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/ConstraintsTests.java
Outdated
Show resolved
Hide resolved
e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/ConstraintsTests.java
Outdated
Show resolved
Hide resolved
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 10, 2023 20:16
28f93af
to
fa1f25e
Compare
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 10, 2023 20:25
fa1f25e
to
55f2dbb
Compare
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 10, 2023 20:35
55f2dbb
to
c1dece0
Compare
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 14, 2023 22:04
c1dece0
to
957abf3
Compare
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 15, 2023 18:25
957abf3
to
35387eb
Compare
@Mythicaeda I believe I fixed everything you suggested in the ConstraintTest. I have updated all the tests with optional checking and did some parameter renaming to make it more clear. |
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 21, 2023 20:00
c7f2790
to
b82363d
Compare
Mythicaeda
approved these changes
Nov 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/ConstraintsTests.java
Outdated
Show resolved
Hide resolved
e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/ConstraintsTests.java
Outdated
Show resolved
Hide resolved
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 21, 2023 21:38
b82363d
to
b8021f7
Compare
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 21, 2023 21:45
b8021f7
to
54fc73f
Compare
The Failable class facilitates the storage of an object along with a status indicating success or failure.
With the integration of the Failable class, I've eliminated the short-circuit behavior, enabling all constraints to be executed even in the presence of an error. However, exceptions are still raised when either no plan exists or the simulation dataset is absent, as attempting to run a list of constraints without sufficient data would serve no purpose.
This fix addresses a bug where a constraint that initially works, is subsequently modified and fails during execution. Previously, attempting to insert the updated constraint would result in an error due to the existing constraint in the table. With this modification, we now override the entry if it is successful again, ensuring smooth execution.
With the implementation of the Failable class, there is no longer a need to throw the ConstraintCompilationException. This exception was previously used to handle compilation errors, but now we capture and handle the data using the Failable class, streamlining the process.
Process the captured Failable and construct a JSON object.
* We are always returning an object now * Update error messages.
goetzrrGit
force-pushed
the
1194--Full_constraint_compilation
branch
from
November 21, 2023 22:09
54fc73f
to
bcc40c4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
clipper
Requests from the Europa Clipper project
constraints
Anything related to the constraints domain
database
Anything related to the database
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Revise the ConstraintAction to avoid immediate termination and exception throwing in the event of a compilation error with a constraint. Instead, store these errors in a Failable object, enabling us to retrieve the information later for all constraints. Exceptions are retained for situations where it's illogical to proceed with checking a list of constraints without a plan, mission model, or simulation dataset.
I've also addressed an issue where a constraint previously compiled and ran successfully, but encountered compilation issues after a user modification. Now, when the user rectifies the constraint and it successfully compiles and runs, the SQL throws an exception saying the constraint already exists is
primary_id
. Now we do an update on collision.Verification
A lot of manual testing and e2e test.
Future work
Add badges to constraints that have compilation errors.