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

Remove prod check to enable integration tests with dev server #424

Conversation

djfarrelly
Copy link
Member

Summary

Developers sometimes run production builds against the dev server for integration testing. This skips the prod check which may produce a false positive where the signing key would be required. Requests are not signed in the dev server.

Checklist

  • Added a docs PR that references this PR
  • Added unit/integration tests
  • Added changesets if applicable

Related

Discord discussion

Developers sometimes run production builds against the dev server for integration testing. This skips the prod check which may produce a false positive where the signing key would be required. Requests are not signed in the dev server.
Copy link

changeset-bot bot commented Dec 12, 2023

⚠️ No Changeset found

Latest commit: de9cab3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jpwilliams
Copy link
Member

Superseded by #488.

@jpwilliams jpwilliams closed this Feb 14, 2024
jpwilliams added a commit that referenced this pull request Feb 23, 2024
## Summary
<!-- Succinctly describe your change, providing context, what you've
changed, and why. -->

Adds support for `INNGEST_DEV` and a new `isDev` option on the client.

This lightly refactors the current checks based around `isProd` and
`skipDevServer()`, which were getting a little difficult to read.

- The SDK now has two "modes:" `"dev"` and `"cloud"`.
- Each mode is either **explicit** or **inferred**. An inferred mode
means that the current (`v3.x.x`) version of the SDK can make a decision
to attempt to contact the Dev Server. Future versions will remove this
and default to `"cloud"` mode.
- Setting the `INNGEST_DEV` environment variable or the `isDev` client
option **explicitly** sets the mode to either `"cloud"` or `"dev"`.
- `INNGEST_DEV` accepts some sensible defaults. We'll recommend `1` to
explicitly set `"dev"` mode and `0` to explicitly set `"cloud"` mode,
though it also accepts `"true"`, `"y"`, `"no"`, etc.
- Explicitly setting either mode also sets the event ingestion and
syncing URLs. They continue to be further overwritten by passing
`INNGEST_BASE_URL`, `INNGEST_API_BASE_URL`, and
`INNGEST_EVENT_API_BASE_URL`.

> [!NOTE]
> To support many runtimes and environments, environment variables are
not always accessible a) at all times, and b) on `process.env`.
Sometimes environment variables are accessed via different global
objects, or sometimes runtime objects that are passed to requests.
>
> For this reason, handling environment variables is more complex and
relies on making best guesses during instantiation, then later making
another decision when we have access to the environment.

Supersedes both #424 and #425.

## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by
wrapping it in "~~"" and suffix it with "N/A My reason for skipping
this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [x] Added a [docs PR](https://github.com/inngest/website) documenting
these modes and the new environment variables that references this PR
- [x] Added unit/integration tests
- [x] Added changesets if applicable
- [x] Push env-related changes to the OS SDK Spec

## Related
<!-- A space for any related links, issues, or PRs. -->
<!-- Linear issues are autolinked. -->
<!-- e.g. - INN-123 -->
<!-- GitHub issues/PRs can be linked using shorthand. -->
<!-- e.g. "- inngest/inngest#123" -->
<!-- Feel free to remove this section if there are no applicable related
links.-->
- INN-2754
- Supersedes #424
- Supersedes #425
- inngest/website#679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 inngest Affects the `inngest` package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants