-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add new form options with builder capabilities to Execution Environment webview #1796
base: main
Are you sure you want to change the base?
Conversation
"Create an Ansible execution environment", | ||
); | ||
|
||
await checkAndInteractWithEEField(eeWebview, "path-url", "~"); |
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.
This looks like it was accidentally reverted to ~
instead of os.homedir()
.
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.
A few things I noticed:
-
The
Build
button doesn't activate unless text is present in the destination path, though the destination path isn't listed as a required field (since the workspace folder should be used as the default path). -
Also, I received a JSON schema error when creating context or building the image when using any builder version earlier than 3.1.0, since tags were not supported before then. Should we have a check for that version?
Execution environment file created at /home/ali/code/vscode-extension/vscode-ansible/examples/
jsonschema.exceptions.ValidationError: Additional properties are not allowed ('tags' was unexpected)
-
I also think we need to disable the "Build" button while the EE builds, and maybe display a toast notification or log message indicating that the build is in process; otherwise from the user's perspective, nothing happened and they may try to reclick the button several times.
-
On the same log note, I regularly received an error message along with a successful build message. I think this may be caused by the context/ folder already being present and then using the form again with
Context
orBuild
selected. For example, I got:
---------------------------------------- Execution environment generation logs ---------------------------------------
Execution environment file created at /home/ali/code/vscode-extension/vscode-ansible/examples
Complete! The build context can be found at: /home/ali/code/vscode-extension/vscode-ansible/examples/context
Error occurred while running the command.
before(async () => { | ||
// Install ansible-creator | ||
await workbenchExecuteCommand("Install Ansible Content Creator"); | ||
await sleep(2000); | ||
}); |
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.
I believe this is causing the codecov project failure. Without this line, technically the "Install Ansible Content Creator" command is untested. I think including it in contentCreatorUITest is still the best spot at the moment, either in its own test section or in the before() section. Hopefully that will resolve the coverage failure.
Related JIRA - AAP-38336
Enhance Execution Environment Webview with New Form Options and Builder Capabilities without using ansible-creator command
Description
This PR updates the Execution Environment (EE) webview by introducing new form options with Builder capabilities. It creates an execution-environment.yml file without using
ansible-creator
command and it modifies the workflow to useansible-builder
commands, specifically,ansible-builder create
to generate the context andansible-builder build
to build the image after theexecution-environment.yml
file is created. Additionally, the implementation has been improved by structuring form data as JSON and converting it to YAML using thejs-yaml
package, eliminating the direct use ofansible-creator
. And it updates the webview form to usevscode-elements
instead ofvscode-webview-toolkit
UI.Features
1. New Form Options in VSCode EE Webview
The following options have been added to the Execution Environment form:
2. Leaving
ansible-creator
commandjs-yaml
package.ansible-builder create
command is used to generate the build context.ansible-builder build
command is executed after creating theexecution-environment.yml
file.3. UI Enhancement: Migration to
vscode-elements
vscode-elements
instead ofvscode-webview-toolkit
for improved compatibility and maintainability.4. Testing
This PR enhances the flexibility and usability of the Execution Environment webview while aligning with
vscode-elements
ui enhancement for best practices.