Skip to content

Config filename case insensitive #4452

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 2 commits into from
Mar 12, 2025

Conversation

arturcic
Copy link
Member

This PR fixes the they we look for a configuration filename on case sensitive file systems/oses

@Copilot Copilot AI review requested due to automatic review settings March 12, 2025 08:35
@arturcic arturcic changed the title Fix/config filename case insensitive Config filename case insensitive Mar 12, 2025
@arturcic arturcic added this to the 6.2.x milestone Mar 12, 2025
@arturcic arturcic added the bug label Mar 12, 2025
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 fixes the configuration filename lookup on case sensitive file systems by ensuring that file name comparisons are done in a case-insensitive manner.

  • Adds a new test to verify that configuration file lookup succeeds when file names differ only in case.
  • Refactors the SupportedConfigFileNames field and improves the candidate selection logic in GetConfigurationFile.

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

File Description
src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs Added a new test verifying that file lookup works regardless of filename casing.
src/GitVersion.Configuration/ConfigurationFileLocator.cs Rewritten candidate lookup and logging details; changed SupportedConfigFileNames field from public list to private readonly array.
Comments suppressed due to low confidence (1)

src/GitVersion.Configuration/ConfigurationFileLocator.cs:66

  • [nitpick] The debug message logs only the directory instead of the candidate file name being evaluated, which may reduce the clarity of log output during troubleshooting. Consider logging the candidate file name to improve debugging visibility.
this.log.Debug($"Configuration file not found at '{directory}'");

@arturcic arturcic force-pushed the fix/config-filename-case-insensitive branch from 035827e to 0388b70 Compare March 12, 2025 09:40
@arturcic arturcic requested a review from Copilot March 12, 2025 09:47
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 ensures that configuration filename lookup is case insensitive, preventing errors on case sensitive file systems.

  • Introduces a new test to verify that configuration files are detected regardless of casing.
  • Refactors candidate file lookup logic and logging in the configuration file locator.

Reviewed Changes

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

File Description
src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs Added a test case to ensure that configuration files differing only in casing are correctly detected.
src/GitVersion.Configuration/ConfigurationFileLocator.cs Updated candidate lookup logic and logging to perform a case insensitive search for configuration files.

@arturcic arturcic merged commit 22f553a into GitTools:main Mar 12, 2025
164 of 167 checks passed
@arturcic arturcic deleted the fix/config-filename-case-insensitive branch March 12, 2025 10:07
Copy link
Contributor

mergify bot commented Mar 12, 2025

Thank you @arturcic for your contribution!

@arturcic arturcic modified the milestones: 6.2.x, 6.2.0 Apr 1, 2025
@gittools-bot
Copy link

🎉 This issue has been resolved in version 6.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants