Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Commit

Permalink
Do not apply include/exclude restrictions to tags (#103)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Guillaume Lecerf authored and Argelbargel committed Jun 6, 2019
1 parent 270128d commit a5eab07
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit a5eab07

Please sign in to comment.