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

refactor: warn, exit and error utils from oclif command class #3028

Closed

Conversation

tinfoil-knight
Copy link
Contributor

@tinfoil-knight tinfoil-knight commented Jul 28, 2021

- Summary

Ref: #2728

Some logging and process control utilities (log, warn,exit, error) were being passed down to each method and helper functions which isn't ideal. Thus, log was refactored in #2827 & warn, exit & error have been refactored in this PR.

The utilities have been referenced from the @oclif/command package to not break any existing functionality. They are present in the src/utils/command-helpers.js file.

- Test plan

npx ava --verbose --serial

@tinfoil-knight tinfoil-knight changed the title (WIP) refactor: warn, exit and error utils from oclif command class refactor: warn, exit and error utils from oclif command class Jul 28, 2021
@erezrokah erezrokah added the type: chore work needed to keep the product and development running smoothly label Jul 28, 2021
@tinfoil-knight
Copy link
Contributor Author

@erezrokah Please review the PR.

@erezrokah
Copy link
Contributor

@erezrokah Please review the PR.

Hi @tinfoil-knight, sorry for the delay. The approach for creating these utilities is nice! The only concern is for them to change in the base class, so our implementation will drift. However I don't think it happens very often (without it being a breaking change).

Since this PR touches many files, it will take some time to review as I would like to invoke each code flow to make sure the change works (not all flows are covered by tests).

@tinfoil-knight
Copy link
Contributor Author

tinfoil-knight commented Aug 2, 2021

Hi @tinfoil-knight, sorry for the delay. The approach for creating these utilities is nice! The only concern is for them to change in the base class, so our implementation will drift. However I don't think it happens very often (without it being a breaking change).

Since this PR touches many files, it will take some time to review as I would like to invoke each code flow to make sure the change works (not all flows are covered by tests).

That sounds reasonable.

Thank you for the response.

@erezrokah
Copy link
Contributor

@tinfoil-knight, sorry for the delay to review this.
I was thinking of a way we can move forward and reduce the risk.
How about we break this PR into an initial PR that just adds the utility methods? Basically just this change

Then we can gradually introduce the usage of those methods into different areas of the codebase, and we won't need to keep this PR up to date with other changes.
That way we could also test each specific change separately.

Please let me know what you think

@tinfoil-knight
Copy link
Contributor Author

tinfoil-knight commented Aug 16, 2021

@tinfoil-knight, sorry for the delay to review this.

Don't worry about it.

How about we break this PR into an initial PR that just adds the utility methods? Basically just this change
Then we can gradually introduce the usage of those methods into different areas of the codebase, and we won't need to keep this PR up to date with other changes.

Yeah. That seems like a good idea. I'll pick this and the other sub-PRs up then in some time.

P.S. Although, unless it's a substantial testing/review issue, I can keep the PR up to date every few days until you can review it.

@tinfoil-knight
Copy link
Contributor Author

Started with #3247

@tinfoil-knight
Copy link
Contributor Author

tinfoil-knight commented Sep 16, 2021

Continuing with #3346 & #3347

Apologies for the late PR. Was bogged down with college work.

@ehmicky
Copy link
Contributor

ehmicky commented Sep 16, 2021

The apology is on our side @tinfoil-knight for the delay reviewing your contribution. Thanks a lot for doing all of this! ❤️

Also, college work always prevails! :)

Erez is on PTO so I'm going to help with reviewing your awesome contribution (which I find very helpful!). If you want to keep breaking this down into separate PRs, I'll make sure to review each of them as soon as possible. 👍

@ehmicky ehmicky self-requested a review September 16, 2021 15:27
@tinfoil-knight
Copy link
Contributor Author

tinfoil-knight commented Sep 16, 2021

Thank you a lot.

@tinfoil-knight
Copy link
Contributor Author

Closing this since the work has been done in the referenced PRs. @ehmicky issue #2728 can also be closed now.

@tinfoil-knight tinfoil-knight deleted the 2728-refactor-logging branch September 24, 2021 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants