-
Notifications
You must be signed in to change notification settings - Fork 11
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
4880 – Seeds Script: Create standalone claim descriptions and fact-checks #1956
Merged
vasconsaurus
merged 6 commits into
epic/CV2-4441-articles
from
4880-create-standalone-claims-fcs-seeds
Jul 16, 2024
Merged
4880 – Seeds Script: Create standalone claim descriptions and fact-checks #1956
vasconsaurus
merged 6 commits into
epic/CV2-4441-articles
from
4880-create-standalone-claims-fcs-seeds
Jul 16, 2024
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
- now claim_descriptions can have null project_media, so I changed how we get the fact_checks we want to publish. So we only get the fact_checks which claim_descriptions have a project_media. - re-wrote how I was getting the fact_check with an includes, so we make less queries
vasconsaurus
requested review from
caiosba,
melsawy,
DGaffney and
jayjay-w
as code owners
July 15, 2024 21:02
caiosba
approved these changes
Jul 15, 2024
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.
Great work, thanks Manu!
jayjay-w
approved these changes
Jul 16, 2024
caiosba
added a commit
that referenced
this pull request
Jul 22, 2024
* [WIP] Sort explainers on GraphQL API * Adding filters to explainers * Explainers data model and API updates (#1901) In order to list explainers on the frontend side, some changes were needed on the backend. - Title should not be mandatory at the API level but at the model level (and description as well) - Store tags in the Explainer model and keep them in sync with TagText instances - Adding filters, counter, sorting and pagination to the TeamType.articles connection Reference: CV2-4500. * Updates for fact-check data model and API (#1904) Some changes for fact-checks data model and API: * Adding tags * Filters and sort Reference: CV2-4145 * CV2-4665: index report information in fact check (#1909) * CV2-4665: index report information in fact check * CV2-4665: fix tests * CV2-4665: migrate fact-check tags and allow filter by report informations(publisher, rating and report status) * CV2-4665: apply PR comments * CV2-4665: add more tests * CV2-4665: filter by report information * Some changes to articles API and data model (#1933) Some changes to articles API and data model: - It should be possible to create `ClaimDescription` without a `ProjectMedia` - Adding a `team_id` field to `ClaimDescription` - Expose `ClaimDescription.project_media_id` in GraphQL mutations - Adding a new many-to-many relationship between explainers and items, through a new join model `ExplainItem`, and respective GraphQL type and mutations - Expose `FactCheck.rating` in GraphQL mutations - New GraphQL fields for `ProjectMedia`: `fact_check` and `explainers` - New filters for `Team.explainers` GraphQL connection: `standalone` and `text` References: CV2-4441, CV2-4626 and CV2-4627. * Small refactoring * Fixing two things reported by frontend team * List standalone fact-checks * Fixing search by text for explainers * Ticket CV2-4889: Expose number of articles for an item in GraphQL (#1949) * Add fact_check_id field to ProjectMediaType * Adding field `explainer_items` to `ProjectMediaType` * Exposing fact-check report_status in GraphQL * Reverting changes to schema * Adding unique index to explainer_items * Adding unique index to explainer_items * Fixing language validation for fact-check * Add "imported" field to fact-checks (#1951) Adding an "imported" field to fact-checks. It's automatically set as "true" for fact-checks created by bots. This PR includes: - Database migration - Business logic (set "imported" as "true" for fact-checks created by bots, automatically) - Unit tests - GraphQL API, including filter to TeamType.articles - Rake task to update existing fact-checks Reference: CV2-4882. * Fixing test * CV2-4879: add rake task to set team_id for ClaimDescription (#1954) * CV2-4901 fact check article list not displaying rating (#1952) * CV2-4901: Sync status value with fact-check rating * CV2-4901: apply PR comment * CV2-4901: fix tests * Always set claim description team based on project media * Always set claim description team based on project media * 4880 – Seeds Script: Create standalone claim descriptions and fact-checks (#1956) This creates both standalone claim descriptions and standalone claim descriptions with fact checks. Though only the second is visible in the UI. We also: - verify the fact checks with a random status ('undetermined', 'not_applicable', 'in_progress', 'verified' or 'false') - add a link to half of the standalone fact checks Note: I also had to update how we were verifying and publishing the fact-checks that are related to a project media. It was breaking since now we can have claim_descriptions with nil project_media_id. (check-api/db/seeds.rb: line 333) References: 4880 PR: 1956 * Set initial rating for fact-check * Fixing test * Fix * Return team for fact check mutations * Return total number of articles (regardless the type) * Adding missing test --------- Co-authored-by: Brian Fleming <[email protected]> Co-authored-by: Sawy <[email protected]> Co-authored-by: Alexandre Amorim <[email protected]> Co-authored-by: Manu Vasconcelos <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 creates both standalone claim descriptions and standalone claim descriptions with fact checks. Though only the second is visible in the UI. We also:
References: 4880
How has this been tested?
Created new users and added to an existing user.
Things to pay attention to during code review
I also had to update how we were verifying and publishing the fact-checks that are related to a project media. It was breaking since now we can have
claim_descriptions
withnil
project_media_id
.check-api/db/seeds.rb
Line 333 in fc59e81
Checklist