Class InteractiveViewStep
- All Implemented Interfaces:
ExtensionPoint,Describable<org.jenkinsci.plugins.workflow.steps.Step>,Serializable
interactiveView pipeline step: snapshot a generated file into the plugin's durable store
and publish a Confluence-style review page where humans can comment (generally or inline, per source
line), edit a durable review copy (with version history) and record an
approve / reject / acknowledge / request-changes decision.
// non-blocking: publish for review and carry on (returns the review id)
interactiveView(file: 'reports/summary.md', reportName: 'Build Summary', commentable: true)
// blocking review gate: pause until a human decides, then branch on the outcome
def r = interactiveView(file: 'reports/plan.md', wait: true, slaMinutes: 30)
if (r.status == 'APPROVED') { echo "approved by ${r.decidedBy}" }
// regenerate loop: feed the inline comments back to a generator on "Request changes"
if (r.status == 'CHANGES_REQUESTED') {
r.comments.each { c -> echo "line ${c.line}: ${c.body}" } // pass to your AI agent
}
// folders / dynamically generated files: publish every match as one grouped report
interactiveView(includes: 'reports/**' + '/*.md', reportName: 'Generated reports')
interactiveView(dir: 'out/site', mode: 'info', notify: false) // read-only viewer, no approval
The source is read via the build's FilePath workspace and copied into the store, so the
review still works after the workspace/build is cleaned. Provide exactly one of: a single
file; an Ant-style includes glob (optionally with excludes); or a dir
(sugar for dir/**). A glob/dir publishes one review per matched file, grouped under a shared
reportName. Markdown is rendered to safe HTML; every other format (HTML included, and any
programming language) is shown as escaped, syntax-highlighted source — never executed.
mode is 'review' (default — a decision is required) or 'info' (a read-only
viewer, still commentable, with no approve/reject buttons). wait:true requires a single file
in 'review' mode.
Return value: a single-file, non-blocking call returns the review id (String); a
glob/dir call returns a Map [groupId, ids, count]; wait:true returns a
Map [id, status, decidedBy, version, content, comments] on decision (where
comments is a list of [id, line, body, author, createdTs, resolved]; line is
the 1-based source line for inline comments or -1 for general notes), or throws a
TimeoutException on SLA expiry (like askInteractive).
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDir()getFile()getMode()intgetTitle()booleanbooleanbooleanisNotify()booleanisWait()longvoidsetCommentable(boolean commentable) voidvoidsetEditable(boolean editable) voidsetExcludes(String excludes) voidvoidvoidsetIncludes(String includes) voidvoidsetNotify(boolean notify) voidsetReportName(String reportName) voidsetSlaMinutes(int slaMinutes) voidsetSubmitterFilter(String submitterFilter) voidvoidsetWait(boolean wait) org.jenkinsci.plugins.workflow.steps.StepExecutionstart(org.jenkinsci.plugins.workflow.steps.StepContext context) Methods inherited from class org.jenkinsci.plugins.workflow.steps.Step
getDescriptor
-
Constructor Details
-
InteractiveViewStep
@DataBoundConstructor public InteractiveViewStep()
-
-
Method Details
-
getFile
-
setFile
-
getIncludes
-
setIncludes
-
getExcludes
-
setExcludes
-
getDir
-
setDir
-
getMode
- Returns:
- the review mode as configured (
review/info);nullmeans default.
-
setMode
-
getTitle
-
setTitle
-
getReportName
-
setReportName
-
isCommentable
public boolean isCommentable() -
setCommentable
@DataBoundSetter public void setCommentable(boolean commentable) -
isEditable
public boolean isEditable() -
setEditable
@DataBoundSetter public void setEditable(boolean editable) -
isNotify
public boolean isNotify() -
setNotify
@DataBoundSetter public void setNotify(boolean notify) -
isWait
public boolean isWait() -
setWait
@DataBoundSetter public void setWait(boolean wait) -
getFormat
-
setFormat
-
getSlaMinutes
public int getSlaMinutes() -
setSlaMinutes
@DataBoundSetter public void setSlaMinutes(int slaMinutes) -
getSubmitterFilter
-
setSubmitterFilter
-
resolveSlaMs
public long resolveSlaMs()- Returns:
- the effective SLA in milliseconds for a blocking review, resolving the JCasC default.
-
start
public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context) throws Exception - Specified by:
startin classorg.jenkinsci.plugins.workflow.steps.Step- Throws:
Exception
-