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

Fix emulator support for cloudevent to better conform to production specification. #5466

Merged
merged 9 commits into from
Jan 31, 2023

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Jan 26, 2023

Fix few bugs in emulator support for cloudevent that was uncovered while testing python functions.

  1. Pubsub emulator sends timestamps with nano-second precision, not mili-second precision as done in Production. Not usually a problem, but the the ISO timestamp parsing function for Python doesn't work with timestamps with nano-second precision.

  2. specversion attribute of cloudevent should be 1.0 not 1

  3. Pubsub cloudevent should include snake_cased AND camelCase event attributes.

Also including a small change to improve debugging experience when discovering python functions fail due to user error - e.g. python code includes syntax error.

@taeold taeold marked this pull request as ready for review January 27, 2023 00:13
@taeold taeold force-pushed the dl_cf3_python_init branch from c8d8bbb to 02af491 Compare January 30, 2023 21:57
@taeold taeold force-pushed the dl_emulator_fixes branch from de008c4 to 2951641 Compare January 30, 2023 21:57
@taeold
Copy link
Contributor Author

taeold commented Jan 31, 2023

⏳ This pull request is set to merge as part of a Graphite merge job
Stack job ID: aDBFOYKNmnzR1pnl7vJM.
See details on graphite.dev

@taeold taeold force-pushed the dl_cf3_python_init branch from 02af491 to c2e179f Compare January 31, 2023 18:06
@taeold taeold force-pushed the dl_emulator_fixes branch from 2951641 to 88395f3 Compare January 31, 2023 18:06
@taeold taeold force-pushed the dl_cf3_python_init branch from c2e179f to d0028a7 Compare January 31, 2023 22:56
@taeold taeold force-pushed the dl_emulator_fixes branch from 59f9fb9 to e081eec Compare January 31, 2023 22:56
@taeold taeold force-pushed the dl_cf3_python_init branch from d0028a7 to e1fc3bf Compare January 31, 2023 23:10
@taeold taeold force-pushed the dl_emulator_fixes branch from eae4352 to ce4f5cc Compare January 31, 2023 23:10
@taeold taeold force-pushed the dl_emulator_fixes branch from 28141c2 to 9e79209 Compare January 31, 2023 23:12
Base automatically changed from dl_cf3_python_init to master January 31, 2023 23:30
@taeold taeold enabled auto-merge (squash) January 31, 2023 23:30
@codecov-commenter
Copy link

Codecov Report

Base: 56.24% // Head: 56.22% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (5b3d1b6) compared to base (7dc6c5b).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5466      +/-   ##
==========================================
- Coverage   56.24%   56.22%   -0.02%     
==========================================
  Files         317      317              
  Lines       21435    21442       +7     
  Branches     4376     4376              
==========================================
  Hits        12056    12056              
- Misses       8319     8326       +7     
  Partials     1060     1060              
Impacted Files Coverage Δ
src/deploy/functions/runtimes/python/index.ts 32.91% <0.00%> (-2.71%) ⬇️
src/emulator/pubsubEmulator.ts 13.09% <0.00%> (-0.16%) ⬇️
src/emulator/storage/cloudFunctions.ts 30.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@taeold taeold merged commit 416d034 into master Jan 31, 2023
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.

3 participants