Giter Site home page Giter Site logo

jenkinsci / google-source-plugin Goto Github PK

View Code? Open in Web Editor NEW
5.0 7.0 11.0 76 KB

This plugin provides the credential provider to use Google Cloud Platform OAuth Credentials (provided by the Google OAuth Plugin) to access source code from https://source.developer.google.com as well as https://googlesource.com.

Home Page: https://plugins.jenkins.io/google-source-plugin/

License: Apache License 2.0

Java 100.00%

google-source-plugin's Issues

OAuth Scope and Service Account Role

Hello,
we are trying to use that plugin to checkout sources from Google Cloud Repositories with GCE instances. Our instances have a Service Account attached that has the permission to check out repositories.
When to manually configure the according Git credential helper for the Jenkins user, the checkout of our sources works without specifying credentials. Unfortunately this is not following Jenkins best-practices as they recommend to not configure any credential helper and use Jenkins credentials instead.
By working scopes as this plugin suggests, we cannot use a custom service account.
Would it be possible to develop the plugin in a way that takes both cases into account:

  • Default Service Account with attached Scope
  • Custom Service Account with attached Permissions

Thanks
Eric

Sometimes crashes on agent (areOnMaster)

Sometimes we receive an error on a Jenkins agent

java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
	at jenkins.model.Jenkins.get(Jenkins.java:772)
	at hudson.model.Hudson.getInstance(Hudson.java:77)
	at com.google.jenkins.plugins.source.GoogleRobotUsernamePassword.areOnMaster(GoogleRobotUsernamePassword.java:146)
	at com.google.jenkins.plugins.source.GoogleRobotUsernamePassword.readObject(GoogleRobotUsernamePassword.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2136)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
	at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1933)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1529)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
	at hudson.remoting.UserRequest.deserialize(UserRequest.java:245)
	at hudson.remoting.UserRequest.perform(UserRequest.java:159)

It looks like we shouldn't be calling Hudson.getInstance to determine whether we're running on a Jenkins agent. There may be other classes that shouldn't be called/remoted from this plugin.

Plugin crashes on null pointer for builds

Not sure when my predecessor installed this plugin, or why we saw this now, but builds started failing a null check with this stack:

java.io.IOException: Failed to parse changelog
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:628)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
    at hudson.model.Run.execute(Run.java:1741)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:408)
Caused by: java.lang.NullPointerException
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
    at com.google.jenkins.plugins.metadata.scm.SourceMetadata.<init>(SourceMetadata.java:62)
    at com.google.jenkins.plugins.metadata.scm.SourceMetadataExtractor$FromGitBuildActions.getSourceMetadata(SourceMetadataExtractor.java:242)
    at com.google.jenkins.plugins.metadata.scm.SourceMetadataExtractor$FromBuildActions.extract(SourceMetadataExtractor.java:139)
    at com.google.jenkins.plugins.metadata.scm.SourceMetadataExtractor.extract(SourceMetadataExtractor.java:101)
    at com.google.jenkins.plugins.metadata.scm.SourceMetadataBuildListener.onChangeLogParsed(SourceMetadataBuildListener.java:50)
    at hudson.model.listeners.SCMListener.onChangeLogParsed(SCMListener.java:120)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:626)

SourceMetadata.java and others are from this repo, with correct line numbers. Also, uninstalling this plugin fixed that issue.

Checkout is faling on latest Jenkins

Using Jenkins 2.187, this plugin now fails upon attempting and "checkout scm" in the Jenkinsfile:

java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
    at jenkins.model.Jenkins.get(Jenkins.java:772)
    at hudson.model.Hudson.getInstance(Hudson.java:77)
    at com.google.jenkins.plugins.source.GoogleRobotUsernamePassword.areOnMaster(GoogleRobotUsernamePassword.java:146)
    at com.google.jenkins.plugins.source.GoogleRobotUsernamePassword.readObject(GoogleRobotUsernamePassword.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2136)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1933)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1529)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
    at hudson.remoting.UserRequest.deserialize(UserRequest.java:245)
    at hudson.remoting.UserRequest.perform(UserRequest.java:159)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.