8000 Normalizes target path in dotnet tool by arturcic · Pull Request #1554 · GitTools/actions · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Normalizes target path in dot 10000 net tool #1554

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

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

arturcic
Copy link
Member
@arturcic arturcic commented Apr 2, 2025

Ensures the target path for dotnet tools is properly normalized.

  • Adds targetPath to GitVersion command tasks in CI workflow
  • Resolves relative paths to absolute paths
  • Normalizes the directory separator for consistency.

This prevents issues caused by inconsistent path formats, especially on different operating systems.

Ensures the target path for dotnet tools is properly normalized.

- Adds `targetPath` to GitVersion command tasks in CI workflow
- Resolves relative paths to absolute paths
- Normalizes the directory separator for consistency.

This prevents issues caused by inconsistent path formats,
especially on different operating systems.
@arturcic arturcic added the bug Something isn't working label Apr 2, 2025
@arturcic arturcic added this to the v3.2.x milestone Apr 2, 2025
@arturcic arturcic requested a review from Copilot April 2, 2025 00:31
Copy link
@Copilot Copilot AI left a comment

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 addresses inconsistent target path formats in dotnet tools by resolving relative paths to absolute ones and normalizing directory separators. Key changes include:

  • Updating DotnetTool to resolve and normalize target paths using path.resolve and path.normalize.
  • Adjusting tests in dotnet-tool, GitVersion, and GitReleaseManager suites to reflect the new target path handling.
  • Updating CI workflow configurations to supply an explicit targetPath.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tools/common/dotnet-tool.ts Updated target path resolution and normalization logic.
src/tests/tools/gitversion/tool.spec.ts Removed tests for getRepoDir; test updates focus on execute arguments.
src/tests/tools/gitversion/runner.spec.ts Modified test description to reflect expected output variable change.
src/tests/tools/gitreleasemanager/tool.spec.ts Updated targetDirectory normalization in multiple argument-building tests.
src/tests/tools/common/dotnet-tool.spec.ts Added tests for new getRepoPath behavior including relative and absolute paths.
.github/workflows/ci.yml Included explicit targetPath inputs for gitversion commands.
Comments suppressed due to low confidence (4)

src/tools/common/dotnet-tool.ts:228

  • [nitpick] Using path.normalize may not enforce forward slashes consistently across operating systems; if a uniform forward slash format is intended, consider using path.posix.normalize or an alternative approach to ensure consistency.
return path.normalize(workDir)

src/tests/tools/gitversion/runner.spec.ts:87

  • [nitpick] The updated test description should be reviewed to ensure it accurately reflects the intended output; please confirm that changing from 'Major variable' to 'Sha variable' is correct.
it.sequential('should output Sha variable', async () => {

src/tests/tools/gitversion/tool.spec.ts:112

  • Removal of getRepoDir tests may reduce coverage for target path normalization behavior; consider reintroducing tests to verify the expected functionality.
describe('getRepoDir', () => { ... removed tests ...

src/tests/tools/gitreleasemanager/tool.spec.ts:79

  • The removal of getRepoDir tests decreases test coverage for the new normalized path behavior; adding tests to cover correct path resolution and error handling is recommended.
describe('getRepoDir', () => { ... removed tests ...

@arturcic arturcic merged commit 0a21874 into GitTools:main Apr 2, 2025
9 checks passed
@arturcic arturcic deleted the fix/use-absolute-target-path branch April 2, 2025 00:39
Copy link
Contributor
mergify bot commented Apr 2, 2025

Thank you @arturcic for your contribution!

@gittools-bot
Copy link

🎉 This issue has been resolved in version v3.2.0 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0