694 Commits

Author SHA1 Message Date
exoego
f434009c45 Move stage name validation to Service#validate.
Since validation should be performed after service.functions are resolved.
2019-01-16 16:39:09 +09:00
Daniel Schep
96906c1c70
Merge pull request #5686 from exoego/validation-after-var-resolution
AWS: Fix stage name validation timing and allow hyphen
2019-01-13 20:25:53 -05:00
exoego
fe6cb01302 Fix error message. 2019-01-12 17:33:38 +09:00
exoego
ef591b2677 Add test case when the populated variable is valid. 2019-01-12 17:23:45 +09:00
exoego
df780c36e3 Allow underscore too. 2019-01-12 17:17:40 +09:00
exoego
a12bb5bf71 Allow hyphen which is valid for API Gateway now. 2019-01-12 08:53:29 +09:00
exoego
5ca31157b7 Add test case to increase coverage. 2019-01-12 08:33:50 +09:00
exoego
6e0d7a86d1 Implement after-variable-resolution stage name validation for AWS. 2019-01-12 08:11:50 +09:00
Daniel Schep
0896f311b1
Merge pull request #5312 from Limess/4496/handle-scoped-packages
Handle scoped npm packages in ${file()} variables
2019-01-07 10:56:25 -05:00
exoego
e2722a71e3 Add warning prefix. 2018-12-31 19:28:32 +09:00
exoego
fad655eb91 Refactor: inline underscore-starting private methods since it is linted as error. 2018-12-31 07:54:25 +09:00
exoego
e6599f3953 Refactor: move service validations to Service#validate 2018-12-31 07:38:24 +09:00
exoego
ae9d7ca83d Refactor to increase coverage. 2018-12-30 22:11:31 +09:00
exoego
58f3cc2153 Fix linting errors and older-nodejs errors. 2018-12-30 22:02:05 +09:00
exoego
5df4c7982d Add warning for multiple functions having same handler. 2018-12-30 21:54:30 +09:00
Daniel Schep
e99e71d215 lint 2018-12-13 09:32:46 -05:00
Daniel Schep
63fb1309d3 restore support for variable refs with spaces in them 2018-12-13 09:16:57 -05:00
horike37
4336340aa4 Merge remote-tracking branch 'root/master' into cf-ref-region 2018-12-10 12:01:41 +09:00
exoego
13de2a9083 Use lodash for consistency. 2018-12-10 09:50:16 +09:00
exoego
e90e293c71 Add region suffix support to CloudFormation reference syntax 2018-12-08 20:44:16 +09:00
Daniel Schep
80f9a2599f
Merge pull request #5571 from exoego/preserver-space-in-fallback
BREAKING-CHANGE Preserver whitespace in variable fallback
2018-12-06 11:53:06 -05:00
exoego
1a9cdf356b Remove whitespace-celaning that seems unnecessary. 2018-12-06 21:36:00 +09:00
Daniel Schep
2ad01b3fe3 [WIP] Support for publishing Lambda Layers 2018-11-29 10:55:52 -05:00
Daniel Schep
dd4a49d7f5
Merge pull request #4827 from simonbuchan/config-promises
Support returning promises from serverless.js
2018-11-27 11:45:07 -05:00
Daniel Schep
11a6688146 test covering #5493 2018-11-15 13:19:31 -05:00
Jerzy Kozera
efa6963242 Fix issues with PR #5631 causing base64 errors
- Some of values were not converted back from base64, which resulted in
  spurious errors with base64 strings.
  (This was caused by nested arrays, like commands, not being converted
   back, combined with the wrong assumption that commands always occur
   before options. It is not always true, as the added test case
   demonstrates.)
- Some other values were converted *from* base64, but they weren't
  base64 in the first place, which resulted in junk binary data.
  (This was due to the invalid assumption that only odd-numbered values
   need to be converted.)
