code-dot-org icon indicating copy to clipboard operation
code-dot-org copied to clipboard

Add the sheet title to notify_of_external_sharing for PL sheets

Open bethanyaconnor opened this issue 3 years ago • 1 comments

We've been getting a Honeybadger error that a spreadsheet has been shared to external emails. Based on the domain of the emails, this is likely a false alarm, but it's been hard to know for sure without knowing which spreadsheet was shared. This change (hopefully) adds the title of the spreadsheet to the HB error.

This is a bit tough to test -- open to ideas on how to do that!

Links

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • [ ] Tests provide adequate coverage
  • [ ] Privacy and Security impacts have been assessed
  • [ ] Code is well-commented
  • [ ] New features are translatable or updates will not break translations
  • [ ] Relevant documentation has been added or updated
  • [ ] User impact is well-understood and desirable
  • [ ] Pull Request is labeled appropriately
  • [ ] Follow-up work items (including potential tech debt) are tracked and linked

bethanyaconnor avatar Jul 07 '22 16:07 bethanyaconnor

this does look tricky to test, and I don't think an automated test is practical, but I do think some manual testing is worth trying. here is one idea:

  • go onto the staging machine (or set up whatever keys you need locally)
  • open dashboard console
  • do some setup like
drive = Google::Drive.new
document_key = "key for a specific gsheet (not sure how to determine this)" 
  • now try to prove your code is right
drive.raw_session.spreadsheet_by_key(document_key).title
  • maybe try again with a nonexistent key to see if it returns nil document instead of raising
drive.raw_session.spreadsheet_by_key('nonexistent')

davidsbailey avatar Jul 12 '22 20:07 davidsbailey