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

Cv2 4793 identify required workflows #1957

Closed
wants to merge 768 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
768 commits
Select commit Hold shift + click to select a range
bdb535f
Merge branch 'develop'
caiosba Sep 12, 2022
b8ca9c8
Collecting statistics about feeds.
caiosba Sep 12, 2022
5b7e1eb
Do not include requests for latest fact-checks in the feed statistics.
caiosba Sep 12, 2022
c3f7ca2
Better way to verify ElasticSearch log configuration
caiosba Sep 13, 2022
b4f7da6
Feed statistics changes.
caiosba Sep 16, 2022
107debe
Support media queries on feed API
caiosba Sep 16, 2022
c999da6
Parse request media URL before storing
caiosba Sep 16, 2022
5996d52
CHECK-2333: handle destroy exception
melsawy Sep 18, 2022
efcc5ec
Be sure that parsed value is a hash.
caiosba Sep 19, 2022
5777fab
Statistics rake task changes.
caiosba Sep 22, 2022
e66de1e
Fixing conflicts
caiosba Sep 26, 2022
4af0e86
Fixing conflict
caiosba Sep 26, 2022
cafd526
Fixing conflict
caiosba Sep 28, 2022
63f836f
A couple new tipline statistics data points.
caiosba Sep 29, 2022
6fa3659
Fixing fuzzy matching on tipline/feed keyword search
caiosba Sep 30, 2022
ec5e0d6
Cache media file path
caiosba Sep 30, 2022
226c621
Handle new WhatsApp Cloud API error code.
caiosba Sep 30, 2022
90cb2d2
Improvements for feed feature
caiosba Oct 2, 2022
2667251
Observability for feed request webhooks
caiosba Oct 3, 2022
56c8afb
Feature/2460 2461 read pp from transifex (#1234)
amoedoamorim Oct 5, 2022
326d96d
Feature/2460 2461 read pp from transifex (#1232)
amoedoamorim Oct 4, 2022
27d9839
CHECK-2437 add language as a parameter to alegre requests (#1224)
DGaffney Sep 29, 2022
0cabd77
Declare language similarity setting.
caiosba Sep 30, 2022
dea69b5
Make sure that queries with commas are not split
caiosba Oct 6, 2022
39f4d52
Set Levenshtein distance to 1 on feed/tipline fuzzy search.
caiosba Oct 6, 2022
65e8b6c
Temporarily increase the limit of words that trigger a call to Alegre
caiosba Oct 7, 2022
0d33a18
Release database connection while calling Alegre during feed API requ…
caiosba Oct 7, 2022
e149d91
Revert "Temporarily increase the limit of words that trigger a call t…
caiosba Oct 7, 2022
4952158
A couple of small fixes
caiosba Oct 11, 2022
af9ce0a
Be sure that all Fetch articles are imported
caiosba Oct 12, 2022
7d701b4
Fixing report auto-creation when a fact-check is saved.
caiosba Oct 6, 2022
1c2e9b6
Meedan 2476 make fetch honor offset (#1238)
DGaffney Oct 11, 2022
c16700e
Fixes for "add item to imported report" feature
caiosba Oct 12, 2022
5ea19e1
CHECK-2504: fix errbit error (#1229)
melsawy Oct 3, 2022
086650d
Dedicated Sidekiq queue for feed operations
caiosba Oct 17, 2022
df788ae
CHECK-2587: create a unique source name for users with same name (#1254)
melsawy Oct 17, 2022
f03e444
Fixing conflicts
caiosba Oct 18, 2022
33f1727
Changing how feed notification statistics are collected.
caiosba Oct 19, 2022
4688613
Merge branch 'develop'
caiosba Oct 28, 2022
7dde99f
Adding a new parameter "prefix" to rake task.
caiosba Oct 28, 2022
03d8e31
Fixing bad merge in rake tasks that upload to S3.
caiosba Oct 31, 2022
1b55006
Updating fact-checks export rake task.
caiosba Nov 1, 2022
bccfbbc
Merge branch 'develop'
caiosba Nov 7, 2022
46469e3
Reverting statistics rake task until we're able to collect daily stat…
caiosba Nov 11, 2022
77330e9
CHECK-2661: fix sync items where there are more than 10000 items
melsawy Nov 8, 2022
fab2f77
Merge branch 'develop'
caiosba Nov 23, 2022
4f458ad
Fixing date in report introduction sent after button is clicked on te…
caiosba Nov 25, 2022
f467ba2
Adding a Fetch rake task to import a sample of articles into a tempor…
caiosba Dec 2, 2022
9df60d2
When importing an article from Fetch, set the fact-check summary to b…
caiosba Dec 2, 2022
d91fb01
Adding a rake task to (re)clusterize feed requests.
caiosba Dec 3, 2022
615c9c2
Fixing namespace for rake task.
caiosba Dec 3, 2022
5f34e6e
Avoid circular dependency in feed request
caiosba Dec 4, 2022
d8e2dbe
Do not sort languages supported by a tipline
caiosba Dec 8, 2022
ab5d8cf
Try to deliver messages in order.
caiosba Dec 8, 2022
040f7e6
Fixing conflict
caiosba Dec 13, 2022
e6397b2
CHECK-1900: fix rake task
melsawy Dec 14, 2022
3dcaf92
Fixing timeout message when tipline is connected to both Smooch and s…
caiosba Dec 15, 2022
c2129e1
CHECK-2835: set FactCheck for imported items based on team languages …
melsawy Dec 14, 2022
9f4736a
Respect workspace report introduction settings when creating or updat…
caiosba Dec 18, 2022
1bad511
Update regex for detect last modified date for TOS and privacy policy
hartsick Jan 13, 2023
d7cc30c
Fixing conflict
caiosba Jan 20, 2023
32e5e53
Safe parse JSON in case team data has not been migrated to string (#1…
hartsick Jan 24, 2023
cf491d2
Reduce database calls when compiling team data_report (#1377)
hartsick Jan 24, 2023
54e6308
Adding a rake task to export tipline data for a given workspace (CV2-…
caiosba Jan 24, 2023
2ede5db
Updating tipline data export task to include fact-check data as well.
caiosba Feb 1, 2023
eed097a
Bugfix: Generate monthly statistics for current month (#1391)
hartsick Feb 6, 2023
f61dd4a
Merge branch 'develop'
caiosba Feb 8, 2023
09965f8
Merge branch 'develop'
caiosba Feb 10, 2023
ba6fe39
CV2-2740 add test coverage (#1400)
DGaffney Feb 14, 2023
6e89fc4
A couple of tipline fixes: corrupted greeting image & WhatsApp token …
caiosba Feb 18, 2023
0dc131a
Pull recipient id from message in payload from Turnio
hartsick Feb 21, 2023
c2b1fc1
Add timestamp to TurnIo parsed message return
hartsick Feb 21, 2023
1261fad
Faster newsletter delivery
caiosba Feb 22, 2023
b881fcf
Adding a unique index to `relationships.target_id` column
caiosba Feb 17, 2023
8062fa8
Bugfix: Should get Smooch Bot installation ID for self-hosted tiplines
caiosba Feb 23, 2023
2d4aa79
Do not return as a tipline search result an item that is in the trash
caiosba Feb 23, 2023
c5f4c4c
Fixing typo in migration.
caiosba Feb 22, 2023
761d9a9
CV2-2828 - Give multiple models credit (#1420)
computermacgyver Mar 2, 2023
0ebf801
CV2-2781: add rake task to update report language
melsawy Mar 6, 2023
54885da
Improvements for fact-check GraphQL API
caiosba Feb 24, 2023
5780f6b
Set a report as "published" or not when creating an item with a fact-…
caiosba Feb 25, 2023
9bbb9e9
CV2-2812: do not queue es update for cached fields (#1425)
melsawy Mar 9, 2023
67ce139
CV2-2740 minor rework for conditional after output indicates null ref…
DGaffney Mar 14, 2023
c1e3008
CV2-2812: index cached field after run recalculate (#1439)
melsawy Mar 20, 2023
85deea9
Fixing conflicts
caiosba Mar 23, 2023
ab29c5f
Merge branch 'develop'
caiosba Mar 23, 2023
c41ad46
When importing a fact-check from Fetch, fallback to `claimReviewed` i…
caiosba Mar 24, 2023
e4d50f5
Fix/cv2 2694 cv2 2914 errbit errors (#1448)
melsawy Mar 26, 2023
a507c64
Migrate Check API from Errbit to Sentry
hartsick Mar 28, 2023
5044da0
Fix NameError Api::V1::BaseApiController#ping
hartsick Mar 28, 2023
4733eb7
Consolidate message sending errors and limit data sent to Sentry
hartsick Mar 29, 2023
b346162
Don't send "to" to Sentry, since it may be the user's phone number
hartsick Mar 30, 2023
2ad2dde
Send more specific information to Sentry for message failure
hartsick Mar 31, 2023
0aa044b
Remove conversations column from data report, for now
hartsick Apr 5, 2023
f98c1ff
Avoid circular relationships
caiosba Apr 7, 2023
2f6c19a
Allow fact-checks to be deleted through the GraphQL API
caiosba Apr 9, 2023
8ab5877
Fixing conflicts
caiosba Apr 12, 2023
76d8554
Fixing bad merge
caiosba Apr 12, 2023
3a08e4a
Ensure that WhatsApp template placeholders are never blank
caiosba Apr 14, 2023
41ec69c
Fixing how number of newsletters sent is calculated
caiosba Apr 24, 2023
6d12d83
Saving when the newsletter was sent should be after it is sent
caiosba Apr 24, 2023
cba5430
Add task to regenerate newsletter statistics on demand
hartsick Apr 25, 2023
1c2bd20
Fixing conflict
caiosba Apr 25, 2023
3c07923
Update logic to allow pipe-split models (#1486)
DGaffney Apr 28, 2023
43ba2e8
Do not attempt to send template message if template is blank
caiosba Apr 28, 2023
4fe64d0
Fixing error `ActiveRecord::StaleObjectError` reported by Sentry
caiosba Apr 28, 2023
bdd2e8b
CV2-3052 add another patch for slash-delimited models (#1496)
DGaffney May 1, 2023
0191747
Fixing conflict
caiosba May 10, 2023
57f6d11
Protect against nil number of newsletters & subscribers
hartsick May 12, 2023
c0560ae
CV2-3139: add de locales for invited mail template (#1519)
melsawy May 18, 2023
51700c4
CV2-3139: add more traslation for mail notifications (#1520)
melsawy May 18, 2023
1bb04cf
CV2-3142: handle delete cached fields for relationship-bulk_destroy (…
melsawy May 23, 2023
7b21798
Merge branch 'develop'
caiosba Jun 1, 2023
8481b05
Merge branch 'develop'
caiosba Jun 2, 2023
467361e
Merge branch 'develop'
caiosba Jun 2, 2023
20f903a
Update rails-i18n revision on Gemfile.lock (#1532)
amoedoamorim Jun 5, 2023
8927074
Merge branch 'develop'
caiosba Jun 13, 2023
87d85e6
Merge branch 'develop'
caiosba Jun 30, 2023
a8e46e5
Ticket CV2-3371: Do not re-fetch articles for the same newsletter obj…
caiosba Jul 7, 2023
3efca6d
Ticket CV2-3389: Fixing Telugu string interpreted as markdown by What…
caiosba Jul 11, 2023
3f2afdd
Merge branch 'develop'
caiosba Jul 19, 2023
5cb7b27
When creating a `TiplineMessage`, use the `language` saved in the Smo…
caiosba Jul 20, 2023
dafe0ec
CV2-3476 test for nil input to get_number_of_words (#1587)
computermacgyver Jul 20, 2023
f4e21d3
A couple of small fixes for newsletters delivery
caiosba Jul 20, 2023
d2b38c4
Should shorten URLs in newsletter introduction only if the workspace …
caiosba Jul 25, 2023
290a553
Fixing conflict
caiosba Aug 2, 2023
f2f0802
Merge branch 'develop'
caiosba Aug 3, 2023
5614336
Do not crash if tipline `send_message_to_user` returns `null`
caiosba Aug 7, 2023
41e4f8e
CV2-3454: handle unmatched for both source and target item (#1608)
melsawy Aug 7, 2023
453a7b2
Merge branch 'develop'
caiosba Aug 16, 2023
d8b3b81
Don't pause the newsletter automatically when new content from RSS fe…
caiosba Aug 23, 2023
14e67dd
Merge branch 'develop'
caiosba Aug 30, 2023
21c7844
Merge branch 'develop'
caiosba Sep 13, 2023
860835d
Do not crash when calculating number of items in a list that has an i…
caiosba Sep 14, 2023
84f53b0
CV2-3589 add language as a parameter for import_claim_reviews (#1652)
DGaffney Sep 14, 2023
b43761a
Fixing: Media headers should work for non-WhatsApp tiplines
caiosba Sep 18, 2023
9ae1a1a
Ignore status changing permission check if previous value is not a st…
caiosba Sep 24, 2023
c8518db
CV2-3738: remove the privacy permissions (#1660)
melsawy Sep 25, 2023
c22ae98
Merge branch 'develop'
caiosba Sep 28, 2023
38997ff
Merge branch 'develop'
caiosba Sep 29, 2023
0a60eaf
Fixing URL shortening for Arabic URLs.
caiosba Oct 5, 2023
678dd78
Merge branch 'develop'
caiosba Oct 11, 2023
e2c7d8d
Block tipline users when they send more than X messages in 24 hours
caiosba Oct 17, 2023
f227fcd
A few fixes/changes for `TiplineMessages` API
caiosba Oct 16, 2023
47a3403
A couple of small fixes for the conversation history
caiosba Oct 17, 2023
c9d252b
Fixing bad merge
caiosba Oct 18, 2023
6512e5f
Adding GraphQL mutations to add and remove NLU keywords to/from tipli…
caiosba Oct 26, 2023
9a18877
Tipline: NLU disambiguation
caiosba Oct 30, 2023
7f6a46f
Updating copy for NLU disambiguation.
caiosba Oct 31, 2023
f5b898c
Fixing flaky test
caiosba Oct 31, 2023
4fd7fb9
Fixing conflicts
caiosba Nov 29, 2023
5d219b7
Fixing Sentry error and avoiding race condition
caiosba Nov 30, 2023
ba8563f
CV2-4062 apply team condition for PG & ES query (#1747)
melsawy Dec 1, 2023
468e334
Updating permissions
caiosba Dec 2, 2023
a0db4a1
Adding one more `team_id` filter to `CheckSearch`
caiosba Dec 2, 2023
dc06b3b
Removing fields from GraphQL that are not being used anymore
caiosba Dec 3, 2023
434fcdb
CV2-4069 fix a few broken paths that are now mistakenly trying to add…
DGaffney Dec 4, 2023
1bbada2
Do not send a report to a tipline user for relationships created by A…
caiosba Dec 5, 2023
df9389e
CV2-4085: Remove the hardcoded minimum number of words to run a full …
computermacgyver Dec 8, 2023
6d15dc6
Bugfix for aws deployments (#1766)
sonoransun Dec 20, 2023
508bc75
use gitlab-provided aws base image for ci build steps (#1765)
dmou Dec 20, 2023
a0cc5d1
Exposing a new argument `skip_send_report` for the mutation `ProjectM…
caiosba Dec 20, 2023
be187af
Fixing conflicts
caiosba Jan 17, 2024
7898284
Fixing bad merge
caiosba Jan 17, 2024
049b53e
CV2-4223 readd condition for checking if we should even search for th…
DGaffney Jan 24, 2024
353e0f7
CV2-4233 add retry looper for alegre requests that intermittently fai…
DGaffney Jan 31, 2024
1e942a0
add method/path/params/retries to error message so it's easier to fin…
DGaffney Jan 31, 2024
c39e1e4
CV2-4233 yet another log
DGaffney Feb 2, 2024
6100930
Fix for sending search results when a tipline has both Smooch and CAP…
caiosba Feb 15, 2024
2b2eda8
Only deliver fact-check title and URL for Facebook Messenger tipline …
caiosba Feb 15, 2024
70138db
Fix for asking for search results feedback when a tipline has both Sm…
caiosba Feb 15, 2024
248a78e
Fix for asking for search results feedback when a tipline has both Sm…
caiosba Feb 16, 2024
2f00193
CV2-2648: migrate tipline requests (#1811)
melsawy Feb 28, 2024
ccb8861
Revert "CV2-2648: migrate tipline requests (#1811)"
caiosba Mar 3, 2024
f19070f
Merge branch 'develop'
caiosba Mar 3, 2024
d5787ba
Better Sentry error for WhatsApp Insights API exception in statistics…
caiosba Mar 5, 2024
a34df53
Delete old tipline request and fix sentry issue (#1817)
melsawy Mar 5, 2024
eefb0c1
Ticket CV2-4351: Fixing fallback (should be an empty hash)
caiosba Mar 5, 2024
ecd051b
Fixing default order of tipline requests. (#1822)
caiosba Mar 7, 2024
7b42d68
Replace item by parent when sending tipline keyword search results. (…
caiosba Mar 7, 2024
10747e1
Fixing how feed filters are applied until a list is chosen. (#1832)
caiosba Mar 22, 2024
d00e367
Adding Mongolian as a support language for tiplines. (#1831)
caiosba Mar 21, 2024
f36c49d
Fixing conflict
caiosba Apr 3, 2024
3eac255
Merge branch 'develop'
caiosba Apr 3, 2024
b2b6ecf
Merge branch 'develop'
caiosba Apr 3, 2024
09104d4
CV2-2357: set default value for last_received_terms_email_at (#1851)
melsawy Apr 4, 2024
d5a975e
Update pull request template to mention preference for rebasing over …
sonoransun Apr 8, 2024
216147b
CV2-4458: improve-cluster-rake-task (#1853)
melsawy Apr 8, 2024
c91d2c6
CV2-4458: bulk-select claims to get uuid (#1856)
melsawy Apr 10, 2024
fab2610
CV2-4458: fix claim query (#1858)
melsawy Apr 12, 2024
ea306ac
Return placeholder values for report introduction settings in GraphQL…
caiosba Apr 10, 2024
4ac7a8d
Get latest translations from Transifex (#1864)
amoedoamorim Apr 24, 2024
0039840
Fix GitLab target URL. (#1183)
sonoransun Apr 26, 2024
c7dd0c3
CV2-4508: apply team task order to item tasks (#1866)
melsawy Apr 27, 2024
e83862d
CV2-4508: include unconfirmed items when add new team task (#1872)
melsawy Apr 30, 2024
42fb8f4
CV2-4555: add rake to add tasks to unconfirmed items and fix tasks or…
melsawy May 6, 2024
3c2dfac
Cv2 4582 no urls for similarity (#1885)
computermacgyver May 9, 2024
98f60fe
Fixing conflicts
caiosba May 9, 2024
be277ba
Inverting the logic of the feed workspace filter for clusters (#1887)
caiosba May 10, 2024
51346bb
CV2-4595 Validate password strength in check (#1888)
melsawy May 11, 2024
067271b
Don't pause reports automatically when a fact-check is updated. (#1894)
caiosba May 20, 2024
24259db
Send report for confirmed suggestions. (#1893)
caiosba May 17, 2024
dc560d6
Show list of existing media URLs in validation message when trying to…
caiosba May 22, 2024
87e144a
Shared feed import validation message: Format URLs using Markdown (#1…
caiosba May 22, 2024
c9243fc
CV2-4593: use ApplicationRecord.transaction to save message (#1898)
melsawy May 27, 2024
0518456
Do not raise exception if child item can't inherit status from parent…
caiosba May 30, 2024
2527878
Fixing conflicts
caiosba Jun 5, 2024
a8ad509
CV2-4713 flip notification logic (#1912)
DGaffney Jun 6, 2024
ff12dfb
Log API request and response to Facebook when connecting Messenger ti…
caiosba Jun 7, 2024
8349d56
Ticket CV2-4559: Log Facebook Messenger request information only when…
caiosba Jun 8, 2024
b4a0a7a
Fixing conflict
caiosba Jun 10, 2024
9e96bec
CV2-4741 increase timeout from one to two minutes (#1925)
DGaffney Jun 12, 2024
aa98063
Send report when bulk-accepting suggestion. (#1927)
caiosba Jun 18, 2024
dbea89a
Implementing support to re-sending Facebook Messenger newsletters aft…
caiosba Jun 26, 2024
a59b2ff
Try to make sure that clusters center is never null. (#1942)
caiosba Jul 4, 2024
20f5d6e
Merge branch 'develop'
caiosba Jul 8, 2024
9807135
setup tests workflow
Jul 9, 2024
73191f4
setup tests workflow
Jul 9, 2024
881016a
remove docker login
Jul 9, 2024
4bc2ad4
fix failing line
Jul 10, 2024
48d7dcf
fix failing line
Jul 10, 2024
a6f66ca
rewrite test only functional tests
Jul 10, 2024
7544dc4
rewrite test only functional tests
Jul 10, 2024
aeac9e1
rewrite test only functional tests
Jul 10, 2024
d79f06c
rewrite test only functional tests
Jul 10, 2024
ab3c5db
rewrite test only functional tests
Jul 10, 2024
89e62d2
rewrite test only functional tests
Jul 10, 2024
73057f5
rewrite test only functional tests
Jul 10, 2024
d9394ab
rewrite test only functional tests
Jul 10, 2024
678baf7
rewrite test only functional tests
Jul 10, 2024
1004258
rewrite test only functional tests
Jul 10, 2024
ce1b6c1
rewrite test only functional tests
Jul 10, 2024
1edf161
rewrite test only functional tests
Jul 10, 2024
642bc76
rewrite test only functional tests
Jul 10, 2024
12edd87
rewrite tests workflow
Jul 10, 2024
2bde73e
fix syntax
Jul 10, 2024
ba6f095
fix syntax
Jul 10, 2024
ef7a035
remove test from setup job
Jul 10, 2024
13852f3
remove test from setup job
Jul 10, 2024
f27b977
remove test from setup job
Jul 10, 2024
10ecb3b
remove test from setup job
Jul 10, 2024
a01a778
remove test from setup job
Jul 10, 2024
01bcd36
fix failing script
Jul 11, 2024
9f2201f
remove branch from push requests
Jul 11, 2024
fbd98e0
remove branch from push requests
Jul 11, 2024
a111252
Merge branch 'develop' into cv2-4793-identify-required-workflows
Jul 16, 2024
b99fe6c
remove branch from push
Jul 16, 2024
71469f8
Revert "remove branch from push"
Jul 16, 2024
3322ec0
Revert "Merge branch 'develop' into cv2-4793-identify-required-workfl…
Jul 16, 2024
985e4b4
fix commit error
Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 279 additions & 0 deletions .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
name: Build and Run Tests

on:
push:
branches:
- master
pull_request:
branches:
- develop

env:
CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}"

jobs:
functional-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: eu-west-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: set up enviroments
run: |
export RECORD_RUNTIME=true
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export LANGUAGE=C.UTF-8
export PATH=/root/.local/bin:$PATH
rm -rf tmp/cache tmp/cache1 tmp/cache2 tmp/cache3 tmp/cache4 tmp/cache5 && mkdir -p tmp/cache tmp/cache1 tmp/cache2 tmp/cache3 tmp/cache4 tmp/cache5

- name: set up comfiguration files
run: |
cp config/config.yml.example config/config.yml
cp config/database.yml.example config/database.yml
cp config/sidekiq.yml.example config/sidekiq.yml
cp config/credentials.json.example config/credentials.json
cp config/sidekiq-test.yml.example config/sidekiq-test.yml

- name: Build Docker Container
run: |
docker-compose build
- name: Run syntax checks
run: |
docker-compose run api bash -c 'touch /tmp/no-syntax-errors && find app lib config -name *.rb -exec bash -c "ruby -c {} >/dev/null || rm /tmp/no-syntax-errors" ";" && ls /tmp/no-syntax-errors'
- name: Run Container
run: docker-compose -f docker-compose.yml -f docker-test.yml up -d

- name: Wait for the server to be ready
run: |
tail -f log/test.log &
until curl --silent -I -f --fail http://localhost:3000 ; do printf .; sleep 1; done
- name: Set up parallel environment
run: docker-compose exec -T api test/setup-parallel-env.sh

- name: Precompile assets
run: docker-compose exec -T api bundle exec rake assets:precompile

- name: Prepare parallel runtime log
run: |
sleep 10
touch tmp/parallel_runtime_test.log
chmod +w tmp/parallel_runtime_test.log

- name: Run Functional Tests
id: run-tests
env:
TEST_RETRY_COUNT: 3
run: |
docker-compose exec -e TEST_RETRY_COUNT=$TEST_RETRY_COUNT -T -e PATTERN='models mailers integration workers lib contract' api test/run-tests.sh

- name: After functional Tests
id: after-functional-tests
env:
GIT_SHA: ${{ github.sha }}
GIT_COMMITED_AT: ${{ github.event.head_commit.timestamp }}
run: |
docker-compose exec -T -e GIT_COMMIT_SHA=${{ github.sha }} \
-e GIT_COMMITTED_AT=${{ github.event.head_commit.timestamp }} \
-e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID \
-e PATH=$PATH \
-e JOB_NAME=functional-tests \
-e AWS_CONFIG_FILE=/app/credentials \
api test/test-coverage.sh


unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: eu-west-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: set up enviromnts
run: |
export RECORD_RUNTIME=true
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export LANGUAGE=C.UTF-8
export PATH=/root/.local/bin:$PATH
rm -rf tmp/cache tmp/cache1 tmp/cache2 tmp/cache3 tmp/cache4 tmp/cache5 && mkdir -p tmp/cache tmp/cache1 tmp/cache2 tmp/cache3 tmp/cache4 tmp/cache5

- name: set up comfiguration files
run: |
cp config/config.yml.example config/config.yml
cp config/database.yml.example config/database.yml
cp config/sidekiq.yml.example config/sidekiq.yml
cp config/credentials.json.example config/credentials.json
cp config/sidekiq-test.yml.example config/sidekiq-test.yml

- name: Build Docker Container
run: |
docker-compose build
- name: Run syntax checks
run: |
docker-compose run api bash -c 'touch /tmp/no-syntax-errors && find app lib config -name *.rb -exec bash -c "ruby -c {} >/dev/null || rm /tmp/no-syntax-errors" ";" && ls /tmp/no-syntax-errors'
- name: Run Container
run: docker-compose -f docker-compose.yml -f docker-test.yml up -d

- name: Wait for the server to be ready
run: |
tail -f log/test.log &
until curl --silent -I -f --fail http://localhost:3000 ; do printf .; sleep 1; done
- name: Set up parallel environment
run: docker-compose exec -T api test/setup-parallel-env.sh

- name: Precompile assets
run: docker-compose exec -T api bundle exec rake assets:precompile

- name: Prepare parallel runtime log
run: |
sleep 10
touch tmp/parallel_runtime_test.log
chmod +w tmp/parallel_runtime_test.log

- name: Run Unit Tests
id: run-tests
env:
TEST_RETRY_COUNT: 3
run: |
docker-compose exec -e TEST_RETRY_COUNT=$TEST_RETRY_COUNT -T -e PATTERN='controllers contract' api test/run-tests.sh

- name: After unit Tests
id: unit-tests
env:
GIT_SHA: ${{ github.sha }}
GIT_COMMITED_AT: ${{ github.event.head_commit.timestamp }}
run: |
docker-compose exec -T -e GIT_COMMIT_SHA=${{ github.sha }} \
-e GIT_COMMITTED_AT=${{ github.event.head_commit.timestamp }} \
-e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID \
-e PATH=$PATH \
-e JOB_NAME=unit-tests \
-e AWS_CONFIG_FILE=/app/credentials \
api test/test-coverage.sh


contract-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: eu-west-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: set up enviromnts
run: |
export RECORD_RUNTIME=true
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export LANGUAGE=C.UTF-8
export PATH=/root/.local/bin:$PATH
rm -rf tmp/cache tmp/cache1 tmp/cache2 tmp/cache3 tmp/cache4 tmp/cache5 && mkdir -p tmp/cache tmp/cache1 tmp/cache2 tmp/cache3 tmp/cache4 tmp/cache5

- name: set up comfiguration files
run: |
cp config/config.yml.example config/config.yml
cp config/database.yml.example config/database.yml
cp config/sidekiq.yml.example config/sidekiq.yml
cp config/credentials.json.example config/credentials.json
cp config/sidekiq-test.yml.example config/sidekiq-test.yml

- name: Build Docker Container
run: |
docker-compose build

- name: Run syntax checks
run: |
docker-compose run api bash -c 'touch /tmp/no-syntax-errors && find app lib config -name *.rb -exec bash -c "ruby -c {} >/dev/null || rm /tmp/no-syntax-errors" ";" && ls /tmp/no-syntax-errors'

- name: Run Container
run: docker-compose -f docker-compose.yml -f docker-test.yml up -d

- name: Wait for the server to be ready
run: |
tail -f log/test.log &
until curl --silent -I -f --fail http://localhost:3000 ; do printf .; sleep 1; done

- name: Set up parallel environment
run: docker-compose exec -T api test/setup-parallel-env.sh

- name: Precompile assets
run: docker-compose exec -T api bundle exec rake assets:precompile

- name: Prepare parallel runtime log
run: |
sleep 10
touch tmp/parallel_runtime_test.log
chmod +w tmp/parallel_runtime_test.log

- name: Run Contract Tests
id: run-tests
env:
TEST_RETRY_COUNT: 3
run: |
docker-compose exec -e TEST_RETRY_COUNT=$TEST_RETRY_COUNT -T -e PATTERN='controllers models mailers integration workers lib' api test/run-tests.sh

- name: After contract Tests
id: after-tests
env:
GIT_SHA: ${{ github.sha }}
GIT_COMMITED_AT: ${{ github.event.head_commit.timestamp }}
run: |
docker-compose exec -T -e GIT_COMMIT_SHA=${{ github.sha }} \
-e GIT_COMMITTED_AT=${{ github.event.head_commit.timestamp }} \
-e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID \
-e PATH=$PATH \
-e JOB_NAME=contract-tests \
-e AWS_CONFIG_FILE=/app/credentials \
api test/test-coverage.sh
19 changes: 19 additions & 0 deletions .github/workflows/gitlab-mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: GitLab Mirror

on:
- push
- delete

jobs:
sync:
runs-on: ubuntu-latest
name: Git Repo Sync
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wangchucheng/[email protected]
with:
target-url: https://gitlab.com/meedan/check-api.git/
target-username: sonoransun
target-token: ${{ secrets.GITLAB_ACCESS_TOKEN }}
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
stages:
#- test
- build
- deploy

Expand Down
1 change: 0 additions & 1 deletion app/models/concerns/alegre_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ def get_target_field(project_media, field)
end

def parse_similarity_results(project_media, field, results, relationship_type)
results ||= []
Hash[results.collect{|result|
result["context"] = isolate_relevant_context(project_media, result)
[
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/03_sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
require "sidekiq/cloudwatchmetrics"

Sidekiq::Extensions.enable_delay!
Sidekiq::CloudWatchMetrics.enable!(
namespace: "sidekiq_checkapi_#{Rails.env}",
additional_dimensions: { "ClusterName" => "Sidekiq-#{ENV['DEPLOY_ENV']}" } )

# Only enable CloudWatch metrics for Live, not Travis or other
# integration test environments.
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/version.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.0.1'
VERSION = '0.102.0'
30 changes: 0 additions & 30 deletions doc/api-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,36 +269,6 @@ As we can see above, the `geolocation` task response should be a valid [GeoJSON]

The `url` and `quote` can't be both defined at the same time. It's one or the other. If the `quote` field is set, it means you're creating a claim. If the `url` field is set, it means you're creating a report of type "link".

## Create original claim when creating media

When using `createProjectMedia` to create new project media, you can use the `set_original_claim` field to import a URL as the original claim. This URL can be in the following formats:

1. Video URL: This will create a video as the original claim.
2. Audio URL: This will create an audio as the original claim.
3. Image URL: This will create a picture/image as the original claim.
4. Normal URL: A Link will be created as the original claim
5. If the value in `set_original_claim` is not a URL, then the original claim will be created in plain-text.

Here is an example of how to use this field:

_Query_
```graphql
mutation {
createProjectMedia(input: {
project_id: 4,
set_original_claim: "https://someurl.com/somefile.mp3"
}) {
project_media {
title
type
url
}
}
}
```

This example will create an audio as the original claim.

## Updating media

We can update media using the GraphQL (Base 64) id. In the example below, we change the description of a media:
Expand Down
4 changes: 1 addition & 3 deletions lib/rss_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def get_articles(count = 3)
feed = RSS::Parser.parse(rss, false)
unless feed.nil?
feed.items.first(count).each do |item|
title = item.title.kind_of?(String) ? item.title : item.title.content
link = item.link.kind_of?(String) ? item.link : item.link.href
output << title.to_s.strip + "\n" + link.to_s.strip
output << item.title.strip + "\n" + item.link.strip
end
end
end
Expand Down
Loading
Loading