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

Replace force param with overwrite in creator webviews #1663

Merged
merged 11 commits into from
Nov 22, 2024

Conversation

tanwigeetika1618
Copy link
Contributor

@tanwigeetika1618 tanwigeetika1618 commented Nov 19, 2024

JIRA : https://issues.redhat.com/browse/AAP-36015

Replace force Parameter with overwrite in Webview Extension

This PR updates the webview in the vscode-ansible extension to replace the deprecated force parameter with the overwrite parameter. The changes include:

Webview and UI Updates

  1. Replaced force Parameter with overwrite:

    • Updated the webview checkbox label and description in the webview UI.
  2. Improved UI Tests:

    • Added tests for the "Create New Collection" feature.
    • Refactored tests for playbook and collection creation using a shared testWebViewElements function.

Backend Updates

  1. Introduced getCreatorVersion:

    • Centralized logic to retrieve the ansible-creator version for reuse in getCreatorCommand and runInitCommand.
  2. Updated Command Logic:

    • Appends --overwrite for versions >= 24.10.0 and --force for older versions.
    • Dynamically applied based on the "Overwrite" checkbox in the UI.

Benefits

  • Ensures backward compatibility with older ansible-creator versions.
  • Simplifies test maintenance by reducing duplication.
  • Improves test coverage for key webview functionalities.

@alisonlhart
Copy link
Contributor

Moving back to draft - there's an issue with versions of creator using --overwrite before 24.10.0.

Copy link
Contributor

@alisonlhart alisonlhart left a comment

Choose a reason for hiding this comment

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

(see above comment)

@alisonlhart alisonlhart marked this pull request as draft November 21, 2024 21:45
@alisonlhart alisonlhart marked this pull request as ready for review November 22, 2024 15:49
@alisonlhart
Copy link
Contributor

Approved and ready for merge!

@alisonlhart alisonlhart changed the title Replace force param to overwrite in extension webview Replace force param with overwrite in creator webviews Nov 22, 2024
@alisonlhart alisonlhart merged commit 8e5d733 into ansible:main Nov 22, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants