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

chore: add scheduled_flag_update table and proto message #1535

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

cre8ivejp
Copy link
Member

Part of #893

Things done

  • Added scheduled_flag_update table
  • Added scheduled_flag_update proto message

Queries examples

Query 1: Filter by Change Type and Field Type Using JSON_CONTAINS

SELECT *
FROM scheduled_flag_update
WHERE JSON_CONTAINS(
  changes,
  JSON_OBJECT('change_type', 'SCHEDULED_CHANGE_CREATE', 'field_type', 'FIELD_TYPE_VARIATIONS')
);

Query 2: Filter by Rule ID and Variation ID Using JSON_CONTAINS

SELECT *
FROM scheduled_flag_update
WHERE JSON_CONTAINS(
  changes,
  JSON_OBJECT(
    'field_type', 'FIELD_TYPE_RULES',
    'field_value', '{"id": "rule-123", "strategy": {"fixed_strategy": {"variation": "variation-456"}}}'
  )
);

This pull request includes significant changes to the database schema, protobuf definitions, and related code. The main updates involve the creation of a new table for scheduled flag updates, the removal of old protobuf message types, and the addition of new protobuf definitions for scheduled updates.

Database Schema Changes:

  • Created scheduled_flag_update table with necessary fields and foreign key constraints in migration/mysql/20250226091538_create_scheduled_flag_update_table.sql.
  • Updated migration/mysql/atlas.sum to include the new migration file for the scheduled_flag_update table. [1] [2]

Protobuf Changes:

  • Removed ScheduleUpdate and ScheduleUpdateListValue message types from proto/feature/feature.pb.go and proto/feature/feature.proto. [1] [2] [3] [4] [5]
  • Added new protobuf definitions for ScheduledChange and ScheduledFlagUpdate in proto/feature/scheduled_update.proto.

UI Changes:

  • Updated ui/web-v2/src/proto/feature/scheduled_update_pb_service.js to reflect the new protobuf definitions.

@cre8ivejp cre8ivejp marked this pull request as ready for review February 26, 2025 10:57
@cre8ivejp cre8ivejp force-pushed the chore-add-scheduled-update branch 2 times, most recently from 558848e to 8ca6f84 Compare February 26, 2025 11:27
@cre8ivejp cre8ivejp force-pushed the chore-add-scheduled-update branch from 8ca6f84 to 1c00e9f Compare February 26, 2025 11:32
Comment on lines +7 to +14
enum FieldType {
UNSPECIFIED = 0;
PREREQUISITES = 1;
TARGETS = 2;
RULES = 3;
DEFAULT_STRATEGY = 4;
VARIATIONS = 5;
}
Copy link
Member Author

@cre8ivejp cre8ivejp Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field types correspond to the fields found in the Feature proto message.
We can add new field types in the future if needed.

Comment on lines +15 to +20
enum ChangeType {
CHANGE_UNSPECIFIED = 0;
CHANGE_CREATE = 1;
CHANGE_UPDATE = 2;
CHANGE_DELETE = 3;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allowed change types.

Copy link
Collaborator

@Ubisoft-potato Ubisoft-potato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice design!

Copy link
Contributor

@hvn2k1 hvn2k1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The design LGTM!

@cre8ivejp cre8ivejp merged commit 47b4ee6 into main Feb 27, 2025
17 checks passed
@cre8ivejp cre8ivejp deleted the chore-add-scheduled-update branch February 27, 2025 05:14
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