Skip to content

Custom variableSyntax bug is not detected in new async variable system #3561

Closed

Description

@pmuens

This is a Bug Report

Description

The recently merged async Serverless variable system PR #3554 introduces a bug where an infinite loop is produced when using the variableSyntax.

Use this serverless.yml and run serverless package. After that look into the Outputs section of the generated CloudFormation file to see that the custom variable syntax is not used.

service: service

provider:
  name: aws
  runtime: nodejs6.10
  variableSyntax: \\${{([\\s\\S]+?)}}

functions:
  hello:
    handler: handler.hello
    events:
      - http: GET hello

custom:
  var: test

resources:
  Outputs:
    varA:
      Value: ${clientId()}
      Export:
        Name: varA
    varB:
      Value: ${{self:custom.var}}
      Export:
        Name: varB

The Problem was uncovered once all Promise usages were switched to Bluebird (see #3560) which introduced an infinte loop.

More instructions on how to reproduce the infinite loop when using Bluebird can be found in the follow-up PR which fixes some uses of native Promises where Bluebird Promises should be used --> #3560 (comment)


/cc @eahefnawy @brianneisler

Activity

  1. added this to the 1.13 milestone on May 5, 2017
  2. changed the title [-]Fix infinte-loop-bug in new async variable system[/-] [+]Fix not detecting variableSyntax bug in new async variable system[/+] on May 5, 2017
  3. changed the title [-]Fix not detecting variableSyntax bug in new async variable system[/-] [+]Fix not detecting custom variableSyntax bug in new async variable system[/+] on May 5, 2017
  4. changed the title [-]Fix not detecting custom variableSyntax bug in new async variable system[/-] [+]Custom variableSyntax bug is not detected in new async variable system[/+] on May 5, 2017
  5. eahefnawy commented on May 8, 2017

    @eahefnawy
    Contributor

    no bug here, just misconfiguration. For future reference, this particular variable syntax should be in double quote because it contains escape characters => variableSyntax: "\\${{([\\s\\S]+?)}}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions