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

event notifications #2108

Merged
merged 37 commits into from
Apr 20, 2020
Merged

event notifications #2108

merged 37 commits into from
Apr 20, 2020

Conversation

opqdonut
Copy link
Contributor

@opqdonut opqdonut commented Apr 6, 2020

for #2095

Definition of Done / Review checklist

Reviewability

  • link to issue

API

  • API is documented and shows up in Swagger UI
  • API is backwards compatible or completely new
  • Events are backwards compatible

Documentation

  • update changelog if necessary
  • add or update docstrings for namespaces and functions
  • documentation at least for config options (i.e. docs folder)
  • ADR for major architectural decisions or experiments

Testing

  • complex logic is unit tested
  • valuable features are integration / browser / acceptance tested automatically

Follow-up

  • no critical TODOs left to implement

@opqdonut opqdonut changed the title WIP: event notifications event notifications Apr 7, 2020
@opqdonut opqdonut mentioned this pull request Apr 14, 2020
5 tasks
docs/event-notification.md Show resolved Hide resolved
src/clj/rems/api/applications.clj Outdated Show resolved Hide resolved
src/clj/rems/db/applications.clj Outdated Show resolved Hide resolved
(def ^:private default-timeout 60)

(defn- notify! [target body]
(log/info "Sending event notification to" (:url target))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it would make sense to log a bit more info here about the event itself too, like id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm it looks like we don't pass the event id out of the db layer. I'll log the time, type, application-id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clarification: these events don't have ids because they're directly from the command handler, not fetched from the db

Copy link
Collaborator

@Macroz Macroz Apr 20, 2020

Choose a reason for hiding this comment

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

I think it'd make sense for the notified party to know the event id. It makes idempotency a bit easier.

src/clj/rems/event_notification.clj Outdated Show resolved Hide resolved
src/clj/rems/event_notification.clj Show resolved Hide resolved
test/clj/rems/test_event_notification.clj Outdated Show resolved Hide resolved
test/clj/rems/test_event_notification.clj Outdated Show resolved Hide resolved
test/clj/rems/test_event_notification.clj Show resolved Hide resolved
src/clj/rems/event_notification.clj Outdated Show resolved Hide resolved
Copy link
Collaborator

@Macroz Macroz left a comment

Choose a reason for hiding this comment

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

Looks good now. We can continue the discussions elsewhere, in followup PRs perhaps.

@opqdonut opqdonut merged commit 27a89fe into master Apr 20, 2020
@opqdonut opqdonut deleted the event-push-2095 branch April 20, 2020 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants