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

Open Runtimes V3 #136

Merged
merged 293 commits into from
Jul 18, 2023
Merged

Open Runtimes V3 #136

merged 293 commits into from
Jul 18, 2023

Conversation

Meldiron
Copy link
Contributor

@Meldiron Meldiron commented Jan 24, 2023

Open Runtimes V3 ⚡

Description

  • Ensure brand. Slug should be open-runtimes, verbose should be Open Runtimes, and there is no shorthand (no opr). openruntimes should not be used.
  • req and res params removed, context introduced
  • context.req contains all information about http request
  • context.res lets you configure all information about http request
  • res.json() is now context.res.json(). same for res.send() -> context.res.send(). New ones introduced.empty() and .redirect()
  • context.log() and context.error() lets you reliably log. Native support (likeconsole.log in Node) was removed
  • req.variables removed, system variables should be used instead (in Node, process.env.MY_VAR)
  • req.payload renamed to context.req.body. Body is automatically parsed now to JSON if there is JSON content-type header. In future we plan to support more types such as XML, URL-encoded or Form Data bodies.
  • Function now has to return. Instead of res.json(), now we do return context.res.json()
  • Missing response now responds with 204 instead of causing timeout error
  • Auth header renamed from x-internal-challenge to x-open-runtimes-secret
  • env variables renamed from INTERNAL_RUNTIME_KEY and INTERNAL_RUNTIME_ENTRYPOINT to OPEN_RUNTIMES_SECRET and OPEN_RUNTIMES_ENTRYPOINT
  • Logs race condition issues are now solved
  • MUCH better tests coverage
  • Removed automatic wrappers from Java, Kotlin, C++ and .NET

Development

Runtimes:

Other:

  • Install & build commands
  • .open-runtimes
  • folder consistent naming
  • Safe timeouts

Tests coverage:

Make sure to remove all outdated tests. If everything passes, all is ready for release

  • Logging to logs
  • Logging to error
  • Rrequest headers
  • Request headers MUST be ommiting x-openruntimes- ones
  • Request URL (url, path, query, queryString, host, scheme, port)
  • Request method
  • Request body empty
  • Request body plaintext
  • Request body JSON (automatic parsing)
  • Internal challenge 500
  • Exception thrown
  • Double response
  • No response
  • Empty response
  • Redirect response
  • JSON response
  • Text response
  • Emoji response
  • Headers response
  • env variables
  • Old tests, if relevant
  • Library test
  • Empty JSON body test
  • Empty secret header test
  • object/array log test
  • Exception trace test (filename)

Docs:

  • Ensure OPR is no longer used (and internal)
  • Update main readme

Post-release:

  • Update open runtimes / examples
  • Update appwrite / starters
  • Apply V3 changes to all versions

@Meldiron Meldiron mentioned this pull request Jan 29, 2023
@Meldiron Meldiron mentioned this pull request Jan 29, 2023
@Meldiron Meldiron mentioned this pull request Jan 30, 2023
@Meldiron Meldiron mentioned this pull request Jan 30, 2023
@Meldiron Meldiron mentioned this pull request Jan 31, 2023
@abnegate abnegate mentioned this pull request Feb 3, 2023
@Meldiron Meldiron marked this pull request as ready for review July 14, 2023 11:54
@Meldiron Meldiron mentioned this pull request Jul 17, 2023
Copy link
Member

@eldadfux eldadfux left a comment

Choose a reason for hiding this comment

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

@Meldiron great stuff! This is a game changing PR!

runtimes/cpp-17/.env Outdated Show resolved Hide resolved
runtimes/cpp-17/README.md Outdated Show resolved Hide resolved
@eldadfux eldadfux merged commit 2a5f53a into main Jul 18, 2023
2 checks passed
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

4 participants