refactor: code improvements#156
Merged
Merged
Conversation
test: enhance getDotNetDownloadInfo tests with abort signal verification refactor: improve environment configuration logic for DOTNET_ROOT/PATH refactor: standardize runtime identifier usage in getDotNetDownloadInfo feat: implement fetchWithRetry utility for robust network requests test: add comprehensive tests for fetchWithRetry utility test: enhance input-parser tests for edge cases and whitespace handling test: add output-formatter tests for version formatting and logging test: improve release-cache tests to handle network errors and caching logic refactor: utilize fetchWithRetry in release-cache for better error handling test: enhance sdk-runtime-mapper tests for network error handling test: extend version-resolver tests for version comparison and resolution logic
There was a problem hiding this comment.
Pull request overview
This PR refactors and hardens the Action’s .NET version resolution and metadata fetching by adding retry/timeout handling for network calls, improving prerelease-aware version comparison, and extending wildcard resolution to optionally include preview builds.
Changes:
- Added a shared
fetchWithRetryhelper and switched release-index / releases.json fetches to use it (with timeout + retry/backoff). - Improved wildcard resolution and version sorting to correctly handle prerelease versions when
allow-previewis enabled. - Expanded/adjusted test coverage (timers, retry behavior, prerelease ordering) and clarified input parsing/documentation.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/utils/versioning/version-resolver.ts | Uses fetchWithRetry, passes allowPreview into wildcard resolution, and upgrades compareVersions to SemVer prerelease ordering. |
| src/utils/versioning/version-resolver.test.ts | Adds prerelease comparison tests, wildcard+preview tests, and retry tests with fake timers. |
| src/utils/versioning/sdk-runtime-mapper.test.ts | Updates tests to reflect fetch now being called with an AbortController signal and retry timing. |
| src/utils/versioning/release-cache.ts | Uses fetchWithRetry and avoids caching rejected promises. |
| src/utils/versioning/release-cache.test.ts | Adds coverage ensuring failed fetches are not cached and that refetching occurs. |
| src/utils/output-formatter.test.ts | Adds unit tests for output formatting, grouping, logging, and outputs. |
| src/utils/input-parser.ts | Clarifies documentation about supported input forms (YAML bullet lines dropped). |
| src/utils/input-parser.test.ts | Adds edge-case coverage for whitespace-only/separator-only inputs and trimming behavior. |
| src/utils/fetch-with-retry.ts | Introduces the retry/timeout helper used by release metadata fetches. |
| src/utils/fetch-with-retry.test.ts | Adds unit tests for retry, status-based retry behavior, and timeout abort. |
| src/installer.ts | Improves environment setup comment and renames rid → runtimeIdentifier for clarity. |
| src/installer.test.ts | Updates expectations for fetch calls now including an AbortController signal. |
| knip.json | Removes the previously ignored dependency entry (empty ignore list). |
| CLAUDE.md | Documentation cleanup/formatting tweaks (paths, phrasing). |
| .claude/settings.json | Adds Claude permissions configuration for running pnpm *. |
…imeoutMilliseconds in fetch-with-retry utility - Updated the FetchWithRetryOptions interface to use backoffMilliseconds and timeoutMilliseconds for consistency. - Adjusted default values and internal references in the fetchWithRetry function to match the new naming convention. - Modified test cases to reflect the updated option names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.