Search in sources :

Example 1 with StashbotMetadataUpdatedEvent

use of com.palantir.stash.stashbot.event.StashbotMetadataUpdatedEvent in project stashbot by palantir.

the class ConfigurationPersistenceImpl method setPullRequestMetadata.

// Allows fromHash and toHash to be set by the caller, in case we are referring to older commits
/* (non-Javadoc)
     * @see com.palantir.stash.stashbot.config.ConfigurationPersistenceService#setPullRequestMetadata(com.atlassian.stash.pull.PullRequest, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean)
     */
@Override
public void setPullRequestMetadata(PullRequest pr, String fromHash, String toHash, Boolean buildStarted, Boolean success, Boolean override, Boolean failed) {
    PullRequestMetadata prm = getPullRequestMetadata(pr.getToRef().getRepository().getId(), pr.getId(), fromHash, toHash);
    if (buildStarted != null) {
        prm.setBuildStarted(buildStarted);
    }
    if (success != null) {
        prm.setSuccess(success);
    }
    if (override != null) {
        prm.setOverride(override);
    }
    if (failed != null) {
        prm.setFailed(failed);
    }
    prm.save();
    publisher.publish(new StashbotMetadataUpdatedEvent(this, pr));
}
Also used : StashbotMetadataUpdatedEvent(com.palantir.stash.stashbot.event.StashbotMetadataUpdatedEvent) PullRequestMetadata(com.palantir.stash.stashbot.persistence.PullRequestMetadata)

Aggregations

StashbotMetadataUpdatedEvent (com.palantir.stash.stashbot.event.StashbotMetadataUpdatedEvent)1 PullRequestMetadata (com.palantir.stash.stashbot.persistence.PullRequestMetadata)1