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

Update docs about event types #454

Merged
merged 10 commits into from
Jun 11, 2018
Merged

Update docs about event types #454

merged 10 commits into from
Jun 11, 2018

Conversation

mthenw
Copy link
Contributor

@mthenw mthenw commented Jun 6, 2018

Docs about event types and Events API authorization

@mthenw mthenw requested a review from alexdebrie June 6, 2018 12:11
@codecov
Copy link

codecov bot commented Jun 6, 2018

Codecov Report

Merging #454 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #454      +/-   ##
==========================================
+ Coverage   66.17%   66.17%   +<.01%     
==========================================
  Files          32       32              
  Lines        1883     1892       +9     
==========================================
+ Hits         1246     1252       +6     
- Misses        585      587       +2     
- Partials       52       53       +1
Impacted Files Coverage Δ
event/event.go 77.41% <0%> (-0.71%) ⬇️
libkv/subscription.go 88.02% <0%> (-0.59%) ⬇️
internal/cache/target.go 0% <0%> (ø) ⬆️
event/http.go 100% <0%> (ø) ⬆️
internal/pathtree/tree.go 97.34% <0%> (+0.12%) ⬆️

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 83d3405...ce5cadb. Read the comment docs.

@mthenw mthenw force-pushed the et-docs branch 7 times, most recently from 73aa3ef to f18660e Compare June 6, 2018 13:58
Copy link
Contributor

@alexdebrie alexdebrie left a comment

Choose a reason for hiding this comment

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

@mthenw Thanks for writing the docs on this. Really appreciate you taking the time.

I'm concerned that the Events API section will be confusing to users as it switches between conceptual elements, details about subscriptions, and then API reference about the Events API itself.

I propose limiting this section of the docs more to API reference. How about the following structure of the Events API portion:

  • How to Emit an Event (API reference showing the HTTP mechanism for emitting an event).
  • CloudEvents behavior when an Event is received -- what does the payload turn it to, and how is it matched to a subscription?

The other stuff we should put either in a conceptual section of the docs (What are Events, EventTypes, Subscriptions, and Functions, and how do they interact?) or in more detailed reference material about the subjects themselves (e.g. a Subscriptions page that dives deeper into sync vs. async, an Event Types page that discusses authorization, etc.). These sections don't even need to be implemented today, though we do need to prioritize it in the very near term.

Thoughts? I'm not trying to make the perfect the enemy of the good, so let me know if I'm off base.

name:
$ref: '#/components/schemas/EventTypeName'
authorizerId:
$ref: '#/components/schemas/FunctionID'
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean authorizerId is a required property? Do we mark things as optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added list of required fields for every request payload.

docs/api.md Outdated

#### Event Data Type
Event Gateway support two subscription types: `async` and `sync`.
Copy link
Contributor

Choose a reason for hiding this comment

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

support --> supports

docs/api.md Outdated

### Authorization

Event Type can define authorizer function that will be called before calling a subscribed function. Authorizer function is a function registered in Function Discovery beforehand.
Copy link
Contributor

Choose a reason for hiding this comment

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

Function Discovery --> Event Gateway ?

docs/api.md Outdated

All data that passes through the Event Gateway is formatted as a CloudEvent, based on [CloudEvents v0.1 schema](https://github.com/cloudevents/spec/blob/master/spec.md):
Event Registry is a single source of truth about events occuring in the space. Every event emitted to a space has to have type registered beforehand.
Copy link
Contributor

Choose a reason for hiding this comment

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

This section is confusing to me. Where/what is the Event Registry?

EDIT: I see now. Added comment below on it.

docs/api.md Outdated

The Event Gateway exposes a RESTful JSON configuration API. By default Configuration API runs on `:4001` port.

### Event Registry
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, "Event Registry" is more confusing than just "Event Types" or "Event Types Resource Actions".

"Event Registry" seems like a set of functionality around Events beyond CRUD actions on a single REST resource.

docs/api.md Outdated

The Event Gateway exposes a RESTful JSON configuration API. By default Configuration API runs on `:4001` port.

### Function Discovery
Copy link
Contributor

Choose a reason for hiding this comment

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

Same note on "Function Discovery" as on "Event Registry" above.

docs/api.md Outdated
* `202 Accepted`
* `202 Accepted` - if there is no `sync` subscription. Otherwise, status code is controlled by function synchronously subscribed on this endpoint.

### Legacy Mode
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just delete Legacy Mode from the docs? We can continue to support it for a few versions but aim to deprecate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should be here as long as we support it. I will add deprecation note.

@@ -1,40 +0,0 @@
openapi: "3.0.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this spec as it doesn't really provide any value. @alexdebrie thoughts?

@mthenw
Copy link
Contributor Author

mthenw commented Jun 7, 2018

@alexdebrie please take a look again. I refactored it a bit.

@mthenw mthenw merged commit 173ccbd into master Jun 11, 2018
@mthenw mthenw deleted the et-docs branch June 11, 2018 07:57
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.

None yet

2 participants