Swarm - BredaUniversityGames/JenkinsLib GitHub Wiki

swarm.review()

Creates Helix Swarm code reviews automatically from Perforce changelists via the Swarm REST API (v9).

Usage

stages {
    perforce.sync()
    ue5.build()
    swarm.review()
    discord.alert()
}

Note: Requires perforce.sync() — uses the Perforce credential and changelist from context.

Prerequisites

  • A Helix Swarm server accessible from the Jenkins agent
  • The Perforce credential (from perforce.sync()) must have Swarm access

Parameters

Parameter Default Description
SWARM_URL (empty) Swarm server URL (e.g., https://swarm.buas.nl)
SWARM_USER (empty) Swarm user ID

How It Works

  1. Creates a Perforce ticket using the perforce.sync() credential
  2. Creates a new Swarm review for the current changelist
  3. Sets ctx.reviewId, ctx.reviewAuthor, and ctx.swarmUrl for notification modules

Direct-Use Methods

Available on the swarm object for advanced usage:

Method Description
swarm.createReview(config) Create a review from a changelist
swarm.upVote(config) Upvote a review
swarm.downVote(config) Downvote a review
swarm.comment(config) Add a comment to a review
swarm.setState(config) Set review state
swarm.needsReview(config) Set state to "needsReview"
swarm.needsRevision(config) Set state to "needsRevision"
swarm.approve(config) Approve a review
swarm.archive(config) Archive a review
swarm.reject(config) Reject a review
swarm.getParticipantsOfGroup(name, groups) Get Swarm IDs for a group
swarm.getParticipantsOfGroups(names, groups) Get Swarm IDs for multiple groups

Groups Integration

See Architecture - Groups System for the JSON groups format used with Swarm participant management.

⚠️ **GitHub.com Fallback** ⚠️