Repository navigation
git_utils: follow symlinked package dirs in get_file_commit_time - #153
Merged
Merged
Conversation
git tracks a symlinked package directory (staging/19/pkg -> ../_shared/pkg) as a blob, so 'git log -- staging/19/pkg/debian/changelog' matches nothing. get_file_commit_time returned None for every file reached through such a link and the FILE_MODIFY_DATE* macros fell back to the filesystem mtime, i.e. the CI checkout time. For moving-ref packages that are never skipped (staging:19 percona-pg_tde tracks main) this re-rendered debian/changelog with a fresh timestamp on every sync-main run, uploading a different debian.tar.gz and creating a new OBS revision plus rebuild each time. Replace symlinked components with their lexical target before calling git log, the same readlink+normpath approach _package_pathspecs uses. Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every sync-main run created a new OBS revision (and rebuild) for
ppg:staging:19/percona-pg_tde, e.g. r10 → r11 after #152 merged, and r8 → r9 earlier from the same main commit. Onlydebian.tar.gzdiffered, and the only diff inside it was thedebian/changelogtrailer date, which matched the CI checkout time of each run.%!{FILE_MODIFY_DATE_RFC5322}is resolved viaget_file_commit_time, which rangit log -- <path>with the path as seen through the package directory.staging/19/percona-pg_tdeis a symlink into_shared/, and git tracks a symlink as a blob, so a pathspec passing through it matches nothing. The helper returnedNoneand the macro fell back tostat().st_mtime.Only moving-ref packages showed it (staging:19 pg_tde tracks
main, so--skip-unchangednever skips it and the sources are re-rendered every run). Pinned_sharedpackages were affected more quietly: whenever they were promoted, the changelog carried the checkout time instead of the commit date.Fix
_git_tracked_pathinpercona_obs/git_utils.py: replaces each symlinked directory component with its lexical target (os.readlink+normpath, same approach as_package_pathspecs), staying inside the worktree's own path namespace.get_file_commit_timepasses that path togit log.Tests
tests/test_shared_source.py: commit time through the link equals the direct_shared/lookup; the rendered date macro ignores a bogus filesystem mtime. Both fail before the fix.Thu, 17 Sep 2026 11:49:54 +0000(author time of 73e0dde) instead of the checkout time.After merge
The next sync-main run uploads one more pg_tde revision (changelog date switches from checkout time to commit date); from then on unchanged moving-ref packages produce identical tarballs and no new revisions.