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

fix(server): wash app delete command returns success for invalid application name #513

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

ffuerste
Copy link

Feature or Problem

If an incorrect model name is passed without a version to the wash app del <app_name> command, it still outputs a success message ("Deleted application: <app_name>") even though this app does not exist.

Related Issues

closes #502

Release Information

This PR fixes a non-critical issue. It can therefore be safely included in the next version.

Consumer Impact

This PR adapts the lookup logic for deletion requests, so that also for non-existing models a DeleteResult::Noop result is returned if no version is specified. This changes the current return value (which is DeleteResult::Deleted).

Currently, the documented and recommended way to delete applications is to use the wadm-client crate. The wadm-client create interprets both delete results as a success:

        match body.result {
            DeleteResult::Error => Err(ClientError::ApiError(body.message)),
            DeleteResult::Noop => Ok(false),
            DeleteResult::Deleted => Ok(true),
        }

The wash CLI uses the wadm-client crate internally and outputs based on the contained result value (true or false) different output messages.

Testing

Unit Test(s)

No unit tests have been added or updated.

Acceptance or Integration

An additional test case was added to the test_delete_noop integration test (covering the deletion of a non-existing model without specifying a version).

Florian Fürstenberg added 2 commits December 5, 2024 23:32
…was specified (wasmCloud#502)

Signed-off-by: Florian Fürstenberg <florian.fuerstenberg@posteo.de>
Signed-off-by: Florian Fürstenberg <florian.fuerstenberg@posteo.de>
@ffuerste ffuerste requested a review from a team as a code owner December 10, 2024 18:30
Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

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

Excellent work here @ffuerste. Thanks for the fix and additional test!

@thomastaylor312 thomastaylor312 enabled auto-merge (rebase) December 12, 2024 17:32
@thomastaylor312 thomastaylor312 merged commit c1db5ff into wasmCloud:main Dec 12, 2024
5 checks passed
@ffuerste ffuerste deleted the fix/delete-app branch December 13, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] wash app delete command returns success for invalid application name
2 participants