Skip to content
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

Migrate existing rule instances into rule_instances table #3534

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

dmjb
Copy link
Contributor

@dmjb dmjb commented Jun 5, 2024

Depends on #3486

This PR adds a migration script to move all rule instances created before PR #3486 to the rule_instances table.

Tested locally.

Summary

Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.

Fixes #(related issue)

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@dmjb dmjb force-pushed the migrate-rule-instance-new-table branch from a8e6a81 to e6f0719 Compare June 5, 2024 08:56
@coveralls
Copy link

Coverage Status

coverage: 53.117% (-0.01%) from 53.127%
when pulling e6f0719 on migrate-rule-instance-new-table
into 936892a on main.

@coveralls
Copy link

Coverage Status

coverage: 53.112% (-0.02%) from 53.127%
when pulling e6f0719 on migrate-rule-instance-new-table
into 936892a on main.

@coveralls
Copy link

Coverage Status

coverage: 53.127%. remained the same
when pulling e6f0719 on migrate-rule-instance-new-table
into 936892a on main.

@coveralls
Copy link

Coverage Status

coverage: 53.117% (-0.01%) from 53.127%
when pulling 004ca6a on migrate-rule-instance-new-table
into 936892a on main.

@dmjb dmjb force-pushed the migrate-rule-instance-new-table branch from 004ca6a to e1f55b1 Compare June 5, 2024 10:57
@coveralls
Copy link

Coverage Status

coverage: 53.189% (+0.005%) from 53.184%
when pulling e1f55b1 on migrate-rule-instance-new-table
into 3d23d1e on main.

@dmjb dmjb force-pushed the migrate-rule-instance-new-table branch 2 times, most recently from 0ab4a70 to f6918ac Compare June 5, 2024 13:38
@dmjb dmjb marked this pull request as ready for review June 5, 2024 13:58
@dmjb dmjb requested a review from a team as a code owner June 5, 2024 13:58
@dmjb dmjb marked this pull request as draft June 5, 2024 13:59
@dmjb dmjb changed the title [DO NOT MERGE] Migrate existing rule instances into rule_instances table Migrate existing rule instances into rule_instances table Jun 5, 2024
@dmjb dmjb marked this pull request as ready for review June 5, 2024 14:05
@dmjb dmjb force-pushed the migrate-rule-instance-new-table branch from 5edf505 to 1cb69a6 Compare June 5, 2024 14:06
dmjb added 2 commits June 5, 2024 15:06
Rule instances are currently stored as serialized protobuf structures in
the database, grouped by entity type. A separate join table exists to
track the relationship between a profile-entity and the rule types which
are used. This arrangement leads to some rather awkward code and
database queries making the profile-related code in Minder more complex
than it should be.

This PR adds in a definition of a dedicated rule instance table.
Subsequent PRs will migrate data over to it and then change the codebase
to query this table instead of the current tables.
was necessary during my local testing
@dmjb dmjb force-pushed the migrate-rule-instance-new-table branch from 1cb69a6 to 3e03a4e Compare June 5, 2024 14:06
@coveralls
Copy link

Coverage Status

coverage: 53.251% (+0.01%) from 53.241%
when pulling 5edf505 on migrate-rule-instance-new-table
into d986b0c on main.

@coveralls
Copy link

Coverage Status

coverage: 53.241%. remained the same
when pulling 666e35c on migrate-rule-instance-new-table
into d986b0c on main.

@coveralls
Copy link

Coverage Status

coverage: 53.256% (+0.02%) from 53.241%
when pulling 666e35c on migrate-rule-instance-new-table
into d986b0c on main.

@coveralls
Copy link

Coverage Status

coverage: 53.256% (+0.02%) from 53.241%
when pulling 666e35c on migrate-rule-instance-new-table
into d986b0c on main.

@dmjb dmjb merged commit 59c9839 into main Jun 6, 2024
22 checks passed
@dmjb dmjb deleted the migrate-rule-instance-new-table branch June 6, 2024 15:20
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.

3 participants