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

The Great Bug Bash of 2024 07! #2203

Merged
merged 9 commits into from
Jul 24, 2024
Merged

The Great Bug Bash of 2024 07! #2203

merged 9 commits into from
Jul 24, 2024

Conversation

MrHinsh
Copy link
Member

@MrHinsh MrHinsh commented Jul 24, 2024

No description provided.

MrHinsh added 4 commits July 24, 2024 15:16
…ation client

🐛 (WorkItemMigrationContext.cs): replace exceptions with log errors and exit for better error handling

Add handling for `TeamFoundationServerUnauthorizedException` to log an error and exit the application when unauthorized access is detected. This ensures that the application does not continue running with invalid permissions.

Replace `throw` statements with `Log.LogError` and `Environment.Exit(-1)` in `WorkItemMigrationContext.cs` to provide clearer error messages and halt execution when critical configuration issues are detected. This change improves the robustness of the application by preventing it from running in an invalid state.
…🐛 (TfsWorkItemQuery.cs): add handling for ValidationException in GetWorkItemsFromQuery method

Add a catch block for ValidationException to handle specific validation errors during the execution of the GetWorkItemsFromQuery method. This ensures that validation errors are logged and tracked correctly, and the application exits gracefully with an error code. This change improves error handling and provides better diagnostics for validation issues.
…kItemId field in target work item and log error if missing

Ensure that the target work item contains the ReflectedWorkItemId field before proceeding. If the field is missing, log an error and exit the application. This change prevents potential runtime errors and ensures data integrity during the migration process.
…surements before iterating

Add null checks to prevent potential null reference exceptions when properties or measurements are null. This ensures the application does not crash and handles the absence of these collections gracefully.
@MrHinsh MrHinsh marked this pull request as ready for review July 24, 2024 14:39
MrHinsh added 4 commits July 24, 2024 15:41
…ronment.Exit for critical errors

Replace `throw ex` with `Environment.Exit(-1)` to ensure the application exits immediately on critical errors. This change prevents the application from continuing in an unstable state when essential conditions are not met, such as missing WorkItemTypes or PersonalAccessToken.
…better error tracking

Include the project name and work item ID in the telemetry data to enhance error tracking and debugging. This provides more context when exceptions occur, making it easier to identify and resolve issues.
…t(-1) in error handling

Replacing `throw` with `Environment.Exit(-1)` ensures that the application exits immediately when an error occurs while getting a work item. This change is made to prevent the application from continuing in an unstable state after encountering a critical error.
…rdize version retrieval

♻️ (TelemetryClientAdapter.cs): refactor version retrieval to use GetRunningVersion method

Introduce a new method, GetRunningVersion, to standardize the retrieval of the application's version information. This method uses regex to parse the version string and returns a tuple containing the version, pre-release label, and formatted version string. Refactor existing code to use this new method, improving maintainability and consistency in version handling.
@MrHinsh MrHinsh enabled auto-merge July 24, 2024 14:53
…revent potential uninitialized variable usage

♻️ (TelemetryClientAdapter.cs): remove redundant 'v' prefix from textVersion for consistency

Initializing `WorkItem y` to null ensures that the variable is not used uninitialized, which can prevent potential runtime errors. Removing the redundant 'v' prefix from `textVersion` in `TelemetryClientAdapter.cs` aligns the version string format with standard versioning practices, improving consistency and readability.
@MrHinsh MrHinsh merged commit d10bad5 into main Jul 24, 2024
9 checks passed
@MrHinsh MrHinsh deleted the topic/-bugbash-20240724 branch July 24, 2024 15:56
@MrHinsh MrHinsh added the bug label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant