[JIRA] (JENKINS-55330) multi-branch pipeline project: github tag not found when building a tag

2 views
Skip to first unread message

yoanlin93@gmail.com (JIRA)

unread,
Dec 26, 2018, 3:15:05 AM12/26/18
to jenkinsc...@googlegroups.com
Yo-An Lin updated an issue
 
Jenkins / Bug JENKINS-55330
multi-branch pipeline project: github tag not found when building a tag
Change By: Yo-An Lin
Summary: multi-branch pipeline project: github tag not found when buliding building a tag
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

yoanlin93@gmail.com (JIRA)

unread,
Dec 26, 2018, 4:28:02 AM12/26/18
to jenkinsc...@googlegroups.com
Yo-An Lin commented on Bug JENKINS-55330
 
Re: multi-branch pipeline project: github tag not found when building a tag

This is related to the okhttp used by the GitHub branch source plugin:
src/main/java/org/jenkinsci/plugins/github_branch_source/Connector.java LINE 393

            OkHttpClient client = new OkHttpClient().setProxy(getProxy(host));
                if (cacheDir != null) {
                    Cache cache = new Cache(cacheDir, cacheSize * 1024L * 1024L);
                    client.setCache(cache);
                }

And here is the related part of the okhttp client https://github.com/square/okhttp/wiki/Recipes#response-caching

yoanlin93@gmail.com (JIRA)

unread,
Dec 26, 2018, 4:37:01 AM12/26/18
to jenkinsc...@googlegroups.com

When I use cURL to call the GitHub API, I got this:

HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 26 Dec 2018 09:35:06 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 386
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
X-RateLimit-Reset: 1545820506
Cache-Control: private, max-age=60, s-maxage=60
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
ETag: "xxxxxxxxxxxxxxxxxxxxxxxxx"
Last-Modified: Wed, 26 Dec 2018 05:04:44 GMT
X-Poll-Interval: 300
X-OAuth-Scopes: repo
X-Accepted-OAuth-Scopes: repo
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP,
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes,
X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'

yoanlin93@gmail.com (JIRA)

unread,
Dec 26, 2018, 4:49:01 AM12/26/18
to jenkinsc...@googlegroups.com
                } else if (head instanceof GitHubTagSCMHead) {
                    GitHubTagSCMHead tagHead = (GitHubTagSCMHead) head;
                    GHRef tag = ghRepository.getRef("tags/" + tagHead.getName());    // <------------- using cached response
                    String sha = tag.getObject().getSha();
                    if ("tag".equalsIgnoreCase(tag.getObject().getType())) {
                        // annotated tag object
                        GHTagObject tagObject = ghRepository.getTagObject(sha);
                        // we want the sha of the tagged commit not the tag object
                        sha = tagObject.getObject().getSha();
                    }
                    return new GitTagSCMRevision(tagHead, sha);

yoanlin93@gmail.com (JIRA)

unread,
Dec 26, 2018, 6:26:02 AM12/26/18
to jenkinsc...@googlegroups.com

yoanlin93@gmail.com (JIRA)

unread,
Dec 26, 2018, 6:42:02 AM12/26/18
to jenkinsc...@googlegroups.com
Yo-An Lin edited a comment on Bug JENKINS-55330
When I use cURL to call the GitHub API to get an existing tag , I got this:

{code}
{code}

bitwiseman@gmail.com (JIRA)

unread,
Jun 18, 2019, 5:43:01 PM6/18/19
to jenkinsc...@googlegroups.com

Yo-An Lin

Could you try the patched version of the github-branch-source-plugin linked in the description of https://issues.jenkins-ci.org/browse/JENKINS-57411 ? 

I'm wondering if perhaps the using a more recent version of okhttp3 will address these issues with the cache. 

 

 

Reply all
Reply to author
Forward
0 new messages