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

Default Keyword Replacement Mapping Feature #42

Merged
merged 10 commits into from
May 2, 2023

Conversation

NotMyself
Copy link
Contributor

@NotMyself NotMyself commented Apr 28, 2023

Description

This PR addresses a number of feature requests for running samples in GitHub Codespaces and advanced configuration use cases.

Fixes #45
Fixes #44
Fixes #43

Testing

To test this change, you will need to run a lab in codespaces with a custom build of the extension.

  1. open a lab repository in codespaces.
  2. uninstall the auth0 labs extension from the running codespace
  3. download the custom build associated with the pull request
  4. uncompress the zip archive to gain access to the release.vsix file
  5. on the extension pane, select the ... menu and select Install from VSIX
  6. click the show local button
  7. select the release.vsix

You now have a custom install of the extension running in codespaces.

Default Keyword Replacement Mapping

Update the tenant.yml for the lab to include the keyword replacements for AUTH0_DOMAIN and CODESPACE_NAME. Sign in to a tenant and click the configure button when prompted.

The deploy should be successful and you should see the appropriate values in your tenant and associated .env files.

Post Configuration Script

Update the environment.json for the lab to include a reference to a shell script. Create the shell script and echo out the values for AUTH0_DOMAIN and AUTH0_TOKEN.

Run the configure command and verify values are printed to console output.

Multiple Writes to Same .env File

Update the environment.josn for the lab to write two or more clients to the same directory.

Run the configure command and verify that all values are written to the .env file with no duplication.

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@NotMyself NotMyself changed the title adding auth0 domain and codespace name to default keyword replacement mappings Default Keyword Replacement Mapping Feature Apr 28, 2023
@NotMyself NotMyself marked this pull request as ready for review April 28, 2023 20:01
@jesposito
Copy link
Contributor

I've tested and everything appears to work well. I think we should wait and have Sara do a run-through as well just to be certain. Thanks Bobby!

@NotMyself
Copy link
Contributor Author

That works for me. I have not done the release prep yet. Maybe @kazemicode can do it once she has reviewed for the practice on releasing.

@kazemicode
Copy link
Contributor

@NotMyself Tested and can confirm the fixes for #45 works as expected.

For #43, it only works as expected if there's already existing data in .env to append to. However, if you are starting fresh and there are two app configs in environment.json, the first app's variables seem to get overwritten by the second. If I rerun the config, then I see the first app's variables get appended after the second app's in the .env.

Regarding #44, I don't see any evidence of the shell script executing after creating one and adding the path to postConfigureCommand in environment.json. This was tested in both Codespaces and locally. When I manually executed my shell script (in Codespaces I had to chmod +x first), there didn't seem to be values for $AUTH0_TENANT or $AUTH0_TOKEN, but $CODESPACE_NAME existed.

@NotMyself
Copy link
Contributor Author

@kazemicode thanks for the review! While I was waiting for the first fix to get approved... I was implementing fixes for other things... So #43 should be working now and I am working on #44 right now. I'll let you know when they are ready.

@NotMyself
Copy link
Contributor Author

@jesposito @kazemicode all three fixes are now in. We have verified they work for us in our use case. Just need confirmation that we didn't break labs... and you all approve. Then we can ship a new version with killer new features.

Copy link
Contributor

@kazemicode kazemicode left a comment

Choose a reason for hiding this comment

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

Tested and confirmed the changes fix #43 #44 and #45 without introducing bugs to existing labs.

@kazemicode kazemicode merged commit 24d66e7 into main May 2, 2023
3 checks passed
@kazemicode kazemicode deleted the feat/keyword-replacement-mappings branch May 23, 2023 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants