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

Add event stream #39

Merged
merged 5 commits into from
Apr 11, 2024
Merged

Add event stream #39

merged 5 commits into from
Apr 11, 2024

Conversation

samdbmg
Copy link
Member

@samdbmg samdbmg commented Apr 2, 2024

Details

Adds an ADR proposing a couple of possible approaches to an event notification stream, along with a proposal about what the message format might look like.

I think Option 3 (telemetry) probably doesn't make sense, but I'd appreciate thoughts on Option 1 (specify notification mechanism) vs Option 2 (leave it up to implementations). For now I've done the implementation for Option 2, but Option 1 is a build on that.

Also, it might seem like AsyncAPI is the better fit for describing this, but it's quite high-friction for both HTTP webhooks and AWS EventBridge, which are the two possible implementations we've previously talked about, so using OpenAPI seemed the better approach for a spec.

I'd also appreciate thoughts on how Sources should work - see comments in the OpenAPI doc.

Pivotal Story (if relevant)

Story URL: https://www.pivotaltracker.com/story/show/187071067

Related PRs

N/A

Submitter PR Checks

(tick as appropriate)

  • PR completes task/fixes bug
  • API version has been incremented if necessary
  • ADR status has been updated, and ADR implementation has been recorded
  • Documentation updated (README, etc.)
  • PR added to Pivotal story (if relevant)
  • Follow-up stories added to Pivotal

Reviewer PR Checks

(tick as appropriate)

  • PR completes task/fixes bug
  • Design makes sense, and fits with our current code base
  • Code is easy to follow
  • PR size is sensible
  • Commit history is sensible and tidy

Info on PRs

The checks above are guidelines. They don't all have to be ticked, but they should all have been considered.

Adds an ADR proposing the addition of event notification streams to the
API.
@samdbmg samdbmg marked this pull request as ready for review April 2, 2024 09:16
@samdbmg samdbmg requested a review from a team as a code owner April 2, 2024 09:16
@philipnbbc philipnbbc self-assigned this Apr 8, 2024
Copy link
Contributor

@philipnbbc philipnbbc left a comment

Choose a reason for hiding this comment

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

Some comments inline and otherwise LGTM.

I agree that Option 1 or 2 makes sense over Option 3. I think the structure of the message format will probably change for different delivery mechanisms and so I see it's more about getting maximum commonality between implementations. Similar to the HTTP object store choice, maybe a message format plus a implementation would help get some form consensus of what is needed? Something like Option 2 plus a simple example implementation, but not going as far as Option 1 just yet.

api/TimeAddressableMediaStore.yaml Outdated Show resolved Hide resolved
api/TimeAddressableMediaStore.yaml Outdated Show resolved Hide resolved
Adds the structure of event stream messages using the OpenAPI `webhooks`
feature, a partial implementation of ADR0014 Option 2.

sem-ver: feature
Adds an option to specify an example implementation, but leave it up to
an individual service which to implement.
@samdbmg
Copy link
Member Author

samdbmg commented Apr 11, 2024

Similar to the HTTP object store choice, maybe a message format plus a implementation would help get some form consensus of what is needed? Something like Option 2 plus a simple example implementation, but not going as far as Option 1 just yet.

How's 8dcf44d for that?
Downside is it adds a bit of complexity to the API and it's a bit difficult to specify adequately in schema without being unduly prescriptive. But I think making it optional mitigates that a bit? Plus webhooks come with quite a few additional security considerations - I found https://webhooks.fyi/best-practices/webhook-providers#implement-security-on-egress-communication to be interesting reading.

@samdbmg samdbmg requested a review from philipnbbc April 11, 2024 07:04
@philipnbbc
Copy link
Contributor

philipnbbc commented Apr 11, 2024

Similar to the HTTP object store choice, maybe a message format plus a implementation would help get some form consensus of what is needed? Something like Option 2 plus a simple example implementation, but not going as far as Option 1 just yet.

How's 8dcf44d for that? Downside is it adds a bit of complexity to the API and it's a bit difficult to specify adequately in schema without being unduly prescriptive. But I think making it optional mitigates that a bit? Plus webhooks come with quite a few additional security considerations - I found https://webhooks.fyi/best-practices/webhook-providers#implement-security-on-egress-communication to be interesting reading.

I think that looks great, thanks. I think it's a good starting option to have.

@samdbmg samdbmg merged commit dc88766 into main Apr 11, 2024
3 checks passed
@samdbmg samdbmg deleted the sammg-api-notifications branch April 11, 2024 10:04
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