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

cli: an equals sign in a context value is dropped #5738

Closed
jzj opened this issue Jan 10, 2020 · 2 comments
Closed

cli: an equals sign in a context value is dropped #5738

jzj opened this issue Jan 10, 2020 · 2 comments
Assignees
Labels
bug This issue is a bug. in-progress This issue is being actively worked on. p1 package/tools Related to AWS CDK Tools or CLI

Comments

@jzj
Copy link
Contributor

jzj commented Jan 10, 2020

If the value for a context contains an equals sign, the cli drops the equals sign.

cdk synth -c foo=bar=

Produces a value of "bar" for the context named "foo" instead of the expected value "bar=".

Reproduction Steps

  1. Synth the following stack with this context value -c foo=bar=:
export class FooStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const foo: string = this.node.tryGetContext('foo');
    new cdk.CfnOutput(this, 'foo', { value: foo });
  }
}
cdk synth -c foo=bar=

Expected Output

Outputs:
  foo:
    Value: bar=

Actual Output

Outputs:
  foo:
    Value: bar

Environment

  • CLI Version :1.19.0
  • Framework Version:1.19.0
  • OS :Linux
  • Language :TypeScript

Other


This is 🐛 Bug Report

@jzj jzj added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 10, 2020
jzj added a commit to jzj/aws-cdk that referenced this issue Jan 13, 2020
Uses a regular expression that contains capturing parentheses for the context value after the first equals sign.

fixes aws#5738
@SomayaB SomayaB added package/tools Related to AWS CDK Tools or CLI in-progress This issue is being actively worked on. labels Jan 13, 2020
@shivlaks shivlaks added the p1 label Jan 15, 2020
@shivlaks
Copy link
Contributor

@jzj thanks for reporting! I see that you have a fix in progress. Let me know if there's anything I can do to help move it along.

@shivlaks shivlaks removed the needs-triage This issue or PR still needs to be triaged. label Jan 15, 2020
@jzj
Copy link
Contributor Author

jzj commented Jan 15, 2020

@shivlaks I am done with the fix. Please let me know, if I missed anything or if adjustments are needed.

@mergify mergify bot closed this as completed in 667443c Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. in-progress This issue is being actively worked on. p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

3 participants