2018-11-15 17:39:35 +01:00
Daniel Schep
4cf2db57f9
Merge pull request #5298 from shanehandley/2116-consistent-errors-missing-config
2116 consistent errors missing config
2018-11-13 08:18:04 -05:00
Takahiro Horike
af26fbbc1a
Merge pull request #5361 from 07Gond/master
Avoid args being rounded and converted to numbers
2018-10-14 13:48:27 +09:00
Shane Handley
c49ebdfffc Update serverless config file lookup in pluginmanager to use the serverless config default value always. 2018-10-13 19:25:04 +09:00
Shane Handley
1726daef2e Merge branch 'master' into 2116-consistent-errors-missing-config 2018-10-12 15:02:19 +09:00
Gerson Niño
2549145fd1 Adding code comments 2018-10-06 01:22:03 -05:00
Gerson Niño
d1e0fbd6f1 Adding unit test 2018-10-06 01:15:04 -05:00
Gerson Niño
74a27d13ac Adding support to node4 and fix naming 2018-10-06 00:42:43 -05:00
Shane Handley
7b664e949f Update the way that the configDependent property is checked, switch some lookups to getServerlessConfig to use the service path from sls.config rather than assume process.cwd() 2018-09-30 15:40:21 +09:00
Gerson Niño
9a0f5763cf Workaround to avoid convert string to numbers with minimist 2018-09-28 10:06:13 -05:00
Erik Erikson
553e6cf0da Provide Consistent Service Path
Fix #5242

Do this by first supplying the `servicePath` in `~/lib/plugins/lib/validate.js` and `~/lib/plugins/print.js` in a consistent manner with the code in `~/lib/classes/PluginManager.js`.  Then, provide a default of `process.cwd()` for `servicePath` in `getCacheFilePath` and `getServerlessConfigFile`.
2018-09-19 17:03:29 -07:00
Charlie Briggs
8f8c27ae7e Handle scoped packages in ${file()} variables
Currently @ is not a valid variable character, so it doesn't get parsed
as one.
When it does get parsed, @ is not considered valid as part of a file path
- we add a blacklist as per https://github.com/serverless/serverless/pull/4528 to
handle this case.
2018-09-19 17:26:50 +01:00
Shane Handley
f817bc954e Fix tests after inadvertantly changing case after linting. 2018-09-16 04:59:27 +09:00
Shane Handley
efe3d1c73b Linting 2018-09-16 04:24:52 +10:00
Shane Handley
9a3ba1f717 Removed accidental formatting, again :(. 2018-09-16 03:17:52 +10:00
Shane Handley
7837a062fa Removed accidental formatting, again :(. 2018-09-16 03:16:14 +10:00
Shane Handley
10ac3fa950 Removed accidental formatting. 2018-09-16 03:13:31 +10:00
Shane Handley
515fd8c6ab Updated config to require serverless config for selecte plugins. 2018-09-16 03:04:50 +10:00
Shane Handley
860fd938a0 Test coverage of the flag to check for serverless config befre executing a command which requires a config to exist. 2018-09-15 14:32:34 +10:00
Shane Handley
d81ad1b913 Initial conversion to validation within the PluginManager, rather than a per-plugin invocation of the validation. 2018-09-10 21:41:39 +10:00
Erik Erikson
2ebc65fe97 Fix Embedded Deep Variable in Variable String, within Override bug
If an override comes back as a variable containing a deep variable (e.g. `''${self:custom.${deep:1}, "fallback"}''`) or really any variable at all, it needs to be made a deep variable and paused for next iteration.  Do this generally rather than only in the case of deep variables.  See the test case for a circumstance that the prior fix didn't resolve.  This more generalized handling improves the fix and solves a remaining issue we found locally.
2018-08-17 17:50:58 -07:00
Erik Erikson
73ebe0f66b Fix #5205
Use the variable string from which the overwrite parameters were extracted as the replacement target (in the case of deep variable discovery) rather than the context property which represents the entire original value that the replacement is being waited upon.  That context property can contain far more content than the overwrite string itself.
2018-08-16 18:35:53 -07:00
Takahiro Horike
659df3651c
Merge pull request #5119 from gcphost/master
#5110 null error on undefined AWS SSM variables
2018-08-06 21:31:57 +09:00
Takahiro Horike
8c85ed0db1
Merge pull request #5156 from erikerikson/fix-overwrite-to-deep-unresolvable
During Overwrite, Pause on Deep Variables
2018-08-02 20:41:27 +09:00
Erik Erikson
42d1749c36 When evaluating overwrite values, identify deep values and pause population.
This avoids taking a deep value as a valid term within an overwrite 
(defaulting) variable statement that will later resolve to undefined 
but, as a deep variable string, is valid in immediate evaluation.

Fixes #5027
2018-07-24 14:42:21 -07:00