Skip to content

refactor: code improvements#156

Merged
xC0dex merged 3 commits into
mainfrom
refactor/improvements
Jun 2, 2026
Merged

refactor: code improvements#156
xC0dex merged 3 commits into
mainfrom
refactor/improvements

Conversation

@xC0dex

@xC0dex xC0dex commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

xC0dex added 2 commits June 2, 2026 19:02
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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 fetchWithRetry helper 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-preview is 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 ridruntimeIdentifier 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 *.

Comment thread src/utils/fetch-with-retry.ts Outdated
…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.
@xC0dex
xC0dex merged commit 44e3b97 into main Jun 2, 2026
38 of 43 checks passed
@xC0dex
xC0dex deleted the refactor/improvements branch June 2, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants