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

Sentry integration #1846

Merged
merged 8 commits into from
Aug 1, 2018
Merged

Sentry integration #1846

merged 8 commits into from
Aug 1, 2018

Conversation

mbeacom
Copy link
Contributor

@mbeacom mbeacom commented Jul 30, 2018

Description

The goal of this PR is to add Sentry integration for error reporting and remove Rollbar.

Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)

error reporting, logging

Testing

Locally

@mbeacom mbeacom added frontend This needs frontend expertise. backend This needs backend expertise. labels Jul 30, 2018
@mbeacom mbeacom self-assigned this Jul 30, 2018
USER=$(whoami)

echo "Submitting deployment to Sentry - Revision: ($REVISION) - Environment: ($ENV) - User: ($USER)"
curl https://$SENTRY_ADDRESS/api/hooks/release/builtin/$SENTRY_PROJECT/$SENTRY_TOKEN/ \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quote to prevent globbing and word splitting.

curl https://$SENTRY_ADDRESS/api/hooks/release/builtin/$SENTRY_PROJECT/$SENTRY_TOKEN/ \
-X POST \
-H 'Content-Type: application/json' \
-d '{"version": "$REVISION"}'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expressions don't expand in single quotes, use double quotes for that.

@gitcoinco gitcoinco deleted a comment from stickler-ci Jul 30, 2018
curl https://$SENTRY_ADDRESS/api/hooks/release/builtin/$SENTRY_PROJECT/$SENTRY_TOKEN/ \
-X POST \
-H 'Content-Type: application/json' \
-d '{"version": \"$REVISION\"}'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expressions don't expand in single quotes, use double quotes for that.

curl https://$SENTRY_ADDRESS/api/hooks/release/builtin/$SENTRY_PROJECT/$SENTRY_TOKEN/ \
-X POST \
-H 'Content-Type: application/json' \
-d \'{"version": "$REVISION"}\'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This { is literal. Check expression (missing ;/\n?) or quote it.
This } is literal. Check expression (missing ;/\n?) or quote it.

@codecov
Copy link

codecov bot commented Jul 30, 2018

Codecov Report

Merging #1846 into master will increase coverage by 0.01%.
The diff coverage is 61.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1846      +/-   ##
==========================================
+ Coverage   28.02%   28.03%   +0.01%     
==========================================
  Files         129      129              
  Lines       10466    10458       -8     
  Branches     1395     1395              
==========================================
- Hits         2933     2932       -1     
+ Misses       7426     7419       -7     
  Partials      107      107
Impacted Files Coverage Δ
app/git/utils.py 49% <ø> (-0.01%) ⬇️
app/app/context.py 0% <ø> (ø) ⬆️
app/gitcoinbot/actions.py 64.86% <ø> (+0.19%) ⬆️
app/dashboard/utils.py 23.67% <ø> (-0.22%) ⬇️
app/app/utils.py 18.94% <0%> (-0.43%) ⬇️
app/dashboard/management/commands/sync_geth.py 0% <0%> (ø) ⬆️
app/dashboard/notifications.py 16.96% <50%> (-0.17%) ⬇️
app/app/settings.py 83.78% <77.77%> (+1.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9cf1bf3...ef61f6d. Read the comment docs.

owocki
owocki previously approved these changes Jul 30, 2018
Copy link
Contributor

@owocki owocki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didnt test but LGTM.

SENTRY_RELEASE = raven.fetch_git_sha(os.path.abspath(os.pardir)) if SENTRY_USER else ''
if SENTRY_ADDRESS and SENTRY_PROJECT:
RAVEN_CONFIG = {
'dsn': f'https://{SENTRY_USER}:{SENTRY_PASSWORD}@{SENTRY_ADDRESS}/{SENTRY_PROJECT}',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcode {SENTRY_ADDRESS} -> sentry.io ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't using the hosted solution. This gives whoever is running the app the choice of URI. We're self-hosting, since it's a fairly small footprint and we can retain data as long as necessary.

# 'class': 'rollbar.logger.RollbarHandler',
# }
# LOGGING['loggers']['django']['handlers'].append('rollbar')
rollbar.init(**ROLLBAR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@@ -300,7 +300,7 @@ <h5 class="bounty-heading">{% trans "Funder" %}</h5>
<span class="font-smaller-4">Reject worker</span>
</a>
</span>
</div> |
</div> |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatic. 🤷‍♂️

@@ -182,7 +182,7 @@ <h5>{% trans 'Payout Preview' %}</h5>
{% include 'shared/bottom_notification.html' %}
{% include 'shared/analytics.html' %}
{% include 'shared/footer_scripts.html' %}
{% include 'shared/rollbar.html' %}
{% include 'shared/sentry.html' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably should move it all into one common shared.html which has all these imports (eventually) :P

Copy link
Contributor

@SaptakS SaptakS Jul 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but there are lot of files which we might do that way. I would say it's not a blocker right now for merging. So if you are okay, I will go ahead and merge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with it ^_^

Copy link
Member

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbeacom left a small comment -> Other than that LGTM.

PS: This integration makes our code a lil cleaner 😂

SaptakS
SaptakS previously approved these changes Jul 31, 2018
Copy link
Contributor

@SaptakS SaptakS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

thelostone-mc
thelostone-mc previously approved these changes Aug 1, 2018
Copy link
Member

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mbeacom mbeacom dismissed stale reviews from thelostone-mc and SaptakS via ef61f6d August 1, 2018 12:54
@mbeacom mbeacom merged commit 6d37297 into master Aug 1, 2018
@mbeacom mbeacom deleted the sentry branch August 1, 2018 12:54
shad-k added a commit to shad-k/web that referenced this pull request Aug 12, 2018
* put reasons above the other two modules

* gitcoinco#1854

* css: minor refactor

* token approvals

* fix for email not being sent

* retail: added template tag matches

- matches tag does a regex match
- updated nav to use matches to display network status on
  explorer, issue, bounty - create + submit + payout pages

* code refactor + clean up

- removed redundant uris
- reindent code
- fixed uneven padding of network banner on tip page

* send2: convert CRLF -> LF

* isort fixes

* console error, responseJSON did not exist

* change name of missing image

* fix for exception in bounty.additional_funding_summary_sentence()

* funder stale email

* linter stinter

* days

* Fix linting issues and docstyle all teh thingz

* Fix bad variable out of scope reference in render_bounty_startwork_expired email

* restructure: landing

- renamed index -> funder
- moved funder related templates into it's own folder
- added heading to top contributors

* restructure: dashboard

- renamed _dashboard -> dashboard
- renamed dashboard.html -> dasboard/index.html

* onboard: prettified metamask wallet address

* Sentry integration (gitcoinco#1846)

* Sentry integration - deprecate rollbar

* Imports are hard

* dbl quotez

* Single quotes

* Fix travis

* Forgot to save this file xD

* Add middleware and wsgi handler

* Logging adjustments for Sentry

* Fix gitcoinco#1898 - Adjust ordering of mailchimp args and cast envvars to str

* Merge branch 'master' into restructure

* gitcoinco@dead551#diff-8d7b20d795398cf2b0e792ee8c1a165c

* space in sentence

* Update presskit copy (gitcoinco#1900)

* Fix sentry release script revision handling

* add no a token page

* disabled metamask

* stickler hate me

* add item to menu

* dashboard: remove tech stack filter

* fixes press kit

* add no a token page

* blank

* Solve conflicts

* sitemap fixes

* disabled metamask

* stickler hate me

* i have grammar OCD

* bad link

* Fix gitcoin logo

* documentation about chain of custody

* cahin of custoyddyyyyyyyyyy

* Modify raven handling

* Add sentry request feedback on error

* Extending expiration backend code added

* Some minor changes

* Adds cancel button

* Adds alert notifying extending of expiration

* Fixes linting issues

* expiration: final touches

- stickler fixes
- show current expiration in modal
- add stopwatch icon
- extra css

* Fixes travis

* shared.js/mutate_interest: Show a generic message on network errors.

followup 3960c6
PR gitcoinco#1681

* Round up millisecond position

* Moderators v1 (gitcoinco#1903)

* Ref gitcoinco#1669 - Base escalation/interest statuses and handling

* Moderation changes

* Add faucet change to perms

* No mod

* Fix mig for local

* Update mod handling throughout remaining views and check gh closures

* Whoops

* Fix some tests

* Fix some pytest cases

* Fix more tests

* indent fix

* More test changes

* Add property back to tips method

* Fix gitcoinco#1919 - Catch attribute error if the keywords prop isn't a string

* Adjust Raven JS to no longer load async

* Revert "Adjust Raven JS to no longer load async"

This reverts commit 37d4584.

* Fix funding/details path

* Adjust github details field

* gh dict

* catch on gh details

* Remove temporarily

* Disable url dict

* Disable GH funcs

* Display project length in issue details page

* Fix GH token usage

* translation tags and clarification on lcoalhost

* facebook verify

* facebook verify

* Revert "facebook verify"

This reverts commit 50b7ebb.

* Revert "facebook verify"

This reverts commit 51f5e54.

* Adjust saving of gh issue details

* sync geth stopgap fix

* Adjust default limit on bounty router

* Revert "Adjust default limit on bounty router"

This reverts commit a7d872c.

* stopgap fix

* fixes

* runs make fix on master branhc

* sync mail fix to make it less aggressive

* Adjust yapf to no longer touch settings.py

* Update precommit yapf config

* fix for sync_listener

* linting sync_geth

* copy updates

* merge migration

* Adjust gh state checks

* Update gh state

* Updates to gh pulling...

* GH Pulling adjustments

* meta tags

* title

* no ico life

* conflicts

* fix for https://gitcoincore.slack.com/archives/CC24APWGN/p1533245102000397

* prod bug

* prod bug

* prod bug

* prod bug

* graphs r fun

* fix for not being able to ERC20 approve tokens

* fix for leaderboards

* eslint

* adjusts hourly rate distribution calculation criteria

* Switching tree section

* landing: css + refactor

* lander video switcharooooooooooooO

* joe dominance was busttedd

* shared: updated what_is_gitcoin

* added branding style to terms page

* changed style of headers on terms page, moved terms.txt into terms.html, added blocktrans tag

* Confirming Auto-translation (gitcoinco#1916)

* Update makefile with build/push/login and add OCI compliant labels

* terms: moved to internal css + mt-4 -> mt-5

* Adjust sentry to use split projects

* Fix config

* Adjust fe sentry template

* Sentry adjustments

* livestream 8/3

* Sentry adjustments

* livestream 8/3 (gitcoinco#1930)

* Show Just 1 Alert Banner for ERC20 Token

Fixes gitcoinco#1566

* allow trailing slah for profile (gitcoinco#1931)

* Improve tip slack notification (gitcoinco#1929)

* Improve tip slack notification

* Remove title var and simply check tip.github_url

* Add new lines

* Adjust sentry raven JS

* Adjust sentry raven JS

* Revert profile url change

* Revert "Adjust sentry raven JS"

This reverts commit 5432bc4.

* Revert "Adjust sentry raven JS"

This reverts commit 25e9987.

* Sentry adjustments

* Final sentry js adjustments!

* tip receive is eth

* nonce value

* bounty: restructure pages

* Fix gitcoinco#1949 - Adjust getattr for profile

* prod debugging; dupe emails

* prod debugging of dupe emails

* prod debugging of dupe emails

* remove dupe to_email

* dupe email fix

* dupe email fix

* dupe email fix

* reverts debug code

* fix for bad preferred profile addresses

* fix for https://sentry.gitcoin.co/gitcoin/gitcoin-prod-frontend/issues/278/

* http 404 on hidden prfiles

* SEO fixes, linting

* content type for robots.txt

* SEO stuff

* sync_geth latest disabler

* Fix isort / travis

* what_is_gitcoin : revert to old design (gitcoinco#1957)

* fix gitcoinco#1921

* Fix gitcoinco#1934 - Resolve funded total in profile (gitcoinco#1935)

* fix for https://sentry.gitcoin.co/gitcoin/gitcoin-prod-backend/issues/321/?referrer=slack

* support for https://sentry.gitcoin.co/gitcoin/gitcoin-prod-backend/issues/320/?referrer=slack

* disqus url now canonical

* funder stale args

* very small copy change

* smarter funder stale emails

* fix for ipfs hashes not existing

* fix for being redirected to old bounty id upon submission

* copy updates

* handler for not sending funder stale emails if n email

* puts the right network linkn on the web3 waiter

* metamask reloader

* explorer:  ensure results from latest api call are served to the user (gitcoinco#1941)

* explorer: abort pending request for fetchingBounties

* added review feedback

* Upgrade django to 2.1, modify field defaults, and address deprecations (gitcoinco#1915)

* Upgrade django to 2.1 and address deprecations

* Remove commented out imports

* fix: sticker issue

* Update reqs

* Remove unused import

* Fix gitcoinco#1972 - Strip characters from stdbounties_id and check isdigit

* replaced misspelled 'deonomination' with 'denomination' throughout the codebase (gitcoinco#1974)

* dashboard: uri cleanup (gitcoinco#1971)

* img: removed unused images

* Resolve outdated deps in package-lock.json

* Upgrade FE npm deps

* Upgrade FE npm deps

* Pin raven

* starts to track gas guzzlers, for later inclusion in the gitcoin gas station

* Error: insufficient funds for gas * price + value

* gas guzzlers

* linter

* gas guzzlers

* fix for slack not showing UP

* newsletter 8/10

* copy updates

* does tip receive math in BigNumber, bc JS rounding issues

* share link not edit link

* Update profile check to getattr

* fix for https://gitcoincore.slack.com/archives/CAXQ7PT60/p1533912000000126

* satisfy linter

* press

* Split create_new_bounty kwargs building and check if once (gitcoinco#1892)

* Split create_new_bounty kwargs building and check if once

* Update to_dict to use model_to_dict form helper

* Fix import - whoops

* Adjust to dict handling via supermodel method

* keep an eye on unsubscribes in preferences

* keep an eye on unsubscribes in preferences

* fixes label on gas guzzler page, and adds an admin view for vizuailzations

* Minor tweaks to action plan textarea (gitcoinco#1856)

* Clear example action plan when the textarea is focused

* Fix minor typo

* hack: trailing slash for profile (gitcoinco#1937)

* start work : update placeholder

* added feedback
jvmaia pushed a commit to jvmaia/web that referenced this pull request Nov 12, 2018
* Sentry integration - deprecate rollbar

* Imports are hard

* dbl quotez

* Single quotes

* Fix travis

* Forgot to save this file xD

* Add middleware and wsgi handler
jvmaia pushed a commit to jvmaia/web that referenced this pull request Nov 15, 2018
* Sentry integration - deprecate rollbar

* Imports are hard

* dbl quotez

* Single quotes

* Fix travis

* Forgot to save this file xD

* Add middleware and wsgi handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This needs backend expertise. frontend This needs frontend expertise.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants