@Override
    public void start(Job<?, ?> project, boolean newInstance) {
        // We should always start the trigger, and handle cases where we don't run in the run function.
        super.start(project, newInstance);

        String name = project.getFullName();

        if (!project.isBuildable()) {
            LOGGER.log(Level.FINE, "Project is disabled, not starting trigger for job " + name);
            return;
        }
        if (project.getProperty(GithubProjectProperty.class) == null) {
            LOGGER.log(Level.INFO, "GitHub project property is missing the URL, cannot start ghprb trigger for job " + name);
            return;
        }
        try {
            initState();
        } catch (Exception ex) {
            LOGGER.log(Level.SEVERE, "Can't start ghprb trigger", ex);
            return;
        }

        LOGGER.log(Level.INFO, "Starting the ghprb trigger for the {0} job; newInstance is {1}",
                new String[] {name, String.valueOf(newInstance)});

        helper = new Ghprb(this);

        if (getUseGitHubHooks()) {
            LOGGER.log(Level.FINEST, "Disable registering hooks on startup: {0}",
                    new String[] {String.valueOf(DISABLE_REGISTER_ON_STARTUP)});
            if (GhprbTrigger.getDscp().getManageWebhooks() && (newInstance || !DISABLE_REGISTER_ON_STARTUP)) {
                final String[] params = {
                        String.valueOf(SystemProperties.getInteger(GhprbTrigger.class.getName() + ".poolSize", 5))
                };
                LOGGER.log(Level.FINEST, "Registering hook with GitHub.  Thread pool size: {0}", params);
                POOL.submit(new StartHookRunnable(this.repository));
            }
            DESCRIPTOR.addRepoTrigger(getRepository().getName(), super.job);
        }
    }
@ Override public void start ( Job < ? , ? > project , boolean newInstance ) { super . start ( project , newInstance ) ; String name = project . getFullName ( ) ; if ( ! project . isBuildable ( ) ) { LOGGER . log ( Level . FINE , "Project is disabled, not starting trigger for job " + name ) ; return ; } if ( project . getProperty ( GithubProjectProperty . class ) == null ) { LOGGER . log ( Level . INFO , "GitHub project property is missing the URL, cannot start ghprb trigger for job " + name ) ; return ; } try { initState ( ) ; } catch ( Exception ex ) { LOGGER . log ( Level . SEVERE , "Can't start ghprb trigger" , ex ) ; return ; } LOGGER . log ( Level . INFO , "Starting the ghprb trigger for the {0} job; newInstance is {1}" , new String [ ] { name , String . valueOf ( newInstance ) } ) ; helper = new Ghprb ( this ) ; if ( getUseGitHubHooks ( ) ) { LOGGER . log ( Level . FINEST , "Disable registering hooks on startup: {0}" , new String [ ] { String . valueOf ( DISABLE_REGISTER_ON_STARTUP ) } ) ; if ( GhprbTrigger . getDscp ( ) . getManageWebhooks ( ) && ( newInstance || ! DISABLE_REGISTER_ON_STARTUP ) ) { final String [ ] params = { String . valueOf ( SystemProperties . getInteger ( GhprbTrigger . class . getName ( ) + ".poolSize" , 5 ) ) } ; LOGGER . log ( Level . FINEST , "Registering hook with GitHub.  Thread pool size: {0}" , params ) ; POOL . submit ( new StartHookRunnable ( this . repository ) ) ; } DESCRIPTOR . addRepoTrigger ( getRepository ( ) . getName ( ) , super . job ) ; } }
Called when a {@link hudson.triggers.Trigger} is loaded into memory and started.

@param project     given so that the persisted form of this object won't have to have a back pointer.
@param newInstance True if this may be a newly created trigger first attached to the
{@link hudson.model.Project} (generally if the project is being created or configured).
False if this is invoked for a {@link hudson.model.Project} loaded from disk.
@see hudson.model.Items#currentlyUpdatingByXml