Skip to content

feat(version): add file replacement variant for version_variables#1391

Merged
codejedi365 merged 4 commits intomasterfrom
copilot/add-variant-version-variables
Jan 6, 2026
Merged

feat(version): add file replacement variant for version_variables#1391
codejedi365 merged 4 commits intomasterfrom
copilot/add-variant-version-variables

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

  • Identify Windows CI failure in file replacement feature
  • Fix line ending issue causing test failures on Windows
  • Update tests to expect platform-independent line endings
  • Run unit and e2e tests to validate fix

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add feature for variant version variables in PSR feat(version): add file replacement variant for version_variables Dec 12, 2025
Copilot AI requested a review from codejedi365 December 12, 2025 08:31
@codejedi365 codejedi365 force-pushed the copilot/add-variant-version-variables branch from 1b83911 to 5fe054a Compare December 14, 2025 02:34
@codejedi365 codejedi365 marked this pull request as ready for review December 14, 2025 02:37
@codejedi365 codejedi365 force-pushed the copilot/add-variant-version-variables branch from 5fe054a to ae1ebf5 Compare December 14, 2025 21:50
@codejedi365 codejedi365 force-pushed the copilot/add-variant-version-variables branch 2 times, most recently from fd1ba55 to 295d077 Compare January 5, 2026 08:30
@codejedi365 codejedi365 force-pushed the copilot/add-variant-version-variables branch from 1bdfe4b to ff7eae9 Compare January 5, 2026 09:11
@codejedi365
Copy link
Contributor

@copilot, can you review the error we are getting on Windows in GitHub Actions for this PR and figure out what to change to correct the issue?

Copy link
Contributor Author

Copilot AI commented Jan 5, 2026

@copilot, can you review the error we are getting on Windows in GitHub Actions for this PR and figure out what to change to correct the issue?

Fixed in edfc2f5. The issue was with line ending handling on Windows.

The problem: The code was using os.linesep (which is \r\n on Windows) when writing to files. However, Python's write_text() in text mode automatically converts \n to \r\n on Windows, causing a double conversion: \r\n\r\r\n.

The fix: Changed to use \n instead of os.linesep and let Python's text mode handle platform-specific line ending conversion automatically. This ensures files are written correctly on all platforms.

Updated both the implementation and tests to use platform-independent \n, which Python's text mode will convert to the appropriate platform line ending when writing and normalize back to \n when reading.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/python-semantic-release/python-semantic-release/actions/jobs/59449841853/logs
    • Triggering command: /usr/bin/curl curl -s -H Accept: application/vnd.github+json REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from codejedi365 January 5, 2026 09:43
@codejedi365 codejedi365 force-pushed the copilot/add-variant-version-variables branch from edfc2f5 to 82908ec Compare January 6, 2026 02:51
codejedi365 and others added 4 commits January 5, 2026 19:58
Add support for entire file replacement when pattern is specified as `*`.
This allows users to configure version stamping for files that contain
only a version number (e.g., VERSION files).

Configuration examples:
- `src/VERSION:*:nf` - Replace entire file with numeric version
- `src/VERSION:*:tf` - Replace entire file with tag version

Implements: #1375

Co-authored-by: codejedi365 <17354856+codejedi365@users.noreply.github.com>
@codejedi365 codejedi365 force-pushed the copilot/add-variant-version-variables branch from 82908ec to 642f2d6 Compare January 6, 2026 03:02
@codejedi365 codejedi365 merged commit 95ce7ec into master Jan 6, 2026
9 checks passed
@codejedi365 codejedi365 deleted the copilot/add-variant-version-variables branch January 6, 2026 05:49
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