gerrithudsontrigger/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ParameterExpander.java
/**
     * Creates a list of the "standard" trigger parameters.
     * They are present both for build started and completed.
     * The parameters are:
     * <ul>
     *  <li><strong>GERRIT_NAME</strong>: The Gerrit project name.</li>
     *  <li><strong>CHANGE_ID</strong>: The Gerrit change-id (SHA-1).</li>
     *  <li><strong>BRANCH</strong>: The branch of the project.</li>
     *  <li><strong>CHANGE</strong>: The change number.</li>
     *  <li><strong>PATCHSET</strong>: The patchset number.</li>
     *  <li><strong>PATCHSET_REVISION</strong>: The patchset revision.</li>
     *  <li><strong>REFSPEC</strong>: The ref-spec. (refs/changes/xx/xxxx/z).</li>
     *  <li><strong>BUILDURL</strong>: The URL to the build.</li>
     *  <li><strong>VERIFIED</strong>: The verified vote.</li>
     *  <li><strong>CODE_REVIEW</strong>: The code review vote.</li>
     * </ul>
     * @param r the build.
     * @param gerritEvent the event.
     * @param codeReview the code review vote.
     * @param verified the verified vote.
     * @return the parameters and their values.
     */
Creates a list of the "standard" trigger parameters.
They are present both for build started and completed.
Creates a list of the " standard " trigger parameters . They are present both for build started and completed .
private Map<String, String> createStandardParameters(AbstractBuild r, GerritTriggeredEvent gerritEvent,
            int codeReview, int verified) {
        Map<String, String> map = new HashMap<String, String>(DEFAULT_PARAMETERS_COUNT);
        if (gerritEvent instanceof ChangeBasedEvent) {
            ChangeBasedEvent event = (ChangeBasedEvent)gerritEvent;
            map.put("GERRIT_NAME", event.getChange().getProject());
            map.put("CHANGE_ID", event.getChange().getId());
            map.put("BRANCH", event.getChange().getProject());
            map.put("CHANGE", event.getChange().getNumber());
            if (null != event.getPatchSet()) {
                map.put("PATCHSET", event.getPatchSet().getNumber());
                map.put("PATCHSET_REVISION", event.getPatchSet().getRevision());
                map.put("REFSPEC", StringUtil.makeRefSpec(event));
            }
        }
        if (r != null) {
            map.put("BUILDURL", hudson.getRootUrl() + r.getUrl());
        }
        map.put("VERIFIED", String.valueOf(verified));
        map.put("CODE_REVIEW", String.valueOf(codeReview));
        return map;
    }
private Map < String , String > createStandardParameters ( AbstractBuild r , GerritTriggeredEvent gerritEvent , int codeReview , int verified ) { Map < String , String > map = new HashMap < String , String > ( DEFAULT_PARAMETERS_COUNT ) ; if ( gerritEvent instanceof ChangeBasedEvent ) { ChangeBasedEvent event = ( ChangeBasedEvent ) gerritEvent ; map . put ( "GERRIT_NAME" , event . getChange ( ) . getProject ( ) ) ; map . put ( "CHANGE_ID" , event . getChange ( ) . getId ( ) ) ; map . put ( "BRANCH" , event . getChange ( ) . getProject ( ) ) ; map . put ( "CHANGE" , event . getChange ( ) . getNumber ( ) ) ; if ( null != event . getPatchSet ( ) ) { map . put ( "PATCHSET" , event . getPatchSet ( ) . getNumber ( ) ) ; map . put ( "PATCHSET_REVISION" , event . getPatchSet ( ) . getRevision ( ) ) ; map . put ( "REFSPEC" , StringUtil . makeRefSpec ( event ) ) ; } } if ( r != null ) { map . put ( "BUILDURL" , hudson . getRootUrl ( ) + r . getUrl ( ) ) ; } map . put ( "VERIFIED" , String . valueOf ( verified ) ) ; map . put ( "CODE_REVIEW" , String . valueOf ( codeReview ) ) ; return map ; }
Creates a list of the "standard" trigger parameters.
Creates a list of the " standard " trigger parameters .
//<GERRIT_NAME> <BRANCH> <CHANGE> <PATCHSET> <PATCHSET_REVISION> <REFSPEC> <BUILDURL> VERIFIED CODE_REVIEW