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

mmctl: Review unarchiveChannelsCmdF function to return an error in case of a failure #21212

Closed
mattermod opened this issue Oct 5, 2022 · 8 comments · Fixed by #26625
Closed

Comments

@mattermod
Copy link
Contributor

mattermod commented Oct 5, 2022

In the course of Hacktober 2022, we would like to review the return codes of the mmctl subcommands. It turns out that we have some subcommands that return 0 (successful return code) even if they fail. This is not a good practice and we should fix it. In this context, we would like to review unarchiveChannelsCmdF function and tailor a way to return a non-zero return code if the function fails. To be able to return a non-zero return code, it should be enough to return the error value from the handler. This effort should also include updating the test files for the command handler. The specific handler can be found in the file: https://github.com/mattermost/mmctl/blob/master/commands/channel.go

PS: You don't need to check errors for parsing the flags. The goal of this ticket is to pass error to the root handler so that we can have a non zero return code. If there are multiple errors can occur in a loop, please consider using multiError.Error to append the errors and return the error after the loop.


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-47348

@arcbjorn
Copy link

arcbjorn commented Oct 8, 2022

Hi! I'd like to work on it 🙂

@kurayami07734
Copy link

I want to work on this

@kurayami07734
Copy link

When does it not return error even if its failing?

@kurayami07734 kurayami07734 removed their assignment Oct 25, 2023
@lukas-mar
Copy link

hi, is this isssue still relevant? I would like to work on it

@hanzei
Copy link
Contributor

hanzei commented Jan 22, 2024

@lukas-mar Thanks for working on the ticket @lukas-mar 👍 Please let me know if you have any questions.

@hanzei
Copy link
Contributor

hanzei commented Mar 5, 2024

@lukas-mar Do you still want to work on the ticket?

@ezekielchow
Copy link
Contributor

Can I pick this up?

@hanzei
Copy link
Contributor

hanzei commented Mar 28, 2024

Sure think @ezekielchow 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants