-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: Stage specific data | NPG-7769 #486
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b26de6e
fix: Only gitignore local when its in the root of the repo.
stevenj ab067d7
Add structure for defining stage specific data for the DB
stevenj 5106703
feat: Add stage specific data to the db setup container
stevenj e3e4f96
feat: load stage specific data if it exists, and is not skipped.
stevenj 92cd2c0
fix: Only gitignore local when its in the root of the repo.
stevenj ddca820
Add structure for defining stage specific data for the DB
stevenj a7a53dc
feat: Add stage specific data to the db setup container
stevenj 385e5c5
feat: load stage specific data if it exists, and is not skipped.
stevenj e61f752
feat: Add stage specific ideascale params data
b1a4c77
feat: Add stage specific ideascale params data for dev and F10 data f…
b0d4b53
chore: fix typo
94e2442
chore: remove Fund 10 historic data
4414b76
Merge branch 'feature/stage-specific-data' of github.com:input-output…
stevenj a5b2670
fix: Fix Committee size and deadlines to F10 parameters where known.
stevenj 1d0bed2
Merge branch 'main' into feature/stage-specific-data
stevenj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,4 +117,4 @@ lefthook.yml | |
treefmt.toml | ||
|
||
# local earthly Environments | ||
local/ | ||
./local/ |
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Stage Specific Data | ||
|
||
Subdirectories in this directory, that are named the same as a deployment stage will have their `.sql` files applied to the database when it is configured. | ||
|
||
* `dev` - Development Environment specific data. | ||
* `testnet` - Test-Net Environment specific data. | ||
* `preprod` - Preprod Environment specific data. | ||
* `prod` - Production Environment specific data. | ||
* `local` - Local Testing Environment specific data. Does not get checked in to git, local only. | ||
|
||
Each directory can only contain `*.sql` files. | ||
They will be applied in sorted order. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except these files | ||
!.gitignore | ||
!*.sql |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
-- F10 | ||
INSERT INTO event ( | ||
row_id, | ||
name, | ||
description, | ||
registration_snapshot_time, | ||
snapshot_start, | ||
voting_power_threshold, | ||
max_voting_power_pct, | ||
review_rewards, | ||
start_time, | ||
end_time, | ||
insight_sharing_start, | ||
proposal_submission_start, | ||
refine_proposals_start, | ||
finalize_proposals_start, | ||
proposal_assessment_start, | ||
assessment_qa_start, | ||
voting_start, | ||
voting_end, | ||
tallying_end, | ||
block0, | ||
block0_hash, | ||
committee_size, | ||
committee_threshold, | ||
extra, | ||
cast_to | ||
) VALUES ( | ||
10, | ||
'Fund 10', | ||
'Catalyst Dev Environment - Fund 10', | ||
'2023-08-18 21:00:00', -- Registration Snapshot Time | ||
'2023-08-23 22:00:00', -- Snapshot Start. | ||
450000000, -- Voting Power Threshold | ||
1, -- Max Voting Power PCT | ||
NULL, -- Review Rewards | ||
'2023-06-16 19:56:00', -- Start Time | ||
'2023-09-18 00:00:00', -- End Time | ||
'2023-06-22 00:00:00', -- Insight Sharing Start | ||
'2023-06-22 00:00:00', -- Proposal Submission Start | ||
'2023-06-22 00:00:00', -- Refine Proposals Start | ||
'2023-07-13 00:00:00', -- Finalize Proposals Start | ||
'2023-07-20 00:00:00', -- Proposal Assessment Start | ||
'2023-08-10 00:00:00', -- Assessment QA Start | ||
'2023-08-31 11:00:00', -- Voting Starts | ||
'2023-09-14 11:00:00', -- Voting Ends | ||
'2023-09-18 11:00:00', -- Tallying Ends | ||
NULL, -- Block 0 Data | ||
NULL, -- Block 0 Hash | ||
1, -- Committee Size | ||
1, -- Committee Threshold | ||
NULL, -- Extra | ||
NULL -- Cast to | ||
); |
18 changes: 18 additions & 0 deletions
18
src/event-db/stage_data/dev/00002_fund10_ideascale_params.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- Define F10 IdeaScale parameters. | ||
INSERT INTO config (id, id2, id3, value) VALUES ( | ||
'ideascale', | ||
'params', | ||
'F10', | ||
'{ | ||
"campaign_group_id": 63, | ||
"stage_ids": [4590, 4596, 4602, 4608, 4614, 4620, 4626, 4632, 4638, 4644, 4650, 4656, 4662] | ||
}' | ||
); | ||
|
||
-- Use F10 params for event with row_id = 10. | ||
INSERT INTO config (id, id2, id3, value) VALUES ( | ||
'event', | ||
'ideascale_params', | ||
'10', | ||
'{"params_id": "F10"}' | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except these files | ||
!.gitignore | ||
!*.sql |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except these files | ||
!.gitignore | ||
!*.sql |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except these files | ||
!.gitignore | ||
!*.sql |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
-- F10 | ||
INSERT INTO event ( | ||
row_id, | ||
name, | ||
description, | ||
registration_snapshot_time, | ||
snapshot_start, | ||
voting_power_threshold, | ||
max_voting_power_pct, | ||
review_rewards, | ||
start_time, | ||
end_time, | ||
insight_sharing_start, | ||
proposal_submission_start, | ||
refine_proposals_start, | ||
finalize_proposals_start, | ||
proposal_assessment_start, | ||
assessment_qa_start, | ||
voting_start, | ||
voting_end, | ||
tallying_end, | ||
block0, | ||
block0_hash, | ||
committee_size, | ||
committee_threshold, | ||
extra, | ||
cast_to | ||
) VALUES ( | ||
10, | ||
'Fund 10', | ||
'Catalyst Testnet - Fund 10', | ||
'2023-08-18 21:00:00', -- Registration Snapshot Time | ||
'2023-08-23 22:00:00', -- Snapshot Start. | ||
450000000, -- Voting Power Threshold | ||
1, -- Max Voting Power PCT | ||
NULL, -- Review Rewards | ||
'2023-06-16 19:56:00', -- Start Time | ||
'2023-09-18 00:00:00', -- End Time | ||
'2023-06-22 00:00:00', -- Insight Sharing Start | ||
'2023-06-22 00:00:00', -- Proposal Submission Start | ||
'2023-06-22 00:00:00', -- Refine Proposals Start | ||
'2023-07-13 00:00:00', -- Finalize Proposals Start | ||
'2023-07-20 00:00:00', -- Proposal Assessment Start | ||
'2023-08-10 00:00:00', -- Assessment QA Start | ||
'2023-08-31 11:00:00', -- Voting Starts | ||
'2023-09-14 11:00:00', -- Voting Ends | ||
'2023-09-18 11:00:00', -- Tallying Ends | ||
NULL, -- Block 0 Data | ||
NULL, -- Block 0 Hash | ||
1, -- Committee Size | ||
1, -- Committee Threshold | ||
NULL, -- Extra | ||
NULL -- Cast to | ||
); |
18 changes: 18 additions & 0 deletions
18
src/event-db/stage_data/testnet/00002_fund10_ideascale_params.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- Define F10 IdeaScale parameters. | ||
INSERT INTO config (id, id2, id3, value) VALUES ( | ||
'ideascale', | ||
'params', | ||
'F10', | ||
'{ | ||
"campaign_group_id": 63, | ||
"stage_ids": [4590, 4596, 4602, 4608, 4614, 4620, 4626, 4632, 4638, 4644, 4650, 4656, 4662] | ||
}' | ||
); | ||
|
||
-- Use F10 params for event with row_id = 10. | ||
INSERT INTO config (id, id2, id3, value) VALUES ( | ||
'event', | ||
'ideascale_params', | ||
'10', | ||
'{"params_id": "F10"}' | ||
); |
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.
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.
This has the potential to get confusing. What is the difference between the three data types now? Is any of it mutually exclusive? We might want to be more specific in the comments here, otherwise it's hard to discern when you would use which type of data.
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.
Maybe we can link to the stage_data readme: https://github.com/input-output-hk/catalyst-core/blob/ddca820715d2302c62c04abbb217f604970b4639/src/event-db/stage_data/Readme.md and get that to be more explanatory?
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.
Yeah, that's a good idea. I think the readme is actually fine as is.