From a5eab077ab0298865fb71ef5313b06a8b8bef689 Mon Sep 17 00:00:00 2001 From: Guillaume Lecerf Date: Thu, 6 Jun 2019 16:55:49 +0200 Subject: [PATCH] Do not apply include/exclude restrictions to tags (#103) The UI does not make it clear that the include/exclude restrictions also apply to tags. If we set include to a specific branch, it breaks tag discovery. To be consistent with the UI, do not apply these restrictions on tags. --- .../gitlab_branch_source/SourceHeads.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main/java/argelbargel/jenkins/plugins/gitlab_branch_source/SourceHeads.java b/src/main/java/argelbargel/jenkins/plugins/gitlab_branch_source/SourceHeads.java index 93a4372..4d3d30b 100644 --- a/src/main/java/argelbargel/jenkins/plugins/gitlab_branch_source/SourceHeads.java +++ b/src/main/java/argelbargel/jenkins/plugins/gitlab_branch_source/SourceHeads.java @@ -146,15 +146,13 @@ private void retrieveTag(SCMSourceCriteria criteria, @Nonnull SCMHeadObserver ob } private void retrieveTag(SCMSourceCriteria criteria, @Nonnull SCMHeadObserver observer, String tagName, @Nonnull TaskListener listener) throws IOException, InterruptedException { - if (!source.isExcluded(tagName)) { - log(listener, Messages.GitLabSCMSource_retrievingTag(tagName)); - try { - GitlabTag tag = api().getTag(source.getProjectId(), tagName); - tag.getCommit().getCommittedDate().getTime(); - observe(criteria, observer, tag, listener); - } catch (NoSuchElementException e) { - log(listener, Messages.GitLabSCMSource_removedHead(tagName)); - } + log(listener, Messages.GitLabSCMSource_retrievingTag(tagName)); + try { + GitlabTag tag = api().getTag(source.getProjectId(), tagName); + tag.getCommit().getCommittedDate().getTime(); + observe(criteria, observer, tag, listener); + } catch (NoSuchElementException e) { + log(listener, Messages.GitLabSCMSource_removedHead(tagName)); } } @@ -202,9 +200,7 @@ private void retrieveTags(@CheckForNull SCMSourceCriteria criteria, @Nonnull SCM for (GitlabTag tag : api().getTags(source.getProjectId())) { checkInterrupt(); - if (!source.isExcluded(tag.getName())) { - observe(criteria, observer, tag, listener); - } + observe(criteria, observer, tag, listener); } } }