Skip to content

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Aug 2, 2025

closes #952

@caarlos0 caarlos0 self-assigned this Aug 2, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 2, 2025
Copy link

cloudflare-workers-and-pages bot commented Aug 2, 2025

Deploying nfpm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3fbb22a
Status: ✅  Deploy successful!
Preview URL: https://5172e764.nfpm.pages.dev
Branch Preview URL: https://issue-952.nfpm.pages.dev

View logs

Copy link

codecov bot commented Aug 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.41%. Comparing base (b2a1c0e) to head (3fbb22a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #955      +/-   ##
==========================================
+ Coverage   69.39%   69.41%   +0.01%     
==========================================
  Files          22       22              
  Lines        3140     3142       +2     
==========================================
+ Hits         2179     2181       +2     
  Misses        747      747              
  Partials      214      214              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caarlos0 caarlos0 requested a review from Copilot August 2, 2025 16:15
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 an issue with symlinks that have empty modification times (mtime). The fix ensures that when a symlink's mtime is zero and the file cannot be stat'd (e.g., because it doesn't exist), the system uses the current time instead of leaving the mtime as zero.

  • Modified the mtime handling logic to check both if the mtime is zero AND if the source file's mtime is non-zero
  • Changed fallback behavior to use time.Now() instead of the passed mtime parameter when no valid mtime is available
  • Added comprehensive test coverage for the symlink scenario in both files and rpm modules

Reviewed Changes

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

File Description
files/files.go Updated mtime handling logic to properly handle symlinks with non-existent targets
files/files_test.go Added test case to verify symlink mtime handling behavior
rpm/rpm_test.go Added integration test to verify RPM packaging works correctly with symlinks having empty mtime

@caarlos0 caarlos0 merged commit 0b3c28f into main Aug 6, 2025
49 checks passed
@caarlos0 caarlos0 deleted the issue-952 branch August 6, 2025 05:31
@github-actions github-actions bot added this to the 2.38.0 milestone Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symlink Has Negative Timestamp Causing Future-Dated Files on RPM Install
1 participant