question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preserve keyword replacement during export

See original GitHub issue

Description

Provide a clear and concise description of the issue, including what you expected to happen.

I am using the YAML version of the deploy CLI with variables replaced from a config.json. Here is an example snippet of variable usage in tenant.yaml:

...
resourceServers:
  - name: 'App ##ENVIRONMENT_NAME##'
     identifier: '##API_BASE_URL##'

I then have this config.json:

{
  ...
  "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
    "ENVIRONMENT_NAME": "dev",
    "API_BASE_URL": "https://dev.myapp.com"
  }
}

When I export, variable data in tenant.yaml is overwritten with the real values. Example:

a0deploy dump --format yaml --output_folder . --config_file ./config.json

This modifies tenant.yaml with real values:

...
resourceServers:
  - name: 'App dev'
     identifier: 'https://dev.myapp.com'

Preferably this would update my config.json with the real values being exported.

Reproduction

Use environment variables in tenant.yaml or other files, these variables are incorrectly modified when exporting an Auth0 tenant.

Environment

  • Version of this library used: 5.5.3
  • Version of the platform or framework used, if applicable: NPM 7.6.0, Node 15.11.0
  • Other relevant versions (language, server software, OS, browser): OSX
  • Other modules/plugins/libraries that might be involved:

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:15
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
DanoThomcommented, Dec 1, 2021

I have to say I was really scratching my head around this whole issue when first testing this flow. Since using variable substitution in the template file seems to be the ENTIRE POINT of using this tool, I just can’t understand how this hasn’t been addressed anywhere?!

At the moment it seems I have to export, and then manually diff against the file in my source control and hopefully successfully manage to move over and update anything that has changed. What’s going on here?

3reactions
willveddcommented, Aug 30, 2022

I want to reassure everyone that this is still on our radar. We have an initiative documented and on our backlog with a tentative slotting for either this upcoming quarter or the next. Not discounting the impact of this ask, but IMO, #70 is a higher-impact feature, so that gets priority. The intention is to have this worked on almost immediately after.

Though I’d like to mention that I’m not sure if preserving variable substitutions is even possible. Sure, you could maybe implement some type of a state file, but that goes against the stateless spirit of this project. You could perform some type of lookup on resource configuration files and dynamically replace keyword values with their keys, but that could unleash a whole set of unsolvable consequences. At best, we would need to apply dynamic replacement policies on a per-resource basis, which is a decent undertaking and still may never be perfect.

All of this to say that this hasn’t been forgotten about, we’re thinking about solutions and you can expect some type of verdict sometime after #70 gets addressed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

P: Export As - options to preserve the metadata in... - Page 2
In Photoshop, when you go to Export, Export As, and choose a jpeg, it says you can include the copyright and contact info,...
Read more >
Export ads as expanded text ads or responsive ads
Save the file using a new name. In the Google Ads Editor account manager, select the account where you'd like to import the...
Read more >
Is it possible to turn off keyword substitution for 'svn export'?
I would like to use svn export to export a bunch of files out of a Subversion repository. And I also wish to...
Read more >
Export Content search results - Microsoft Purview (compliance)
If you're exporting mailbox items from a content search that returns all mailbox items in the search results (because no keywords where included ......
Read more >
Exporting a model to a Python script—Help | ArcGIS for Desktop
Legacy: · From the menu in ModelBuilder, point to and click Model > Export > To Python Script. · Click the Save in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found