Skip to content

Commit 3cb262d

Browse files
gdixonGerald Iakobinyi-Pichnutrinakammerdiener
authored
wip(dpopp-trust-bonus): replaces trust-bonus with dpopp (#10618)
* wip(dpopp-trust-bonus): replaces trust-bonus with dpopp * fix: and js/dpopp to .eslintignore and runs eslint * feat: separates connect and verify procedures * fix: default the challenge session value * fix: ensures passport connects once dataWalletReady emits * fix: linting errors * fix: recases .../js/dpopp * fix: replaces build of reader.bundle.js * fix: moves reader.bundle.js out of bundle - testing if bundle or collectstatic is causing the malformed script on review * fix: import reader.bundle.js from cdn * Adding log messages, debugging the did and password loading * HTTPS for review env * Hardcoding the S# URL for now * First attempt for stamp validation * Trust bonus calculation * Have added verification for passport subject address, stamp id and passport did * feat: adds passport verifications to frontend - reintroduces original trust_bonus behind a flag (`use_dpassport`) - updates readers to get from next or content - adds wallet disconnected event and adds listeners for `active-trust-manager` - adds DIDKit verification to the frontend * fix: drops merge remnants * fix: linting issues * fix: rechains migrations * fix: review env config * fix: use static_url to discover .wasm * Fixing trust bonus calculation in BE, storing passport and stamp references * If a user has a passport and trust score was calculated, this is reflected in the UI when he visits the trust bonnus page * fix: services to match expected casing and adds more validity checks server-side * fix: adds stamp unique checks to the front-end * fix: adds missing semi * fix: missed merge * Moved the trust score calculation to a task + reverting some changes in the UI * fix: verified if saving returns no errors * fix: displays score from db on page-load if known * fix: brings back verification error state * Pulling the oauth client id and secret from the github secrets for review environments * fix: clean-up trust-bonus * fix: removes delay from calculate_trust_bonus task * fix: trust_bonus as value rather than computed * fix: cleans up error paths and reset method * Fixing linter errors * Enabling also celery worker in review env * Fixing celery worker for service * Fixes: - make sure that the user needs only 1 verification for a provider to get that score - passport and stamps are now linked in DB * Replacing the usage of trust_bonus with final_trust_bonus + also adding some linter fixes * fix: cleans up verification animation and error states * fix: lint fixes * fix: updates IAM DID to latest * fix: dpopp -> dPassport * fix: fixes server-side verification checks and purges any mention of dpopp * fixing bucket web url * Fix confusing statement that always resolves to True + linter fixes * Fixig S3 bucket URL * fixing reference * fix: get DID from next if available * fix: updates passport_reader to use pkh-dids * fix: updates to use the new schema (hash: sha256(...)) * fix: updates for using did:pkh in place of caip10-links - includes schema updates (`kjzl6...ub9` -> `kjzl6...lzs`) * refactor: logger messages * fix: adds calculate_trust_bonus to high_priority queue * feat: adds _status and _last_update fields for passport_trust_bonus * feat: adds step-by-step flow instructions - adds CTAs to error states - updates landing image - updates ceramic node and passportUrl to use prod values * fix: adds backwards navigation to step procedure * fix: ensures we only go back to step 1 if we have a score already * fix: error state stylings, spacings and comments * fix: use onConnect to open wallet connection modal * fix: hideModal missing fn * fix: clears link stylings when text links are disabled * fix: ensures web3Modal is displayed if called before walletReady * Reworking the flow how user connects to a passportes, verified his score and saves it in gitcoin - this is still wip * Error handling for connecting the passport, getting the trust bonus and saving it * Removing the test cases from the workflow temporarily because they hang ... * Minor UI changes + removing unused code * Revert "Removing the test cases from the workflow temporarily because they hang ..." This reverts commit 1123452. * UI changes as requested in dPop #149 * Increasing memory for web container, increasing timeout for gunicorn worker in web container and service count to 2 * fix: ensures disabled/success logic shows correct styling for circle icon * fix: puts 'use_passport_trust_bonus' behind a feature flag * Updating content on new trust bonus page * Updating header on trust bonus page * fix: updates copy for each step Co-authored-by: Gerald Iakobinyi-Pich <gerald@gitcoin.co> Co-authored-by: Gerald Iakobinyi-Pich <nutrina9@gmail.com> Co-authored-by: Nick Kammerdiener <nicolas@kammerdiener.us>
1 parent dfda553 commit 3cb262d

37 files changed

+3793
-2466
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ app/assets/landingpage/*
77

88
app/assets/onepager/js/confetti.js
99

10+
app/assets/v2/js/passport/*
1011
app/assets/v2/js/dataviz/*
1112
app/assets/v2/js/ethereumjs-accounts.js
1213
app/assets/onepager/js/tx.js
1314
app/assets/onepager/js/bignumber.js
14-
app/assets/v2/js/data-chains.js
15+
app/assets/v2/js/data-chains.js

.github/workflows/ci-review.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ jobs:
242242
DOCKER_GTC_WEB_IMAGE: ${{ needs.build-and-test.outputs.dockerTag }}
243243
GITHUB_API_USER: ${{ secrets.REVIEW_GITHUB_API_USER }}
244244
GITHUB_API_TOKEN: ${{ secrets.REVIEW_GITHUB_API_TOKEN }}
245+
GITHUB_APP_NAME: ${{ secrets.GTC_GITHUB_APP_NAME }}
246+
GITHUB_CLIENT_ID: ${{ secrets.GTC_GITHUB_CLIENT_ID }}
247+
GITHUB_CLIENT_SECRET: ${{ secrets.GTC_GITHUB_CLIENT_SECRET }}
248+
245249

246250
# Pass in the outputs from the generic environment, we will deploy our ressources in the VPC
247251
# and subnet that where created there
@@ -299,7 +303,7 @@ jobs:
299303
repo: context.repo.repo,
300304
body: `Test your commit here: \n\
301305
- [${{ steps.pulumi.outputs.frontendURL }}](${{ steps.pulumi.outputs.frontendURL }}) \n\
302-
- [http://${{ steps.compute.outputs.review_domain }}](http://${{ steps.compute.outputs.review_domain }}) \n\
306+
- [https://${{ steps.compute.outputs.review_domain }}](https://${{ steps.compute.outputs.review_domain }}) \n\
303307
`
304308
})
305309

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ RUN pip3 install --upgrade -r test.txt
5252
# Copy over docker-command (start-up script)
5353
COPY bin/docker-command.bash /bin/docker-command.bash
5454
COPY bin/review-env-initial-data.bash /bin/review-env-initial-data.bash
55+
COPY bin/celery/worker/run.sh /bin/celery/worker/run.sh
56+
5557
RUN dos2unix /bin/docker-command.bash
5658
RUN dos2unix /bin/review-env-initial-data.bash
5759

@@ -76,7 +78,7 @@ RUN echo fs.inotify.max_user_watches=524288 >> /etc/sysctl.conf
7678
EXPOSE 9222
7779
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
7880
WORKDIR /code/app
79-
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:80", "app.wsgi:application", "--max-requests=200"]
81+
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:80", "--timeout", "120", "app.wsgi:application", "--max-requests=200"]
8082

8183
# Tag
8284
ARG BUILD_DATETIME

app/app/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from django.utils.translation import gettext_noop
2626

2727
import environ
28+
import mimetypes
2829
import raven
2930
import sentry_sdk
3031
from boto3.session import Session
@@ -77,6 +78,10 @@
7778
# Notifications - Global on / off switch
7879
ENABLE_NOTIFICATIONS_ON_NETWORK = env('ENABLE_NOTIFICATIONS_ON_NETWORK', default='mainnet')
7980

81+
# Set .wasm mime type for dev env
82+
if DEBUG:
83+
mimetypes.add_type("application/wasm", ".wasm", True)
84+
8085
# Application definition
8186
INSTALLED_APPS = [
8287
'csp',
@@ -532,6 +537,7 @@ def callback(request):
532537
CELERY_RESULT_BACKEND = env('CELERY_RESULT_BACKEND', default=CACHEOPS_REDIS)
533538
# https://docs.celeryproject.org/en/latest/userguide/configuration.html#std-setting-task_routes
534539
CELERY_ROUTES = [
540+
('dashboard.tasks.calculate_trust_bonus', {'queue': 'high_priority'}),
535541
('grants.tasks.process_grant_contribution', {'queue': 'high_priority'}),
536542
('grants.tasks.batch_process_grant_contributions', {'queue': 'high_priority'}),
537543
('kudos.tasks.mint_token_request', {'queue': 'high_priority'}),

app/app/urls.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,21 @@
138138
name='profile_set_tax_settings'
139139
),
140140

141-
# verification services
141+
142+
# grants2.0 Verification Services
143+
url(
144+
r'^api/v2/profile/(?P<handle>.*)/passport/stamp/check',
145+
dashboard.views.check_passport_stamps,
146+
name='check_passport_stamp'
147+
),
148+
url(
149+
r'^api/v2/profile/(?P<handle>.*)/passport/verify',
150+
dashboard.views.verify_passport,
151+
name='verify_passport'
152+
),
153+
154+
155+
# grants1.0 Verification Services
142156
url(
143157
r'^api/v0.1/profile/(?P<handle>.*)/request_user_sms/?$',
144158
dashboard.views.send_verification,
@@ -238,6 +252,8 @@
238252
# dashboard.views.verify_user_duniter,
239253
# name='verify_user_duniter'
240254
# ),
255+
256+
241257
url(r'^api/v0.1/profile/(?P<handle>.*)', dashboard.views.profile_details, name='profile_details'),
242258
url(r'^api/v0.1/user_card/(?P<handle>.*)', dashboard.views.user_card, name='user_card'),
243259
url(r'^api/v0.1/banners', dashboard.views.load_banners, name='load_banners'),
@@ -441,8 +457,8 @@
441457
),
442458

443459
# View Bounty
444-
# TODO: The 2 URLs below issue_details_new2 and issue_details_new3 will not be used any more (we should not create such
445-
# links any more), and can be removed in the future. We are keeping these for now to avoid breaking the
460+
# TODO: The 2 URLs below issue_details_new2 and issue_details_new3 will not be used any more (we should not create such
461+
# links any more), and can be removed in the future. We are keeping these for now to avoid breaking the
446462
# existing links that users might have saved already.
447463
url(
448464
r'^issue/(?P<ghuser>.*)/(?P<ghrepo>.*)/(?P<ghissue>.*)/(?P<stdbounties_id>.*)',
70.8 KB
Loading
66.5 KB
Loading

0 commit comments

Comments
 (0)