Skip to content

feat: add support for persistent builders #699

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
merged 1 commit into from
Oct 15, 2021
Merged

Conversation

ascorbic
Copy link
Contributor

Adds support for the new builder persistence feature. It needs to be enabled for your org via feature flag, and then set the env var EXPERIMENTAL_PERSISTENT_BUILDERS. This changes the path for ODBs

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Oct 15, 2021
@ascorbic ascorbic self-assigned this Oct 15, 2021
@ascorbic ascorbic requested a review from a team October 15, 2021 11:03
@ascorbic ascorbic force-pushed the feat/persistent-builders branch from 355f9de to 2e97091 Compare October 15, 2021 11:06
const HANDLER_FUNCTION_NAME = '___netlify-handler'
const ODB_FUNCTION_NAME = '___netlify-odb-handler'
const IMAGE_FUNCTION_NAME = '_ipx'
const ODB_PATH = destr(process.env.EXPERIMENTAL_PERSISTENT_BUILDERS) ? 'builders' : 'functions'

Choose a reason for hiding this comment

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

jw - why do we need destr here vs a truthy check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because all env vars are strings if it's set to "false" or "0" it will be truthy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Obviously this is unlikely in this case, but I do generally try to avoid simple truthy checks on env vars as it's so easy to have very confusing errors

@ascorbic ascorbic force-pushed the feat/persistent-builders branch from 2e97091 to c63669a Compare October 15, 2021 11:19
@ascorbic ascorbic enabled auto-merge (squash) October 15, 2021 11:21
@ascorbic ascorbic merged commit c439a26 into main Oct 15, 2021
@ascorbic ascorbic deleted the feat/persistent-builders branch October 15, 2021 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants