Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e69992c
Implement collapsible console sections with line count display
adityajalkhare May 8, 2026
74b8108
Enhance console section parser with marker detection and nesting support
adityajalkhare May 8, 2026
6e32a31
Add console section rules and related functionality for collapsible s…
adityajalkhare May 8, 2026
bd7be21
Implement ConsoleSectionAnnotator and MarkerConsoleSectionAnnotator w…
adityajalkhare May 8, 2026
76c9dc8
Refactor ConsoleSectionRuleTest to verify extension point discovery a…
adityajalkhare May 8, 2026
efae1f9
Enhance ConsoleSection behavior and styling for collapsible groups
adityajalkhare May 8, 2026
e6faaa4
Add example Jenkinsfile for collapsible sections with marker detection
adityajalkhare May 8, 2026
7a26c45
Add documentation for collapsible console sections and extension points
adityajalkhare May 8, 2026
d0e4639
run prettier
adityajalkhare May 8, 2026
1a9e8d1
Merge branch 'main' into feature/collapsible-console-elements
timja May 9, 2026
9294a53
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 11, 2026
79bf957
Implement collapsible sections in ConsoleSection and enhance ConsoleL…
adityajalkhare May 11, 2026
f0a1b25
Merge branch 'main' of https://github.com/adityajalkhare/pipeline-gra…
adityajalkhare May 11, 2026
b68782f
Merge branch 'feature/collapsible-console-elements' of https://github…
adityajalkhare May 11, 2026
88cc38b
Merge branch 'feature/collapsible-console-elements' of https://github…
adityajalkhare May 11, 2026
cae311b
fix: eslint issues
adityajalkhare May 11, 2026
6db3e5c
fix: add eslint directive for no-control-regex rule
adityajalkhare May 11, 2026
f95d328
fix: ran prettier
adityajalkhare May 11, 2026
d56f7f5
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 12, 2026
c619641
Add console section boundaries support
adityajalkhare May 12, 2026
e6e1ea2
Merge branch 'feature/collapsible-console-elements' of https://github…
adityajalkhare May 12, 2026
9086ec4
address comments after copilot review
adityajalkhare May 12, 2026
8834447
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 13, 2026
e2bfe84
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 16, 2026
b6140c5
Address the Copilot review comments -
adityajalkhare May 17, 2026
d641c8b
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 17, 2026
a4da67a
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 19, 2026
7af4f86
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 25, 2026
f43e703
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 26, 2026
52693d2
Rerun CI
adityajalkhare May 26, 2026
708d343
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 28, 2026
b867715
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare May 29, 2026
2c759f2
add capability to work when timestamper plugin is enabled
adityajalkhare May 30, 2026
cd319d9
ran prettier
adityajalkhare May 30, 2026
a45374d
fix tsc issues
adityajalkhare May 30, 2026
ec893cf
Merge branch 'main' into feature/collapsible-console-elements
adityajalkhare Jun 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ See a live demonstration from a Jenkins Contributor Summit:

## Pipeline DSL Extensions

### Collapsible Console Sections

Console output can be split into collapsible sections using `##[group]` / `##[endgroup]` markers (Azure DevOps style) or `::group::` / `::endgroup::` (GitHub Actions style):

```groovy
sh '''
echo "##[group]Unit Tests"
./run-tests.sh
echo "##[endgroup]"
'''
```

Sections with more than 25 lines start collapsed. Nested sections are supported. See [collapsible-console-sections.md](docs/collapsible-console-sections.md) for full details including colored titles with the AnsiColor plugin.

### Hiding Steps from View

You can mark specific pipeline steps as hidden from the view by wrapping them with the `hideFromView` step:
Expand Down Expand Up @@ -74,6 +88,15 @@ pipeline {

The REST API documentation can be found [here](https://editor-next.swagger.io/?url=https://raw.githubusercontent.com/jenkinsci/pipeline-graph-view-plugin/refs/heads/main/openapi.yaml).

## Extending the Plugin

Plugin authors can contribute custom collapsible section rules via two extension points:

- `ConsoleSectionRule` - regex-based, runs client-side. Good for simple delimited output (npm install, pip, Docker builds, etc.).
- `ConsoleSectionAnnotator` - stateful, runs server-side line by line. Good for context-dependent grouping like stack traces or test suite blocks.

See [extending-console-sections.md](docs/extending-console-sections.md) for examples of both.

## Contributing

Refer to our [contribution guidelines](./CONTRIBUTING.md).
Expand Down
65 changes: 65 additions & 0 deletions docs/collapsible-console-sections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Collapsible Console Sections

Steps in the Pipeline Graph View console can collapse sections of their output into expandable groups. This makes long logs easier to scan.

## Using markers in your Jenkinsfile

Add `##[group]` and `##[endgroup]` markers to your shell commands. The text after `##[group]` becomes the section title.

```groovy
stage('Test') {
steps {
sh '''
echo "##[group]Unit Tests"
./run-tests.sh
echo "##[endgroup]"

echo "##[group]Integration Tests"
./run-integration.sh
echo "##[endgroup]"
'''
}
}
```

Both Azure DevOps (`##[group]`) and GitHub Actions (`::group::`) syntax are supported and can be mixed freely.

```groovy
sh '''
echo "::group::Dependency install"
npm ci
echo "::endgroup::"
'''
```

## Behavior

- Sections with more than 25 lines start collapsed.
- Sections with 25 or fewer lines start open.
- Sections still being written (not yet closed) stay open.
- Sections can be nested.
- Lines from `set -x` shell tracing (starting with `+ `) are never treated as markers.

## Colored titles (AnsiColor plugin)

If you install the [AnsiColor plugin](https://plugins.jenkins.io/ansicolor/), wrap your step in `ansiColor('xterm')`. ANSI codes in section titles are rendered as colors.

```groovy
stage('Build') {
steps {
ansiColor('xterm') {
sh '''#!/bin/bash
echo -e "\033[32m##[group]Dependencies\033[0m"
npm ci
echo "##[endgroup]"

echo -e "##[group]\033[1;34mCompile\033[0m"
npm run build
echo "##[endgroup]"
'''
}
}
}
```

Note: use `echo -e` in bash (not the default `sh`) so escape sequences are interpreted. Add `#!/bin/bash` at the top of your `sh` block.
Loading
Loading