Annotations: BE#6478
Conversation
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
zoldar
left a comment
There was a problem hiding this comment.
LGTM, aside from the tests that probably need a slight update after the last round of changes.
|
|
||
| scope "/:domain/annotations", PlausibleWeb.Api.Internal, | ||
| private: %{allow_consolidated_views: true} do | ||
| pipeline :annotations_endpoints, |
There was a problem hiding this comment.
Pipelines are defined at the router root anyway (behind a macro). I'd either group it with other pipelines or - given it's now used only by a single controller - move the plug directly to the controller.
|
|
||
| test "an unparsable date string is rejected" do | ||
| changeset = | ||
| Annotation.changeset( |
There was a problem hiding this comment.
Side note - even for error cases, I'd recommend shaping the changeset and arguments in a way where all the other data are correct (for instance note and type aren't missing), so that the error case is tested in isolation from other errors.
There was a problem hiding this comment.
Thanks! This valid comment led me down a rabbit hole of adding and refactoring tests. Thankfully, it also exposed some missing functionality that I fixed in 579c601
|
🔎 deepsec reviewed 🔎 deepsec found 9 findings🟠 HIGH ×1 · 🟡 MEDIUM ×3 · 🟣 BUG ×5 scope: 🟠 HIGH ·
|
Personal segments aren't private by design. They were initially supposed to be, but we reevaluated and wanted to support sharing links to dashboards filtered by a particular segment and having these work consistently even if the segment type changes over time. Need to add code comments so this wouldn't keep coming up.
What if there's just one user on the site and they want to add 500 notes? This is a matter the site team owner can sort out with the user exhausting the shared cap.
See above why personal segments aren't private.
Need to look into this separately.
Separate issue
Separate issue
Separate issue |
|
About 7542f6e
|
+1 can we stop the madness please? |
Thanks, @zoldar! With the UI implemented, a status 400 error message would be shown to user, but a status 500 would be shown as "something went wrong". The user's path to salvation would be the same, reaching out for help. In the 400 case, their screenshot to us would be more informative. In the 500 case, there's also a chance that we pick it up from our logging platform without the user needing to reach out. That has a slight advantage, so I will revert it to be internal server error in #6481. |
Changes
Adds the BE for annotations. It's heavily based on segments and in this PR, it piggybacks on SiteSegments billing feature for brevity. Accessible only with feature flag "annotations".
Tests
Changelog
Documentation
Dark mode