-
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
Versioning Constraints - DON'T MERGE without UI #1278
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
b29a4b1
to
5db94c3
Compare
5db94c3
to
6c81e85
Compare
6c81e85
to
71ff624
Compare
Mythicaeda
commented
Jan 17, 2024
merlin-server/sql/merlin/tables/constraint_model_specification.sql
Outdated
Show resolved
Hide resolved
Mythicaeda
commented
Jan 17, 2024
deployment/hasura/migrations/AerieMerlin/36_constraint_versioning/up.sql
Outdated
Show resolved
Hide resolved
71ff624
to
b1632e5
Compare
30721b2
to
08adeb3
Compare
08adeb3
to
e96f60b
Compare
e96f60b
to
c8bbb03
Compare
Change just pushed was to tweak the Hasura Metadata to allow users to add and view all constraints on the plan's model spec, even if they are private. Users would've had issues when syncing their plan to the model spec without this change. |
- Update Tests in TagsTests - Add functions in TagsTests for applying/fetching tags on a constraint definition - Update inserting a constraint in MerlinDBTestHelper
- remove ConstraintType - add constraintRevision - remove MissionModelRepository.getConstraints - rename getAllConstraintsInPlan to getPlanConstraints
- Update and Add GQL queries related to constraints - Update types - Add ConstraintsTests for versioning and enabling/disabling constraints - Remove tests that checked `definitionOutdated`, which doesn't exist anymore
c8bbb03
to
a22e725
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
A change that will require updating downstream code
constraints
Anything related to the constraints domain
database
Anything related to the database
DON'T MERGE
Do Not Merge This Branch
feature
A new feature or feature request
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
This PR is essentially an overhaul of how constraints were represented in the DB.
Below is a breakdown of the changes. Keep in mind when discussing permissions that unless a permission explicitly addresses the
aerie_admin
role, assume that it doesn't apply.constraints
table has been replaced by theconstraint_metadata
andconstraint_definition
tables. Theconstraint_definition
table contains the various versioned definitions of a constraint, whileconstraint_metadata
contains the metadata consistent across all definitions (ie the name of the constraint). Once a version is created, it can only be updated by an admin user. The owner of a constraint can freely delete unused versions (see 3). Any user can create versions of public constraints (see 2). Both the overall constraint and each specific version can be tagged.SELECT
ed unless it is public, or the user doing theSELECT
either owns the constraint or can manage a constraint specification it is on.QUICK LIST BREAKING CHANGES:
CheckConstraints
action has been altered:type
field has been removedconstraintRevision
field has been addedconstraints
table has been split into two tables:constraint_metadata
andconstraint_definition
. Additionally, plans and models now have constraint specifications. Any GQL queries referencing theconstraints
table will now need to reference at least one of these four tables, with which specific one varying based on what the query was doing.Verification
DB Tests:
e2eTests:
definitionOutdated
were removedDocumentation
Open Docs ticket
Future work
Scheduling Goals need to be changed in a similar way