Skip to content

Honor tag creation date#3916

Open
clintonsteiner wants to merge 3 commits intojenkinsci:masterfrom
clintonsteiner:fixTagTimeStampNotHonored2
Open

Honor tag creation date#3916
clintonsteiner wants to merge 3 commits intojenkinsci:masterfrom
clintonsteiner:fixTagTimeStampNotHonored2

Conversation

@clintonsteiner
Copy link

@clintonsteiner clintonsteiner commented Jan 23, 2026

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

* "Ignore tags older than" field was using the commit creation
  date rather than the tag creation date.
* Change correctly distinguishes between:
    - Annotated tags → Uses tag creation time (fixes the bug)
    - Lightweight tags → Uses commit time (backward compatible)
This enables the "Ignore tags older than" feature to work correctly when new tags are created on old commits.
Fixes:
* jenkinsci#3731
* jenkinsci/basic-branch-build-strategies-plugin#268
@clintonsteiner clintonsteiner requested a review from a team as a code owner January 23, 2026 03:06
@github-actions github-actions bot added the tests Automated test addition or improvement label Jan 23, 2026
@MarkEWaite MarkEWaite requested a review from Copilot January 23, 2026 03:28
Copy link

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 a bug where the "Ignore tags older than" feature was incorrectly using commit creation dates instead of tag creation dates for annotated tags. The fix introduces a new getTagTimestamp() method that properly distinguishes between annotated tags (which should use their tag creation timestamp) and lightweight tags (which should use their commit timestamp).

Changes:

  • Added getTagTimestamp() method to properly extract timestamps from both annotated and lightweight tags
  • Updated three call sites to use the new method instead of directly accessing commit timestamps
  • Added a test to verify that tag timestamps are valid (greater than year 2000)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java Implements the new getTagTimestamp() method and updates three locations to use it instead of directly parsing commit timestamps
src/test/java/jenkins/plugins/git/AbstractGitSCMSourceWantTagsTest.java Adds basic test for tag timestamp validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MarkEWaite MarkEWaite added the bug Incorrect or flawed behavior label Jan 25, 2026
@MarkEWaite MarkEWaite changed the title Honor tag creation date properly Honor tag creation date Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Incorrect or flawed behavior tests Automated test addition or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants