Skip to content

Updates for binary encoding #9

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

Merged

Conversation

evankanderson
Copy link
Contributor

Updates binary encoding to handle extensions and content-type per spec.

Update marshaller to handle both structured and binary formats. Previously, it would try structured first, even if the content-type did not match, and then ignore all the headers, producing very wimpy events with no data.

  • Link to issue this resolves
    I was too lazy to file an issue while debugging.

  • What I did
    I wrote a small python program using Flask to log cloud events, and to report them in a webpage. I'll be putting in in a pull request to https://github.com/knative/docs soon.

  • How I did it
    I used the following command to POST cloudevents to the flask program I wrote above.

curl -v -d '{}' \
  -H 'CE-SpecVersion: 0.2' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'CE-Source: "http://manual/"' \
  -H 'CE-Type: "local.badidea"' \
  -H 'CE-Id: 123' \
  -H 'CE-Time: "2019-01-11T23:40:00Z"' \
  -H 'CE-test: foo' \
  -H 'CE-test: bar' \
  -H 'CE-sampling: 2' \
  -H 'traceparent: aauau' \
  http://127.0.0.1:5000/
  • How to verify it
    I updated the tests.

  • One line description for the changelog

* Updated library to better support binary encoding

Signed-off-by: Evan Anderson <argent@google.com>
@evankanderson
Copy link
Contributor Author

This is a merge with #7, as requested in the PR for #8.

@denismakogon
Copy link
Member

I'll release a new version early next week.

@evankanderson
Copy link
Contributor Author

This was a PR on the branch that #7 came from, so that when you merged this into #7, you could then merge that into master.

@denismakogon
Copy link
Member

I'd like to get everything into a single PR and deal with that, can you make sure that all changes from #7 reflected here as well?

@evankanderson
Copy link
Contributor Author

If you merge this PR, it will update #7, which you can then merge into master.

Signed-off-by: Evan Anderson <argent@google.com>
@denismakogon
Copy link
Member

I closed #7 if you didn't noticed because I'd like this PR to be a single PR to land into a master branch. So, please merge #7 to #9 and I'll merge it ("it" means #9 only, but not #7)

@evankanderson
Copy link
Contributor Author

This PR is against the 0.2-force-improvements, so it won't change master at all when you merge it. (And, if you browse https://github.com/evankanderson/sdk-python/tree/boonary, you'll see that it includes your 043236b, 9357beb, and d8cec17.)

@denismakogon denismakogon merged commit c9eec27 into cloudevents:0.2-force-improvements Jan 15, 2019
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