From 173da2972f6de15b80b13e2f1d9202a53337a049 Mon Sep 17 00:00:00 2001 From: Lucio Baglione Date: Thu, 9 Jan 2025 18:38:06 +0100 Subject: [PATCH 1/6] feat: New schema for reviews backend. --- ...ation.sql => V10__catalyst_automation.sql} | 0 src/event-db/migrations/V11__reviews.sql | 102 ++++++++++++++++++ src/event-db/migrations/V4__catalyst_id.sql | 25 +++++ src/event-db/migrations/V5__user.sql | 45 ++++++++ ...sal_tables.sql => V6__proposal_tables.sql} | 10 +- .../{V5__vote_plan.sql => V7__vote_plan.sql} | 0 ...hot_tables.sql => V8__snapshot_tables.sql} | 0 .../migrations/V9__moderation_stage.sql | 42 -------- ...7__vote_tables.sql => V9__vote_tables.sql} | 0 9 files changed, 180 insertions(+), 44 deletions(-) rename src/event-db/migrations/{V8__catalyst_automation.sql => V10__catalyst_automation.sql} (100%) create mode 100644 src/event-db/migrations/V11__reviews.sql create mode 100644 src/event-db/migrations/V4__catalyst_id.sql create mode 100644 src/event-db/migrations/V5__user.sql rename src/event-db/migrations/{V4__proposal_tables.sql => V6__proposal_tables.sql} (97%) rename src/event-db/migrations/{V5__vote_plan.sql => V7__vote_plan.sql} (100%) rename src/event-db/migrations/{V6__snapshot_tables.sql => V8__snapshot_tables.sql} (100%) delete mode 100644 src/event-db/migrations/V9__moderation_stage.sql rename src/event-db/migrations/{V7__vote_tables.sql => V9__vote_tables.sql} (100%) diff --git a/src/event-db/migrations/V8__catalyst_automation.sql b/src/event-db/migrations/V10__catalyst_automation.sql similarity index 100% rename from src/event-db/migrations/V8__catalyst_automation.sql rename to src/event-db/migrations/V10__catalyst_automation.sql diff --git a/src/event-db/migrations/V11__reviews.sql b/src/event-db/migrations/V11__reviews.sql new file mode 100644 index 0000000000..9879f36598 --- /dev/null +++ b/src/event-db/migrations/V11__reviews.sql @@ -0,0 +1,102 @@ +-- Catalyst Event Database + +-- Subscription Table +-- This table stores the subscriptions for users in the reviews module + +CREATE TABLE subscription +( + row_id SERIAL PRIMARY KEY, + user_id INTEGER NOT NULL, + event_id INTEGER NOT NULL, + role INTEGER NOT NULL, + status INTEGER NOT NULL, + extra JSONB NULL, + + FOREIGN KEY (user_id) REFERENCES catalyst_user(row_id) ON DELETE CASCADE, + FOREIGN KEY (event_id) REFERENCES event(row_id) ON DELETE CASCADE +); + +CREATE UNIQUE INDEX subscription_idx ON subscription(user_id,event_id,role); + +COMMENT ON TABLE subscription IS ' +A subscription describes the possible roles of a single user for an event. +A user can participate in multiple events active as multiple roles. +For this reason this dedicated table tracks all active roles for a user related +to a specific event and stores meta information about them. +Some of these subscriptions will be automatically created by the system. +The presence/status of subscriptions will determine user capabilities in the app. +'; + +COMMENT ON COLUMN subscription.role IS +'This field describes the role of the user for this subscription. +Possible values: +0: For LV0 Community Reviewers +1: For LV1 Community Reviewers +2: For LV2 Moderators'; + +COMMENT ON COLUMN subscription.extra IS +'This field is used to store all meta information about a subscription. +Specifically: + +anonymous_id: str, +subscription_date: datetime, +preferred_categories: [int] +'; + + +-- Allocation - Defines the relationship between users and proposals or proposals_reviews +-- to describe: +-- - the ownership of a proposal. +-- - the allocation of the reviews that needs to be done. +-- - the allocation of moderations that needs to be done. + +CREATE TABLE allocation ( + row_id SERIAL PRIMARY KEY, + proposal_id INTEGER NULL, + review_id INTEGER NULL, + user_id INTEGER NOT NULL, + type INTEGER NOT NULL, + + FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE, + FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE, + FOREIGN KEY (user_id) REFERENCES catalyst_user(row_id) ON DELETE CASCADE +); + + +COMMENT ON TABLE allocation IS 'The relationship between users and proposals or proposals_reviews.'; +COMMENT ON COLUMN allocation.row_id IS 'Synthetic ID of this relationship.'; +COMMENT ON COLUMN allocation.proposal_id IS 'The proposal the relationship is related to.'; +COMMENT ON COLUMN allocation.review_id IS 'The review the relationship is related to.'; +COMMENT ON COLUMN allocation.user_id IS 'The user the relationship is related to.'; +COMMENT ON COLUMN allocation.type IS 'The type of relationship stored. +Possible values: +0: proposal ownership relation. proposal_id and user_id are required +1: proposal allocated for review. proposal_id and user_id are required +2: review allocated for moderation. review_id and user_id are required'; + +CREATE INDEX idx_allocation_proposal_type ON allocation(proposal_id, type) WHERE proposal_id IS NOT NULL; +CREATE INDEX idx_allocation_review_type ON allocation(review_id, type) WHERE review_id IS NOT NULL; +CREATE INDEX idx_allocation_user_type ON allocation(user_id, type); + + +-- Moderation - Defines the moderation submitted by users for each proposal_review. + +CREATE TABLE moderation ( + row_id SERIAL PRIMARY KEY, + review_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + classification INTEGER NOT NULL, + rationale VARCHAR, + UNIQUE (review_id, user_id), + + FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE, + FOREIGN KEY (user_id) REFERENCES catalyst_user(row_id) ON DELETE CASCADE +); + + +COMMENT ON TABLE moderation IS 'An individual moderation for a proposal review.'; +COMMENT ON COLUMN moderation.row_id IS 'Synthetic ID of this moderation.'; +COMMENT ON COLUMN moderation.review_id IS 'The review the moderation is related to.'; +COMMENT ON COLUMN moderation.user_id IS 'The user the moderation is submitted from.'; +COMMENT ON COLUMN moderation.classification IS 'The value used to describe the moderation (e.g. 0: excluded, 1: included).'; +COMMENT ON COLUMN moderation.rationale IS 'The rationale for the given classification.'; \ No newline at end of file diff --git a/src/event-db/migrations/V4__catalyst_id.sql b/src/event-db/migrations/V4__catalyst_id.sql new file mode 100644 index 0000000000..be6b038ff7 --- /dev/null +++ b/src/event-db/migrations/V4__catalyst_id.sql @@ -0,0 +1,25 @@ +-- Catalyst Event Database + +-- Catalyst ID map Table +-- This table stores the relationship between a catalyst ID and an email address. + +CREATE TABLE catalyst_id_map +( + row_id SERIAL PRIMARY KEY, + catalyst_id VARCHAR NOT NULL, + email VARCHAR NOT NULL, + signed_email VARCHAR NOT NULL, + status INTEGER NOT NULL, + confirmation_token VARCHAR NOT NULL, + + UNIQUE(catalyst_id) +); + +CREATE UNIQUE INDEX catalyst_id_idx ON catalyst_id_map(catalyst_id, email); + +COMMENT ON COLUMN catalyst_id_map.email IS 'The email is stored encrypted.'; +COMMENT ON COLUMN catalyst_id_map.status IS ' +Describes the status of an account: +0: Inactive +1: Active +2: Banned.'; \ No newline at end of file diff --git a/src/event-db/migrations/V5__user.sql b/src/event-db/migrations/V5__user.sql new file mode 100644 index 0000000000..28b93a81ad --- /dev/null +++ b/src/event-db/migrations/V5__user.sql @@ -0,0 +1,45 @@ +-- Catalyst Event Database + +-- User Table +-- This table stores the users for the reviews module + +CREATE TABLE catalyst_user +( + row_id SERIAL PRIMARY KEY, + catalyst_id INTEGER NOT NULL, + enc_password VARCHAR NOT NULL, + salt VARCHAR NOT NULL, + extra JSONB NULL, + + FOREIGN KEY(catalyst_id) REFERENCES catalyst_id_map(row_id) ON DELETE CASCADE +); + +CREATE UNIQUE INDEX user_catalyst_id_idx ON catalyst_user(catalyst_id); + + +COMMENT ON COLUMN catalyst_user.extra IS +'This field is used to store all meta information about a user that +are required by the application. Specifically: + +admin: bool, +username: str, +registration_date: datetime, +due_diligence: { + status: int, + due_diligence_id: str, + url: str +}, +historic_stats: { + "reviews": { + "active_funds": int, + "submitted": int, + "blank": int, + "valid": int + }, + "moderations": { + "active_funds": int, + "submitted": int, + "allocated": int, + } +} +'; diff --git a/src/event-db/migrations/V4__proposal_tables.sql b/src/event-db/migrations/V6__proposal_tables.sql similarity index 97% rename from src/event-db/migrations/V4__proposal_tables.sql rename to src/event-db/migrations/V6__proposal_tables.sql index 158adb8f80..3a5af72bfb 100644 --- a/src/event-db/migrations/V4__proposal_tables.sql +++ b/src/event-db/migrations/V6__proposal_tables.sql @@ -99,6 +99,7 @@ COMMENT ON COLUMN reviewer_level.event_id IS 'The specific Event ID this review CREATE TABLE proposal_review ( row_id SERIAL PRIMARY KEY, proposal_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, assessor VARCHAR NOT NULL, assessor_level INTEGER, reward_address TEXT, @@ -111,11 +112,12 @@ CREATE TABLE proposal_review ( feasibility_note VARCHAR, auditability_rating_given INTEGER, auditability_note VARCHAR, + allocated INTEGER, ranking INTEGER, flags JSONB NULL, - FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE, - FOREIGN KEY (assessor_level) REFERENCES reviewer_level(row_id) ON DELETE CASCADE + FOREIGN KEY (user_id) REFERENCES catalyst_user(row_id) ON DELETE SET NULL, + FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE ); COMMENT ON TABLE proposal_review IS 'All Reviews.'; @@ -146,6 +148,10 @@ COMMENT ON COLUMN proposal_review.auditability_note IS 'A note about the auditability rating given. DEPRECATED: Only used for Vit-SS compatibility.'; +COMMENT ON COLUMN proposal_review.allocated IS +'Describes if the review was part of the original reviewer allocation. +'; + COMMENT ON COLUMN proposal_review.ranking IS 'Numeric Measure of quality of this review according to veteran community advisors. DEPRECATED: Only used for Vit-SS compatibility. diff --git a/src/event-db/migrations/V5__vote_plan.sql b/src/event-db/migrations/V7__vote_plan.sql similarity index 100% rename from src/event-db/migrations/V5__vote_plan.sql rename to src/event-db/migrations/V7__vote_plan.sql diff --git a/src/event-db/migrations/V6__snapshot_tables.sql b/src/event-db/migrations/V8__snapshot_tables.sql similarity index 100% rename from src/event-db/migrations/V6__snapshot_tables.sql rename to src/event-db/migrations/V8__snapshot_tables.sql diff --git a/src/event-db/migrations/V9__moderation_stage.sql b/src/event-db/migrations/V9__moderation_stage.sql deleted file mode 100644 index 7afaa75696..0000000000 --- a/src/event-db/migrations/V9__moderation_stage.sql +++ /dev/null @@ -1,42 +0,0 @@ --- Catalyst Event Database - --- ModerationAllocation - Defines the relationship between users and proposals_reviews --- to describe the allocation of moderations that needs to be done. - -CREATE TABLE moderation_allocation ( - row_id SERIAL PRIMARY KEY, - review_id INTEGER NOT NULL, - user_id INTEGER NOT NULL, - - FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE, - FOREIGN KEY (user_id) REFERENCES config(row_id) ON DELETE CASCADE -); - - -COMMENT ON TABLE moderation_allocation IS 'The relationship between users and proposals_reviews.'; -COMMENT ON COLUMN moderation_allocation.row_id IS 'Synthetic ID of this relationship.'; -COMMENT ON COLUMN moderation_allocation.review_id IS 'The review the relationship is related to.'; -COMMENT ON COLUMN moderation_allocation.user_id IS 'The user the relationship is related to.'; - - --- Moderation - Defines the moderation submitted by users for each proposal_review. - -CREATE TABLE moderation ( - row_id SERIAL PRIMARY KEY, - review_id INTEGER NOT NULL, - user_id INTEGER NOT NULL, - classification INTEGER NOT NULL, - rationale VARCHAR, - UNIQUE (review_id, user_id), - - FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE, - FOREIGN KEY (user_id) REFERENCES config(row_id) ON DELETE CASCADE -); - - -COMMENT ON TABLE moderation IS 'An individual moderation for a proposal review.'; -COMMENT ON COLUMN moderation.row_id IS 'Synthetic ID of this moderation.'; -COMMENT ON COLUMN moderation.review_id IS 'The review the moderation is related to.'; -COMMENT ON COLUMN moderation.user_id IS 'The user the moderation is submitted from.'; -COMMENT ON COLUMN moderation.classification IS 'The value used to describe the moderation (e.g. 0: excluded, 1: included).'; -COMMENT ON COLUMN moderation.rationale IS 'The rationale for the given classification.'; \ No newline at end of file diff --git a/src/event-db/migrations/V7__vote_tables.sql b/src/event-db/migrations/V9__vote_tables.sql similarity index 100% rename from src/event-db/migrations/V7__vote_tables.sql rename to src/event-db/migrations/V9__vote_tables.sql From 139490e8d65883caa19b75e69eb78102075f4207 Mon Sep 17 00:00:00 2001 From: Lucio Baglione Date: Fri, 10 Jan 2025 16:12:17 +0100 Subject: [PATCH 2/6] chore: Finalize Reviews DB schema. --- src/event-db/migrations/V11__reviews.sql | 46 ++++++++++--------- src/event-db/migrations/V4__catalyst_id.sql | 36 +++++++++++---- src/event-db/migrations/V5__user.sql | 8 ++++ .../migrations/V6__proposal_tables.sql | 29 ++++-------- 4 files changed, 70 insertions(+), 49 deletions(-) diff --git a/src/event-db/migrations/V11__reviews.sql b/src/event-db/migrations/V11__reviews.sql index 9879f36598..0ae8cec2af 100644 --- a/src/event-db/migrations/V11__reviews.sql +++ b/src/event-db/migrations/V11__reviews.sql @@ -5,12 +5,12 @@ CREATE TABLE subscription ( - row_id SERIAL PRIMARY KEY, - user_id INTEGER NOT NULL, - event_id INTEGER NOT NULL, - role INTEGER NOT NULL, - status INTEGER NOT NULL, - extra JSONB NULL, + row_id SERIAL PRIMARY KEY, + user_id INTEGER NOT NULL, + event_id INTEGER NOT NULL, + role INTEGER NOT NULL, + status INTEGER NOT NULL, + extra JSONB NULL, FOREIGN KEY (user_id) REFERENCES catalyst_user(row_id) ON DELETE CASCADE, FOREIGN KEY (event_id) REFERENCES event(row_id) ON DELETE CASCADE @@ -27,6 +27,9 @@ Some of these subscriptions will be automatically created by the system. The presence/status of subscriptions will determine user capabilities in the app. '; +COMMENT ON COLUMN subscription.user_id IS 'The user ID this subscription belongs to.'; +COMMENT ON COLUMN subscription.event_id IS 'The event ID this subscription belongs to.'; + COMMENT ON COLUMN subscription.role IS 'This field describes the role of the user for this subscription. Possible values: @@ -40,7 +43,8 @@ Specifically: anonymous_id: str, subscription_date: datetime, -preferred_categories: [int] +preferred_categories: [int], +reward_address: str '; @@ -51,11 +55,11 @@ preferred_categories: [int] -- - the allocation of moderations that needs to be done. CREATE TABLE allocation ( - row_id SERIAL PRIMARY KEY, + row_id SERIAL PRIMARY KEY, proposal_id INTEGER NULL, - review_id INTEGER NULL, - user_id INTEGER NOT NULL, - type INTEGER NOT NULL, + review_id INTEGER NULL, + user_id INTEGER NOT NULL, + type INTEGER NOT NULL, FOREIGN KEY (proposal_id) REFERENCES proposal(row_id) ON DELETE CASCADE, FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE, @@ -65,9 +69,9 @@ CREATE TABLE allocation ( COMMENT ON TABLE allocation IS 'The relationship between users and proposals or proposals_reviews.'; COMMENT ON COLUMN allocation.row_id IS 'Synthetic ID of this relationship.'; -COMMENT ON COLUMN allocation.proposal_id IS 'The proposal the relationship is related to.'; -COMMENT ON COLUMN allocation.review_id IS 'The review the relationship is related to.'; -COMMENT ON COLUMN allocation.user_id IS 'The user the relationship is related to.'; +COMMENT ON COLUMN allocation.proposal_id IS 'The proposal ID the relationship belongs to.'; +COMMENT ON COLUMN allocation.review_id IS 'The review ID the relationship belongs to.'; +COMMENT ON COLUMN allocation.user_id IS 'The user ID the relationship belongs to.'; COMMENT ON COLUMN allocation.type IS 'The type of relationship stored. Possible values: 0: proposal ownership relation. proposal_id and user_id are required @@ -82,11 +86,11 @@ CREATE INDEX idx_allocation_user_type ON allocation(user_id, type); -- Moderation - Defines the moderation submitted by users for each proposal_review. CREATE TABLE moderation ( - row_id SERIAL PRIMARY KEY, - review_id INTEGER NOT NULL, - user_id INTEGER NOT NULL, - classification INTEGER NOT NULL, - rationale VARCHAR, + row_id SERIAL PRIMARY KEY, + review_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + classification INTEGER NOT NULL, + rationale VARCHAR, UNIQUE (review_id, user_id), FOREIGN KEY (review_id) REFERENCES proposal_review(row_id) ON DELETE CASCADE, @@ -96,7 +100,7 @@ CREATE TABLE moderation ( COMMENT ON TABLE moderation IS 'An individual moderation for a proposal review.'; COMMENT ON COLUMN moderation.row_id IS 'Synthetic ID of this moderation.'; -COMMENT ON COLUMN moderation.review_id IS 'The review the moderation is related to.'; -COMMENT ON COLUMN moderation.user_id IS 'The user the moderation is submitted from.'; +COMMENT ON COLUMN moderation.review_id IS 'The review ID the moderation belongs to.'; +COMMENT ON COLUMN moderation.user_id IS 'The user ID the moderation belongs to.'; COMMENT ON COLUMN moderation.classification IS 'The value used to describe the moderation (e.g. 0: excluded, 1: included).'; COMMENT ON COLUMN moderation.rationale IS 'The rationale for the given classification.'; \ No newline at end of file diff --git a/src/event-db/migrations/V4__catalyst_id.sql b/src/event-db/migrations/V4__catalyst_id.sql index be6b038ff7..69006c1e4c 100644 --- a/src/event-db/migrations/V4__catalyst_id.sql +++ b/src/event-db/migrations/V4__catalyst_id.sql @@ -5,21 +5,41 @@ CREATE TABLE catalyst_id_map ( - row_id SERIAL PRIMARY KEY, - catalyst_id VARCHAR NOT NULL, - email VARCHAR NOT NULL, - signed_email VARCHAR NOT NULL, - status INTEGER NOT NULL, - confirmation_token VARCHAR NOT NULL, + row_id SERIAL PRIMARY KEY, + catalyst_id VARCHAR NOT NULL, + email VARCHAR NOT NULL, + username VARCHAR NOT NULL, + signed_email VARCHAR NOT NULL, + status INTEGER NOT NULL, + confirmation_token VARCHAR, + confirmation_requested_at TIMESTAMP, + confirmed_at TIMESTAMP, UNIQUE(catalyst_id) ); CREATE UNIQUE INDEX catalyst_id_idx ON catalyst_id_map(catalyst_id, email); -COMMENT ON COLUMN catalyst_id_map.email IS 'The email is stored encrypted.'; +COMMENT ON TABLE catalyst_id_map IS ' +The `catalyst_id_map` table is used to store the map between the CatalystID and email/username for each user. +Because the Catalyst RBAC registration are stored on-chain, and for this reason are publicly accessible, +sensitive information like email address will be stored in a centralized DB, keeping a reference to the CatalystID. +The email address is stored only when its signature corresponds to the CatalystID. +'; +COMMENT ON COLUMN catalyst_id_map.catalyst_id IS ' +It contains the unique part of the CatalystID. +Given a full CatalystID like `id.catalyst://fred@preprod.cardano/FftxFnOrj2qmTuB2oZG2v0YEWJfKvQ9Gg8AgNAhDsKE` +The scheme and the username are omitted and only the unique part `preprod.cardano/FftxFnOrj2qmTuB2oZG2v0YEWJfKvQ9Gg8AgNAhDsKE` +is stored in this field. +'; +COMMENT ON COLUMN catalyst_id_map.email IS 'The email address stored in plaintext.'; +COMMENT ON COLUMN catalyst_id_map.username IS 'The username extracted from the CatalystID stored in plaintext.'; +COMMENT ON COLUMN catalyst_id_map.signed_email IS 'The signed document that includes the email address.'; COMMENT ON COLUMN catalyst_id_map.status IS ' Describes the status of an account: 0: Inactive 1: Active -2: Banned.'; \ No newline at end of file +2: Banned.'; +COMMENT ON COLUMN catalyst_id_map.confirmation_token IS 'The token that is generated for the email confirmation.'; +COMMENT ON COLUMN catalyst_id_map.confirmation_requested_at IS 'The timestamp to validate confirmation token validity.'; +COMMENT ON COLUMN catalyst_id_map.confirmed_at IS 'The timestamp of the email confirmation.'; \ No newline at end of file diff --git a/src/event-db/migrations/V5__user.sql b/src/event-db/migrations/V5__user.sql index 28b93a81ad..80ee4d9a6a 100644 --- a/src/event-db/migrations/V5__user.sql +++ b/src/event-db/migrations/V5__user.sql @@ -17,6 +17,14 @@ CREATE TABLE catalyst_user CREATE UNIQUE INDEX user_catalyst_id_idx ON catalyst_user(catalyst_id); +COMMENT ON TABLE catalyst_user IS ' +This tables stores the user account for the Review Module. +It contains a reference to the catalyst_id that is used as public and unique identifier. +'; + +COMMENT ON COLUMN catalyst_user.catalyst_id IS 'The catalyst_id this account belongs to.'; +COMMENT ON COLUMN catalyst_user.enc_password IS 'The encrypted password.'; +COMMENT ON COLUMN catalyst_user.salt IS 'The salt for the password encryption.'; COMMENT ON COLUMN catalyst_user.extra IS 'This field is used to store all meta information about a user that are required by the application. Specifically: diff --git a/src/event-db/migrations/V6__proposal_tables.sql b/src/event-db/migrations/V6__proposal_tables.sql index 3a5af72bfb..a364f53d91 100644 --- a/src/event-db/migrations/V6__proposal_tables.sql +++ b/src/event-db/migrations/V6__proposal_tables.sql @@ -102,10 +102,7 @@ CREATE TABLE proposal_review ( user_id INTEGER NOT NULL, assessor VARCHAR NOT NULL, assessor_level INTEGER, - reward_address TEXT, - -- These fields are deprecated and WILL BE removed in a future migration. - -- They MUST only be used for Vit-SS compatibility. impact_alignment_rating_given INTEGER, impact_alignment_note VARCHAR, feasibility_rating_given INTEGER, @@ -122,31 +119,23 @@ CREATE TABLE proposal_review ( COMMENT ON TABLE proposal_review IS 'All Reviews.'; COMMENT ON COLUMN proposal_review.row_id IS 'Synthetic Unique Key.'; -COMMENT ON COLUMN proposal_review.proposal_id IS 'The Proposal this review is for.'; -COMMENT ON COLUMN proposal_review.assessor IS 'Assessors Anonymized ID'; +COMMENT ON COLUMN proposal_review.proposal_id IS 'The Proposal id this review belongs to.'; +COMMENT ON COLUMN proposal_review.user_id IS 'The user id this review belongs to.'; +COMMENT ON COLUMN proposal_review.assessor IS 'Assessors Anonymized ID.'; COMMENT ON COLUMN proposal_review.assessor_level IS 'Assessors level ID'; -COMMENT ON COLUMN proposal_review.reward_address IS 'Assessors reward address'; COMMENT ON COLUMN proposal_review.impact_alignment_rating_given IS -'The numeric rating assigned to the proposal by the assessor. -DEPRECATED: Only used for Vit-SS compatibility.'; +'The numeric rating assigned to the proposal by the assessor.'; COMMENT ON COLUMN proposal_review.impact_alignment_note IS -'A note about why the impact rating was given. -DEPRECATED: Only used for Vit-SS compatibility.'; - +'A note about why the impact rating was given.'; COMMENT ON COLUMN proposal_review.feasibility_rating_given IS -'The numeric feasibility rating given. -DEPRECATED: Only used for Vit-SS compatibility.'; +'The numeric feasibility rating given.'; COMMENT ON COLUMN proposal_review.feasibility_note IS -'A note about why the feasibility rating was given. -DEPRECATED: Only used for Vit-SS compatibility.'; - +'A note about why the feasibility rating was given.'; COMMENT ON COLUMN proposal_review.auditability_rating_given IS -'The numeric auditability rating given. -DEPRECATED: Only used for Vit-SS compatibility.'; +'The numeric auditability rating given.'; COMMENT ON COLUMN proposal_review.auditability_note IS -'A note about the auditability rating given. -DEPRECATED: Only used for Vit-SS compatibility.'; +'A note about the auditability rating given.'; COMMENT ON COLUMN proposal_review.allocated IS 'Describes if the review was part of the original reviewer allocation. From 583b78ac287e05d4aba658f35c95a5ed6e6fefaf Mon Sep 17 00:00:00 2001 From: Lucio Baglione Date: Tue, 14 Jan 2025 14:07:12 +0100 Subject: [PATCH 3/6] fix: Add poetry export package. --- utilities/ideascale-importer/Earthfile | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/ideascale-importer/Earthfile b/utilities/ideascale-importer/Earthfile index 4b80819eec..f86870634d 100644 --- a/utilities/ideascale-importer/Earthfile +++ b/utilities/ideascale-importer/Earthfile @@ -29,6 +29,7 @@ build: RUN poetry env use python RUN poetry config installer.max-workers 10 RUN poetry install --no-cache --no-root + RUN poetry self add poetry-plugin-export # Build the distribution wheels and save them as artifacts RUN poetry export --without-hashes -f requirements.txt --output requirements.txt From fc1a1d35fcd0a49ceae0f4b099da1d24c4c91b36 Mon Sep 17 00:00:00 2001 From: Lucio Baglione Date: Wed, 15 Jan 2025 10:06:18 +0100 Subject: [PATCH 4/6] fix: Pin poetry version and add export plugin. --- services/voting-node/Earthfile | 3 ++- utilities/fragment-exporter/Earthfile | 3 ++- utilities/ideascale-importer/Earthfile | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/voting-node/Earthfile b/services/voting-node/Earthfile index 8b3325d208..b02fe63de6 100644 --- a/services/voting-node/Earthfile +++ b/services/voting-node/Earthfile @@ -21,7 +21,7 @@ builder: zlib1g-dev # Install Poetry - RUN curl -sSL https://install.python-poetry.org | python3 - + RUN curl -sSL https://install.python-poetry.org | python3 - --version 2.0.1 SAVE IMAGE --cache-hint @@ -42,6 +42,7 @@ deps: RUN poetry config installer.max-workers 10 # Install package dependencies without the voting_node package RUN poetry install --only main --no-root + RUN poetry self add poetry-plugin-export # Copy the voting_node source code COPY --dir voting_node README.md ./ diff --git a/utilities/fragment-exporter/Earthfile b/utilities/fragment-exporter/Earthfile index ce53e47a1c..369034cd19 100644 --- a/utilities/fragment-exporter/Earthfile +++ b/utilities/fragment-exporter/Earthfile @@ -11,12 +11,13 @@ deps: RUN apt-get update && \ apt-get install -y --no-install-recommends curl - RUN curl -sSL https://install.python-poetry.org | python3 - + RUN curl -sSL https://install.python-poetry.org | python3 - --version 2.0.1 COPY pyproject.toml . COPY poetry.lock . RUN poetry install --only main --no-root + RUN poetry self add poetry-plugin-export src: FROM +deps diff --git a/utilities/ideascale-importer/Earthfile b/utilities/ideascale-importer/Earthfile index f86870634d..a0f179c60c 100644 --- a/utilities/ideascale-importer/Earthfile +++ b/utilities/ideascale-importer/Earthfile @@ -15,7 +15,7 @@ build: apt-get install -y --no-install-recommends curl build-essential libxml2-dev libxslt-dev zlib1g-dev python3-lxml # Install Poetry - RUN curl -sSL https://install.python-poetry.org | python3 - + RUN curl -sSL https://install.python-poetry.org | python3 - --version 2.0.1 # Set path to poetry ENV PATH=/root/.local/bin:$PATH From 39736417d9399e7aec5f9046cdb9c8061d86f4a9 Mon Sep 17 00:00:00 2001 From: Lucio Baglione Date: Wed, 15 Jan 2025 10:31:51 +0100 Subject: [PATCH 5/6] fix: Point ci-test to a pre forge version. --- .github/workflows/ci-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 7b433f811b..aee4ddd6e8 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -27,7 +27,7 @@ jobs: with: fetch-depth: 0 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@v3.2.26 with: aws_role_arn: ${{ env.AWS_ROLE_ARN }} aws_region: ${{ env.AWS_REGION }} From 43721662601fd2b678609faddb82025e97f31422 Mon Sep 17 00:00:00 2001 From: Lucio Baglione Date: Fri, 17 Jan 2025 11:27:22 +0100 Subject: [PATCH 6/6] chore: Bump poetry version in voting-node docker. --- docker/voting-node.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/voting-node.dockerfile b/docker/voting-node.dockerfile index 45a078a8b8..ea3fece63e 100644 --- a/docker/voting-node.dockerfile +++ b/docker/voting-node.dockerfile @@ -8,7 +8,7 @@ FROM jormungandr:latest as jorm # stage 3 FROM python as poetry -RUN pip install poetry==1.8.0 +RUN pip install poetry==2.0.1 # Add python codebase COPY . /voting