-
Notifications
You must be signed in to change notification settings - Fork 3
feat: fixed the issue where unmapped action input params show up as literal placeholders #154
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
Conversation
…iteral placeholders
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 647 649 +2
Branches 132 133 +1
=========================================
+ Hits 647 649 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
It is completely valid to send an input of "{THIRD_INPUT}" to an action, the fact that it looks like something that should be replaced does not mean we can simply make it an empty string. This also applies to much more than just the dev command ... |
Case 1: If you want to send the EXACT string "{MY_VAR}" or "$MY_VAR" (or any string containing these) to your action: Case 2: If the intention is to use an actual environment variable (For example: if you want $MY_ENV_VAR to be replaced by the value of the MY_ENV_VAR .env variable), then you'd write something like this (unquoted within the value string) All this fix does is, if it sees "bare"( or above pattern) placeholders @purplecabbage if you think that the the original issue is not a bug, we can leave a comment in there close it as not a bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR resolves the bug where unmapped action input parameters were injected as literal placeholders in the environment by modifying the interpolation logic.
- Updated the test expectation in run-dev.test.js to expect an empty string when the property is missing.
- Modified the interpolate function in run-dev.js to check for the existence of the property and return an empty string if it does not exist.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/lib/run-dev.test.js | Updated expected output for unmapped parameters to return an empty string. |
| src/lib/run-dev.js | Refactored the interpolate function to return an empty string for unmapped variables. |
I misunderstood ... ignore this |
Description
It turns out that during aio app dev, any input param whose value is left as literal placeholders like for example
$<MY_FIRSTINPUT>ends up being injected verbatim in the environment instead of being skipped if it is not mapped in the process envFix:
To align with the expectation that an undefined env variable should result in a empty string for the action input, the
interpolatefunction was modified so that the it would now check if the property exists in the process.env and if not, it returns an empty stringRelated Issue
ACNA-3846
Original git hub issue here
Motivation and Context
It turns out that during aio app dev, any input param whose value is left as literal placeholders like for example
${FIRST_INPUT}, $SECOND_INPUT, or {THIRD_INPUT}end up being injected verbatim in the environment instead of being skipped if it is not mapped in the process envHow Has This Been Tested?
aio plugins link .Screenshots (if appropriate):
Types of changes
Checklist: