-
Notifications
You must be signed in to change notification settings - Fork 1k
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 Logging to Releasify #1432
base: master
Are you sure you want to change the base?
Add Logging to Releasify #1432
Conversation
The following refactor was brought about because we (Age Partnership) were running into difficulty using Squirrel in the Azure DevOps Build Pipelines and existing logging wasn't sufficient for our needs. I don't expect any functionality to have changed. The Releasify method in Update.exe has been broken up into; * ensureConsole * ReleasifyValidateBaseUrl * ReleasifyValidatePaths * ReleasifyPrepareFiles * ReleasifyProcessFiles * ReleasifyCleanupFiles * ReleasifyWriteReleaseFile * ReleasifyCreateSetupExe * ReleasifyGenerateMsi Breaking Releasify up into smaller methods allows stack traces to be more useful when identifying issues. The refactoring was done using ReSharper. Only significant change is the use of `out var` declarations and passing variables using `ref`. I expect a more significant refactor could make this cleaner. Debug logs have been added to the start of each method and the whole Releasify method is now in a "try / catch / log / throw" block.
I appreciate the concept but I'm not sure we've made the code Better here. So many variables are shared between all of these that R#'s result makes changing the code frustrating. An alternate approach would be to move many of these inner variables to instance fields, then try the R# Extract Method trick again |
Thanks. I wanted the most minimal diff possible so the meaning wasn't lost in the changes. Now that the meaning has gotten across I'll make a new changeset that is more considerate of code quality, number of arguments etc. |
@Horb You don't have to close this PR and resubmit a new one, just keep committing to this branch. |
This reverts commit d3b0deb.
Refactor to introduce instance variables is complete. I need to test to make sure I haven't broken anything. Once I've tested I'll report back here. |
@paulcbetts I think this is good to go now. Some variable names are no longer used and the name from command line parsing is used instead such as; signingOpts/signingParameters, package/target. |
Add Logging to Releasify
The following refactor was brought about because we (Age Partnership) were running into difficulty using Squirrel in the Azure DevOps Build Pipelines and existing logging wasn't sufficient for our needs.
I don't expect any functionality to have changed.
The Releasify method in Update.exe has been broken up into;
Breaking Releasify up into smaller methods allows stack traces to be more useful when identifying issues.
The refactoring was done using ReSharper. Only significant change is the use of
out var
declarations and passing variables usingref
. I expect a more significant refactor could make this cleaner. Debug logs have been added to the start of each method and the whole Releasify method is now in a "try / catch / log / throw" block.