Feature/2165 interactive template variables#2179
Open
Paras14 wants to merge 2 commits into
Open
Conversation
Collaborator
Coverage Report for CI Build 29803149984Coverage decreased (-0.04%) to 72.439%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions144 previously-covered lines in 6 files lost coverage.
Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #2165
Implemented changes:
VariableSyntax.SQUAREto additionally match$[ask:VARIABLE]and$[secret:VARIABLE]expressions.IdeContext.askForSecretfor masked console input viaConsole.readPassword.conf/ide.propertiesso they are not asked again.configurator.adocand added tests inEnvironmentVariablesTest.As discussed with @hohwille, the prefix syntax encodes secret vs. plain in the name instead of using function arguments, which aligns it with the $[secret:name] syntax introduced by #2162. A future @function(args) syntax as proposed in #989 can be added as a further alternative in the same regex. Motivated by #412 to preconfigure AI assistant plugins with a backend URL and API key that must not be committed to the settings repository. See also #987.
Testing instructions
Tested on Windows using PowerShell. Strongly recommended to run an actual PowerShell window, as masking needs System.console(), which is null in IDE consoles and when input is piped, and there the input stays visible
with a warning by design.
Build the branch and dump the classpath, from the repository root:
In a test project create IDEasy\settings\workspace\update\ai-test.properties:
Make sure MY_URL and MY_TOKEN are not yet defined in IDEasy\conf\ide.properties.
From the project directory, run the local build:
You are prompted before any downloads: MY_URL with visible input,
MY_TOKEN with hidden(masked) input. Each prompt names the file requiring it.
with no $[...] left, and that both variables were written to
conf\ide.properties exactly as typed.
Run the same command again. You won't get any input prompts this time, the persisted values are reused.
Add MY_OTHER=https://example.com to conf\ide.properties, then add the line
ai.other=$[ask:MY_OTHER] to IDEasy\settings\workspace\update\ai-test.properties.
Run again. There is no prompt, and IDEasy\workspaces\main\ai-test.properties
contains ai.other=https://example.com.
Remove MY_URL and MY_TOKEN from IDEasy\conf\ide.properties and run with --batch.$[ask:...] and $ [secret:...]
No input prompts, but one warning per expression, and the
text is left untouched in the output.
Checklist for this PR
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»In Progressand assigned to you