Skip to content

Reduce overall calls to Github#65

Merged
samrocketman merged 1 commit into
jenkinsci:masterfrom
i386:lazy-user-lookup
Oct 24, 2016
Merged

Reduce overall calls to Github#65
samrocketman merged 1 commit into
jenkinsci:masterfrom
i386:lazy-user-lookup

Conversation

@i386
Copy link
Copy Markdown
Contributor

@i386 i386 commented Oct 24, 2016

Requires #64 to be merged.

  • Always lookup the user locally before asking Github
  • lazyily lookup authorities if needed.

PTAL @samrocketman

@i386 i386 force-pushed the lazy-user-lookup branch 3 times, most recently from be30c7b to 3a68f70 Compare October 24, 2016 03:23
Comment thread pom.xml Outdated
Copy link
Copy Markdown
Contributor Author

@i386 i386 Oct 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samrocketman we need to bump the required Jenkins version here to get the newer User.getById() api

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, good to know the reason. Unfortunately, it means that the plugin will not be compatible with Cloudbees Jenkins Enterprise which is based on Jenkins 1.651.3.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CJP is based on 2.7.4 I believe

@samrocketman
Copy link
Copy Markdown
Member

#64 merged.

@samrocketman
Copy link
Copy Markdown
Member

samrocketman commented Oct 24, 2016

You can test findbugs issues by running:

mvn org.codehaus.mojo:findbugs-maven-plugin:3.0.4:check

Before you even upload for the CI system.

* Always lookup the user locally before asking Github
* lazyily lookup authorities if needed.
* Requires 2.7.1 for User.getUserById
@i386 i386 force-pushed the lazy-user-lookup branch from acf05fc to c4159ef Compare October 24, 2016 03:45
@i386
Copy link
Copy Markdown
Contributor Author

i386 commented Oct 24, 2016

@samrocketman OK all fixed. Ignoring the equals findbugs problem as its bogus

@i386
Copy link
Copy Markdown
Contributor Author

i386 commented Oct 24, 2016

@samrocketman looks like this passes.

@samrocketman
Copy link
Copy Markdown
Member

Unfortunately, one of the PRs we merged broke creating organization and teams as Jenkins groups. I can still merge this but need to figure out what was broken from all of the development today.

@samrocketman samrocketman merged commit ce15460 into jenkinsci:master Oct 24, 2016
@i386
Copy link
Copy Markdown
Contributor Author

i386 commented Oct 24, 2016

@samrocketman hmm thats surprising. How are Jenkins groups created?

@samrocketman
Copy link
Copy Markdown
Member

Good question I have to go back through and figure out why it's not working. I'm not 100% sure myself. Tomorrow I'll go through old PRs like #41 and try to track down the root cause.

@i386
Copy link
Copy Markdown
Contributor Author

i386 commented Oct 24, 2016

@samrocketman I had a bit of a look today and couldn't figure out how it was done. Let me know if you want to bounce any ideas.

@samrocketman
Copy link
Copy Markdown
Member

I found a stack trace by trying to configure Project Matrix Security (this used to work). I tried adding samrocketman user to project matrix security and got:

java.lang.IllegalArgumentException: Cannot pass a null GrantedAuthority array
    at org.springframework.util.Assert.notNull(Assert.java:112)
    at org.acegisecurity.userdetails.User.setAuthorities(User.java:233)
    at org.acegisecurity.userdetails.User.<init>(User.java:136)
    at org.jenkinsci.plugins.GithubOAuthUserDetails.<init>(GithubOAuthUserDetails.java:32)
    at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:586)
    at hudson.security.GlobalMatrixAuthorizationStrategy$DescriptorImpl.doCheckName_(GlobalMatrixAuthorizationStrategy.java:336)
    at hudson.security.GlobalMatrixAuthorizationStrategy$DescriptorImpl.doCheckName(GlobalMatrixAuthorizationStrategy.java:314)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
    at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:86)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:499)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

@samrocketman
Copy link
Copy Markdown
Member

@sirosen if you don't mind, please help debug:

For now, I'm going to get some shut eye. Have a good evening @i386 @sirosen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants