Skip to content
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

BitbucketTagSCMHead does not receive an annotated tag date #991

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

nfalco79
Copy link
Member

Fix the timestamp in BitbucketTagSCMHead valued with 0 in NativeServer webhook processor instead of the annotated tag timestamp or using the referred commit timestamp.

This is archived perforing a remote call to get missing details in the event payload, unfortunately there are no real example to implement a different strategy.

Fix #642

@nfalco79 nfalco79 added the bug label Feb 15, 2025
@nfalco79 nfalco79 force-pushed the feature/datacenter-tag-timestamp branch from 85935c8 to e1ac0b1 Compare February 16, 2025 08:49
…r webhook processor instead of the annotated tag timestamp or using the referred commit timestamp.

This is archived perforing a remote call to get missing details in the event payload, unfortunately there are no real example to implement a different strategy.
@nfalco79 nfalco79 force-pushed the feature/datacenter-tag-timestamp branch from e1ac0b1 to 8acf56f Compare February 16, 2025 10:48
@@ -80,6 +85,27 @@
.isEqualTo(new BranchSCMHead("main"));
}

@WithJenkins
@Test
void test_tag_timestamp(JenkinsRule rule) throws Exception {

Check notice

Code scanning / CodeQL

Useless parameter Note test

The parameter 'rule' is never used.

Copilot Autofix

AI about 2 months ago

To fix the problem, we should remove the unused parameter JenkinsRule rule from the test_tag_timestamp method. This will simplify the method signature and eliminate the unnecessary parameter, adhering to best practices.

  • Remove the JenkinsRule rule parameter from the test_tag_timestamp method.
  • Ensure that the method still functions correctly without this parameter.
Suggested changeset 1
src/test/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPushHookProcessorTest.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPushHookProcessorTest.java b/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPushHookProcessorTest.java
--- a/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPushHookProcessorTest.java
+++ b/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPushHookProcessorTest.java
@@ -89,3 +89,3 @@
     @Test
-    void test_tag_timestamp(JenkinsRule rule) throws Exception {
+    void test_tag_timestamp() throws Exception {
         sut.process(HookEventType.SERVER_REFS_CHANGED, loadResource("native/tagPayload.json"), BitbucketType.SERVER, "origin", SERVER_URL);
EOF
@@ -89,3 +89,3 @@
@Test
void test_tag_timestamp(JenkinsRule rule) throws Exception {
void test_tag_timestamp() throws Exception {
sut.process(HookEventType.SERVER_REFS_CHANGED, loadResource("native/tagPayload.json"), BitbucketType.SERVER, "origin", SERVER_URL);
Copilot is powered by AI and may make mistakes. Always verify output.
@nfalco79 nfalco79 merged commit 156beeb into master Feb 16, 2025
19 checks passed
@nfalco79 nfalco79 deleted the feature/datacenter-tag-timestamp branch February 16, 2025 11:54
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.

BitbucketTagSCMHead does not receive an annotated tag date
1 participant