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 logging to the output #1381

Merged
merged 8 commits into from
Dec 10, 2024
Merged

Fix logging to the output #1381

merged 8 commits into from
Dec 10, 2024

Conversation

arturcic
Copy link
Member

Attempt to fix #1224 and #1224

Added logging and environment variable settings for tool installation paths to improve transparency and configuration management. Now, if a path is determined, it is appended to PATH and stored as an environment variable, ensuring smooth execution in diverse environments. The refactoring also clarifies variable naming for better code readability.
Consolidate error handling logic by introducing a new safeExecute utility function to manage task execution and streamline methods for setup, create, discard, close, open, publish, and addAsset functionalities. This refactoring reduces code duplication and enhances maintainability by standardizing success and failure messaging.
The changes move the GitVersion output processing into a separate method for improved readability and maintainability. This refactor helps isolate responsibilities within the code, making it easier to manage and understand the logic related to JSON parsing and result handling. The behavior of the code remains unchanged, ensuring that it still appropriately handles GitVersion's JSON output.
Introduced a new abstract `RunnerBase` class to standardize runner operations. Updated `Runner` classes to extend `RunnerBase`, reducing code duplication by utilizing common methods such as `safeExecute` and `disableTelemetry`. This refactoring enhances maintainability and readability across the runner implementations.
Renamed RunnerBase.ts to runner.ts for convention consistency. Enhanced error handling and logging by introducing tool-specific debug messages when actions fail. Refactored GitVersion tool execution methods to use safeExecute for improved error management.
Updated the `INPUT_VERSIONSPEC` from `6.x` to `6.0.x` in azure.env, local.env, and github.env to ensure precision in version selection. This change helps in avoiding unintended major version upgrades while maintaining minor updates within the 6.0 release series.
Include the '/l' and 'console' flags in the GitVersion tool execution arguments to enable logging to the console. Update corresponding test cases to reflect these new arguments ensuring the tool's behavior is accurately tested in different scenarios. This change will help in debugging by providing real-time feedback during the tool's execution.
@arturcic arturcic linked an issue Dec 10, 2024 that may be closed by this pull request
2 tasks
@arturcic arturcic merged commit b7154c3 into GitTools:main Dec 10, 2024
13 checks passed
Copy link
Contributor

mergify bot commented Dec 10, 2024

Thank you @arturcic for your contribution!

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