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

[all] Updated builders to version: 3 #3273

Merged
merged 22 commits into from
Nov 8, 2019
Merged

[all] Updated builders to version: 3 #3273

merged 22 commits into from
Nov 8, 2019

Conversation

AndyBitz
Copy link
Contributor

@AndyBitz AndyBitz commented Nov 8, 2019

  • Updates all runtimes to version 3
  • Makes Now CLI now dev support runtime version 3
  • Error when a non-Community Runtime is used for runtime
  • Updates the docs

PRODUCT-27

DEVELOPING_A_RUNTIME.md Outdated Show resolved Hide resolved
AndyBitz and others added 2 commits November 8, 2019 19:21
@leo leo marked this pull request as ready for review November 8, 2019 18:38
} else if (builder.version === 3) {
const { output, ...rest } = buildResultOrOutputs;

if ((output as BuilderOutput).type !== 'Lambda') {
Copy link
Member

@styfle styfle Nov 8, 2019

Choose a reason for hiding this comment

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

I think you can separate the possible output types by doing:

if (Array.isArray(output)) {
  throw new Error(`The result of "builder.build" must be a single Lambda, not an array'`);
}

if (output.type !== 'Lambda') {
  throw new Error(`The result of "builder.build" must be of type Lambda'`);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately that doesn't work, I couldn't find a way around the casting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@styfle I've tried to reduce the casting. However, those are sort of assertion checks, so if we wouldn't cast them TypeScript would complain that this is always true, but this is the builder result, which could actually be any, since we don't control what it returns.

@AndyBitz AndyBitz requested a review from styfle November 8, 2019 19:54
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

This test is failing every time:

✖ deploy a Lambda with a specific runtime

@AndyBitz AndyBitz merged commit c8c56bc into canary Nov 8, 2019
@AndyBitz AndyBitz deleted the builder-version-3 branch November 8, 2019 20:58
leo pushed a commit that referenced this pull request Nov 11, 2019
* [now-node] Use builder version 3

* [now-cgi] Use builder version 3

* [now-go] Use builder version 3

* [now-python] Use builder version 3

* [now-ruby] Use builder version 3

* Adjust docs

* [now-ruby] Remove unused import

* Temp. test in iad1

* Revert "Temp. test in iad1"

This reverts commit 4c495ba.

* [now-cli] Adjust `now dev` for builder version 3

* [now-build-utils] Do not allow non Community Runtimes

* Temp. Force Build in iad1

* Update DEVELOPING_A_RUNTIME.md

Co-Authored-By: Steven <steven@ceriously.com>

* Update docs

* Update test/lib/deployment/now-deploy.js

Co-Authored-By: Steven <steven@ceriously.com>

* Remove temp. iad1 check

* Check memory and maxDuration

* Use memory for Lambda

* Only cast once

* Skip tests
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

3 participants