Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump bom-2.332.x from 1466.v85a_616ea_b_87c to 1763.v092b_8980a_f5e #82

Open
wants to merge 160 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
25f8309
Adding LICENSE file.
kshithijiyer Aug 16, 2019
2eb15c4
JENKINS-38669 first stage - adding getSCMs method to FlowDefinition
AngryGami Nov 27, 2019
eb77dfc
added javadoc to getSCMs method
AngryGami Dec 4, 2019
e290ec5
bump workflow-step-api and script-security versions
AngryGami Dec 4, 2019
4832389
bump structs versions
AngryGami Dec 4, 2019
a4b9535
Make workflow-api compatible with Guava 21.0 and newer (#135)
timja Mar 15, 2021
030bebd
enable release-drafter github action
car-roll Mar 16, 2021
bef952a
Merge pull request #141 from car-roll/enable-release-drafter
bitwiseman Mar 16, 2021
5f558d4
[maven-release-plugin] prepare release workflow-api-2.42
car-roll Mar 16, 2021
fa8a6b3
[maven-release-plugin] prepare for next development iteration
car-roll Mar 16, 2021
f8641c7
[BEE-2537] Terminology updates for public strings. slave->agent, mast…
kerogers-cloudbees May 7, 2021
620362f
Build on java 11 as well (#138)
timja May 10, 2021
513163e
Update plugin POM and BOM
basil May 31, 2021
bd29437
Fix Javadoc error: tag not supported in the generated HTML version: tt
basil May 31, 2021
61da1b2
Introducing some synchronization mechanisms to try improving performance
twasyl Jun 4, 2021
d13c9a6
Using a lock instead of synchronization
twasyl Jun 4, 2021
689f233
Synchronization at instance level as suggested in PR
twasyl Jun 7, 2021
8f5016c
Revert some unrelated changes
twasyl Jun 7, 2021
4f4aaa5
Revert some unrelated changes
twasyl Jun 7, 2021
927249b
Merge pull request #153 from twasyl/synchronization-for-optimisation
bitwiseman Jun 7, 2021
72f1fec
[maven-release-plugin] prepare release workflow-api-2.43
bitwiseman Jun 7, 2021
a42af08
[maven-release-plugin] prepare for next development iteration
bitwiseman Jun 7, 2021
324b9b5
[maven-release-plugin] prepare release workflow-api-2.44
bitwiseman Jun 7, 2021
d8342fd
[maven-release-plugin] prepare for next development iteration
bitwiseman Jun 7, 2021
501eb84
Fixing Javadoc for fixing the pipeline
twasyl Jun 7, 2021
5855331
One more missing error
twasyl Jun 7, 2021
5acd081
Update FlowNodeViewColumn.java
bitwiseman Jun 7, 2021
c5b2e1b
Apply suggestions from code review
bitwiseman Jun 7, 2021
14d7f72
Merge pull request #155 from twasyl/javadoc-fixes
bitwiseman Jun 7, 2021
5d9b301
Merge branch 'master' into pom
bitwiseman Jun 7, 2021
4c0b6bc
Merge pull request #152 from basil/pom
bitwiseman Jun 8, 2021
bd0347a
Bump bom-2.222.x from 25 to 841.vd6e713d848ab
dependabot[bot] Jun 8, 2021
a140564
Merge pull request #154 from jenkinsci/dependabot/maven/io.jenkins.to…
bitwiseman Jun 9, 2021
ee39c73
add basic gh actions
olamy Jun 9, 2021
fc996d1
Bump docker-fixtures from 1.10 to 1.11 (#143)
dependabot[bot] Jun 9, 2021
4a7d66f
Migrate from `RestartableJenkinsRule` to `JenkinsSessionRule` (#151)
basil Jun 9, 2021
6c8c07c
Update LICENSE
bitwiseman Jun 9, 2021
61ef214
Merge pull request #101 from kshithijiyer/patch-1
bitwiseman Jun 9, 2021
0c00855
Merge branch 'master' into master
bitwiseman Jun 9, 2021
ed2467f
Merge pull request #111 from AngryGami/master
bitwiseman Jun 10, 2021
6372cff
Revert "Merge pull request #153 from twasyl/synchronization-for-optim…
bitwiseman Jun 16, 2021
77c9983
Merge pull request #158 from bitwiseman/revert-153
bitwiseman Jun 16, 2021
f94d764
[maven-release-plugin] prepare release workflow-api-2.45
bitwiseman Jun 16, 2021
3859653
[maven-release-plugin] prepare for next development iteration
bitwiseman Jun 16, 2021
f9b50da
Use ConcurrentHashMap
bitwiseman Jun 21, 2021
ea384e4
Clean up and clarification
bitwiseman Jun 21, 2021
7da343b
Merge pull request #160 from bitwiseman/issue/JENKINS-65821
bitwiseman Jun 23, 2021
405ec3c
[maven-release-plugin] prepare release workflow-api-2.46
bitwiseman Jun 23, 2021
8221a5c
[maven-release-plugin] prepare for next development iteration
bitwiseman Jun 23, 2021
3345603
remove gh action
olamy Jul 11, 2021
10c0dad
Bump plugin from 4.19 to 4.28
dependabot[bot] Oct 5, 2021
ae6e98d
[JENKINS-66826] Fix NPE in ErrorAction (#175)
megathaum Oct 8, 2021
0eb39b5
Merge pull request #174 from jenkinsci/dependabot/maven/org.jenkins-c…
dependabot[bot] Oct 8, 2021
02a7752
Remove star imports and unused imports (#170)
basil Oct 8, 2021
456f163
simple change to trigger a build
olamy Oct 12, 2021
7a3688b
[maven-release-plugin] prepare release workflow-api-2.47
olamy Oct 12, 2021
b922745
[maven-release-plugin] prepare for next development iteration
olamy Oct 12, 2021
f76ced1
Add Dependabot configuration (#181)
basil Nov 17, 2021
76702b9
Use container agent in `Jenkinsfile` (#182)
basil Nov 18, 2021
ccd8ef3
Bump bom-2.222.x from 841.vd6e713d848ab to 887.vae9c8ac09ff7 (#162)
dependabot[bot] Nov 18, 2021
697de16
Bump plugin from 4.28 to 4.31
dependabot[bot] Nov 9, 2021
c84aa8c
Reduce usages of Guava (#177)
basil Nov 18, 2021
37c8c49
[JENKINS-67164] Call StepExecution.onResume directly from WorkflowRun…
dwnusbaum Nov 19, 2021
84c8de3
Fix typos
offa Dec 8, 2021
3de5e2e
enable cd (#183)
car-roll Dec 8, 2021
6a04bac
[JENKINS-40161] Handle exceptions from `StepExecution.onResume` (#187)
jglick Dec 16, 2021
6d6de20
[JENKINS-67351] Avoid deadlock when resuming Pipelines in some cases …
dwnusbaum Dec 17, 2021
57edf64
Bump actions/checkout from 2.3.4 to 2.4.0
dependabot[bot] Dec 13, 2021
55655b4
EOL JSR 305
basil Dec 31, 2021
c334f74
Bump git-changelist-maven-extension from 1.2 to 1.3
dependabot[bot] Jan 3, 2022
aaf17d5
Merge pull request #190 from basil/jsr305
jglick Jan 10, 2022
04f8fe1
Update parent, baseline, BOM
jglick Jan 10, 2022
d01f456
Replace deprecated method calls
offa Dec 8, 2021
9a181b1
Fix some unchecked warnings and raw types
offa Dec 8, 2021
4ee389f
Make members final
offa Dec 8, 2021
b094fa6
Cleanup exception declarations, imports and toString() calls
offa Dec 8, 2021
e27aa3d
Replace anonymous classes with lambdas
offa Dec 8, 2021
efc1c89
Refactoring
offa Dec 8, 2021
e9be4c8
Add missing nullability annotations
offa Dec 8, 2021
a5808c5
Use UTF-8 charset
offa Jan 11, 2022
bacc03a
Use matcher instead of comparison
offa Jan 11, 2022
88d57ba
EOL JSR 305
basil Jan 11, 2022
5e24327
Merge pull request #185 from offa/dev
jglick Jan 12, 2022
a384598
Revert "[JENKINS-67351] Avoid deadlock when resuming Pipelines in som…
dwnusbaum Jan 14, 2022
ca655cf
Revert "[JENKINS-40161] Handle exceptions from `StepExecution.onResum…
dwnusbaum Jan 14, 2022
fd1ae7f
Revert "[JENKINS-67164] Call StepExecution.onResume directly from Wor…
dwnusbaum Jan 14, 2022
3ce403f
Preserve FlowExecutionList.isResumption for binary compatibility
dwnusbaum Jan 14, 2022
fa07adf
Preserve minor changes that removed Guice and JSR-305 annotations
dwnusbaum Jan 14, 2022
7a916f3
chore: Prepare for icon removal from core (#192)
NotMyFault Jan 15, 2022
d923637
Preserve explanatory comment and minor change to log message
dwnusbaum Jan 18, 2022
92aa05c
Preserve NonNull annotations
dwnusbaum Jan 18, 2022
4335962
Merge pull request #198 from dwnusbaum/revert
car-roll Jan 18, 2022
c359ae1
Merge pull request #197 from basil/jsr305
car-roll Jan 21, 2022
43c5ba9
Merge pull request #195 from jglick/deps
car-roll Jan 21, 2022
7f5f175
Merge pull request #184 from offa/docs
car-roll Jan 21, 2022
2635c1b
feat: Utilize modern build status
NotMyFault Feb 11, 2022
3584cb4
`onLoad(FlowExecutionOwner)` is meant to throw `IOException`
jglick Feb 16, 2022
619fd52
Merge pull request #201 from jglick/IOException
jglick Feb 16, 2022
674759d
Merge branch 'master' into feat/master/utilize-modern-build-status
NotMyFault Feb 27, 2022
d1e01d8
Merge pull request #199 from NotMyFault/feat/master/utilize-modern-bu…
car-roll Feb 28, 2022
5db16e2
Replace handbuilt html with jelly for flow durability
timja Mar 1, 2022
b8634cb
Remove unnecessary use of reflection
basil Mar 1, 2022
2d42f1e
Merge pull request #206 from basil/baseline
car-roll Mar 10, 2022
35ad9bc
Bump actions/setup-java from 2 to 3
dependabot[bot] Apr 11, 2022
61c3180
Update plugin parent POM and BOM (#214)
basil Apr 21, 2022
b07a17d
Bump actions/checkout from 2.4.0 to 3.0.2
dependabot[bot] Apr 25, 2022
27f9b6b
Merge pull request #211 from jenkinsci/dependabot/github_actions/acti…
dependabot[bot] Apr 29, 2022
43d733b
Update cd.yaml
jglick Apr 29, 2022
4b3f756
Merge pull request #215 from jenkinsci/dependabot/github_actions/acti…
jglick Apr 29, 2022
ea8e33e
[JENKINS-49707] Introduce `ErrorCondition`
jglick May 2, 2022
bc885fd
Introduced `ErrorAction.findOrigin`
jglick May 2, 2022
761b214
Note about `BlockEndNode.getStartNode`
jglick May 3, 2022
84d6536
Bump jenkins-infra/jenkins-maven-cd-action from 1.2.0 to 1.3.0
dependabot[bot] May 9, 2022
258c896
[JENKINS-40161] Handle exceptions from `StepExecution.onResume`
jglick Dec 14, 2021
0b3de5e
Merge pull request #219 from jenkinsci/dependabot/github_actions/jenk…
dependabot[bot] May 9, 2022
b912c0e
Merge pull request #220 from jglick/onResume-JENKINS-40161-redux
jglick May 9, 2022
9828af9
Merge branch 'master' of https://github.com/jenkinsci/workflow-api-pl…
jglick May 9, 2022
8fba087
[JENKINS-67164] Call `StepExecution.onResume` in response to `Workflo…
jglick May 11, 2022
27cb454
Merge branch 'FlowExecutionList-JENKINS-67164' into retry-JENKINS-49707
jglick May 11, 2022
ae7a477
Bump bom-2.289.x from 1289.v5c4b_1c43511b_ to 1382.v7d694476f340
dependabot[bot] May 16, 2022
761ccc9
2.289.1 → 2.289.3
jglick May 16, 2022
729a0d4
Merge pull request #222 from jenkinsci/dependabot/maven/io.jenkins.to…
dependabot[bot] May 16, 2022
af5fef3
feat: Use proper CSS class for spacing between wirdgets
NotMyFault May 16, 2022
b1778a9
Call `StepExecution.onResume` in parallel to the extent possible
jglick May 19, 2022
0204914
Merge branch 'FlowExecutionList-JENKINS-67164' into retry-JENKINS-49707
jglick May 19, 2022
a643c5f
Merge branch 'master' of https://github.com/jenkinsci/workflow-api-pl…
jglick May 19, 2022
459ad69
Merge branch 'FlowExecutionList-JENKINS-67164' into retry-JENKINS-49707
jglick May 19, 2022
8034dd2
https://github.com/jenkinsci/workflow-api-plugin/pull/221#discussion_…
jglick May 26, 2022
9c2e790
Merge branch 'FlowExecutionList-JENKINS-67164' into retry-JENKINS-49707
jglick May 26, 2022
e10ac66
Typo in comment
jglick Jun 3, 2022
a1e4906
Merge pull request #221 from jglick/FlowExecutionList-JENKINS-67164
jglick Jun 3, 2022
c28585a
Merge branch 'master' of https://github.com/jenkinsci/workflow-api-pl…
jglick Jun 3, 2022
4550e8e
Require 2.332.x
jglick Jun 3, 2022
760c223
Merge pull request #226 from jglick/2.332.x
jglick Jun 3, 2022
a3d1b70
Merge branch 'master' of https://github.com/jenkinsci/workflow-api-pl…
jglick Jun 3, 2022
49f425d
chore: use jenkins infra maven cd reusable workflow
jetersen Jun 14, 2022
02c3dba
allower downstream plugin to adjust the apply order of TaskListenerDe…
fengxx Jun 30, 2022
5a90cb6
Merge pull request #228 from jetersen/chore/maven-cd-reusable-workflow
jglick Jul 1, 2022
015fd86
Bump bom-2.332.x from 1382.v7d694476f340 to 1466.v85a_616ea_b_87c
dependabot[bot] Jul 4, 2022
5faec00
Bump plugin from 4.40 to 4.42
dependabot[bot] Jul 5, 2022
945e8d6
Merge pull request #224 from NotMyFault/feat/master/proper-spacing
jglick Jul 7, 2022
41475e5
Merge pull request #217 from jglick/retry-JENKINS-49707
jglick Jul 7, 2022
74938de
Merge branch 'master' into replace-html-with-jelly
timja Jul 7, 2022
a6f7b4c
Update GlobalDefaultFlowDurabilityLevel.java
timja Jul 7, 2022
786bbb3
Add tooltip via FormValidation
timja Jul 7, 2022
4eb6237
Cleanup
timja Jul 8, 2022
0016b4f
Merge pull request #205 from timja/replace-html-with-jelly
jglick Jul 8, 2022
2dcadde
Bump docker-fixtures from 1.11 to 1.12
dependabot[bot] Jul 11, 2022
7e81e4e
Bump git-changelist-maven-extension from 1.3 to 1.4
dependabot[bot] Jul 25, 2022
2b089d4
Bump plugin from 4.42 to 4.45
dependabot[bot] Aug 1, 2022
d03c787
Diagnosis for `NoSuchElementException` from `ForkScanner.setHeads`
jglick Aug 8, 2022
2d0deb1
Use `Files.createTempDirectory` (#245)
jglick Aug 10, 2022
eae12da
Bump docker-fixtures from 1.12 to 166.v912b_95083ffe
dependabot[bot] Oct 3, 2022
9ea53b6
Bump plugin from 4.45 to 4.48
dependabot[bot] Oct 3, 2022
9312eff
Merge pull request #255 from jenkinsci/dependabot/maven/org.jenkins-c…
dependabot[bot] Oct 10, 2022
02bdf33
Merge pull request #254 from jenkinsci/dependabot/maven/org.jenkins-c…
dependabot[bot] Oct 10, 2022
4596ea5
Merge pull request #246 from jglick/NoSuchElementException
jglick Oct 10, 2022
597ffe7
`FlowExecutionList.ParallelResumer` should wait until Jenkins startup…
jglick Oct 10, 2022
8005c68
Merge pull request #256 from jglick/ParallelResumer-ready
jglick Oct 17, 2022
4bfe059
Bump bom-2.332.x from 1466.v85a_616ea_b_87c to 1763.v092b_8980a_f5e
dependabot[bot] Jan 2, 2023
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
10 changes: 7 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
reviewers:
- "dwnusbaum"
schedule:
interval: "daily"
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
1 change: 1 addition & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github
15 changes: 15 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins

name: cd
on:
workflow_dispatch:
check_run:
types:
- completed

jobs:
maven-cd:
uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1
secrets:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-beta-4</version>
<version>1.4</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
-Dchangelist.format=%d.v%s
6 changes: 5 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
buildPlugin()
buildPlugin(useContainerAgent: true, configurations: [
[ platform: "linux", jdk: "8" ],
[ platform: "windows", jdk: "8" ],
[ platform: "linux", jdk: "11" ]
])
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2013-2021 CloudBees, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Pipeline API Plugin

[![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/workflow-api)](https://plugins.jenkins.io/workflow-api)
[![Changelog](https://img.shields.io/github/v/tag/jenkinsci/workflow-api-plugin?label=changelog)](https://github.com/jenkinsci/workflow-api-plugin/blob/master/CHANGELOG.md)
[![GitHub Release](https://img.shields.io/github/v/tag/jenkinsci/workflow-api-plugin?label=changelog)](https://github.com/jenkinsci/workflow-api-plugin/releases/latest)
[![Jenkins Plugin Installs](https://img.shields.io/jenkins/plugin/i/workflow-api?color=blue)](https://plugins.jenkins.io/workflow-api)

# Introduction
Expand All @@ -10,3 +10,8 @@ Plugin that defines Pipeline API.

A component of [Pipeline
Plugin](https://plugins.jenkins.io/workflow-aggregator).

# Changelog

* For new versions, see [GitHub Releases](https://github.com/jenkinsci/workflow-api-plugin/releases)
* For versions 2.41 and older, see the [CHANGELOG](https://github.com/jenkinsci/workflow-api-plugin/blob/master/CHANGELOG.md)
10 changes: 5 additions & 5 deletions docs/flowgraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The "Flow Graph" is how Pipeline stores structural information about Pipelines that have run or *are* running -- this is used for visualization and runtime activities. You won't find any class with this name but we refer to it like this because it's the best terminology we have. "Flow" because originally the plugin was Workflow, and describing it as a flow reminds us that execution is a directional process with a start and end, "graph" because the data is structured as a directed acyclic graph to allow for parallel execution.

This stucture describes all possible Pipelines, whether a simple set of steps, or a complex set of nested parallels, and is designed to grow at runtime as the Pipeline executes. This also means that for a running Pipeline it will be in an incomplete state, with un-terminated blocks.
This structure describes all possible Pipelines, whether a simple set of steps, or a complex set of nested parallels, and is designed to grow at runtime as the Pipeline executes. This also means that for a running Pipeline it will be in an incomplete state, with un-terminated blocks.

# Concepts

Expand All @@ -12,8 +12,8 @@ This may seem backwards, but it enables us to freely append to the Flow Graph as

**Key information is stored in a couple ways:**

* The specific subclass of the `FlowNode` used for a particular node is structurally imporant - for example `BlockStartNode` represents the start of a block
* `StepDescriptor`: most `FlowNode`s come from running `Steps` and implement `StepNode`. This means they you can get the `StepDescriptor` to determine their `Step` that produced them.
* The specific subclass of the `FlowNode` used for a particular node is structurally important - for example `BlockStartNode` represents the start of a block
* `StepDescriptor`: most `FlowNode`s come from running `Steps` and implement `StepNode`. This means they can get the `StepDescriptor` to determine their `Step` that produced them.
* Parent relationships allow us to so split into parallel branches and track them independently. We may have multiple nodes with a given parent (at the start of a parallel) or one node with multiple parents (the end of a parallel)
* `Action`s give us all the key attributes of the `FlowNode`, see the section below for a quick reference

Expand Down Expand Up @@ -75,12 +75,12 @@ This may seem backwards, but it enables us to freely append to the Flow Graph as
* **There are no bounds on the size of the flow graph, it may have thousands of nodes in it.** Real users with complex Pipelines will really generate graphs this size. Yes, really.
* **Repeat: there are no bounds on the size of the flow graph. This means if you use recursive function calls to iterate over the Flow Graph you will get a `StackOverFlowError`!!!** Use the `AbstractFlowScanner` implementations - they're free of stack overflows and well-tested.
* As a back of napkin estimate, most Flow Graphs fall in the 200-700 `FlowNode` range
* `GraphListener` gotcha: because the listener is invoked for each new `FlowNode`, if you implement some operation that iterates over a lot of the Flow Graph then you've just done an O(n^2) operation and it can result in very high CPU use. This can bog down a Jenkins master if not done carefully.
* `GraphListener` gotcha: because the listener is invoked for each new `FlowNode`, if you implement some operation that iterates over a lot of the Flow Graph then you've just done an O(n^2) operation and it can result in very high CPU use. This can bog down a Jenkins controller if not done carefully.
- Careful use of the methods above to iterate/find enclosing flownodes can make this much safer


# Anti-gotchas

* It may seem intimidating but the Flow Graph has a TON of useful information ripe for analysis and visualization!
* The gotchas above are mostly a problem for plugins that try to manipulate the Flow Graph or do automated analysis while Pipelines are running -- if you use the utilities and wait for Pipelines to complete then most of the problems go away.
* The actual data model is quite simple.
* The actual data model is quite simple.
31 changes: 15 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
~ THE SOFTWARE.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.16</version>
<relativePath />
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.48</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-api</artifactId>
<version>${revision}${changelist}</version>
<version>${changelist}</version>
<packaging>hpi</packaging>
<name>Pipeline: API</name>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
Expand All @@ -44,9 +44,9 @@
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:[email protected]:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>
<repositories>
Expand All @@ -62,19 +62,18 @@
</pluginRepository>
</pluginRepositories>
<properties>
<revision>2.42</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.176.4</jenkins.version>
<java.level>8</java.level>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.332.1</jenkins.version>
<no-test-jar>false</no-test-jar>
<useBeta>true</useBeta>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.176.x</artifactId>
<version>16</version>
<artifactId>bom-2.332.x</artifactId>
<version>1763.v092b_8980a_f5e</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down Expand Up @@ -119,7 +118,7 @@
<dependency>
<groupId>org.jenkins-ci.test</groupId>
<artifactId>docker-fixtures</artifactId>
<version>1.10</version>
<version>166.v912b_95083ffe</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/org/jenkinsci/plugins/workflow/FilePathUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
import hudson.remoting.Channel;
import hudson.remoting.VirtualChannel;
import hudson.slaves.ComputerListener;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import jenkins.model.Jenkins;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
Expand All @@ -63,24 +62,24 @@ public class FilePathUtils {
* Note that if an administrator disconnects an agent, configures and connects an unrelated agent with the same name,
* and then this method is called on a path created against the original connection, the result may be misleading.
* @param f a file, possibly remote
* @return a node name ({@code ""} for master), if known, else null
* @return a node name ({@code ""} for the controller), if known, else null
*/
public static @CheckForNull String getNodeNameOrNull(@Nonnull FilePath f) {
public static @CheckForNull String getNodeNameOrNull(@NonNull FilePath f) {
return Listener.getChannelName(f.getChannel());
}

/**
* Same as {@link #getNodeNameOrNull} but throws a diagnostic exception in case of failure.
* @param f a file, possible remote
* @return a node name ({@code ""} for master), if known
* @return a node name ({@code ""} for the controller), if known
* @throws IllegalStateException if the association to a node is unknown
*/
public static @Nonnull String getNodeName(@Nonnull FilePath f) throws IllegalStateException {
public static @NonNull String getNodeName(@NonNull FilePath f) throws IllegalStateException {
String name = getNodeNameOrNull(f);
if (name != null) {
return name;
} else {
throw new IllegalStateException("no known slave for " + f + " among " + Listener.getChannelNames());
throw new IllegalStateException("no known agent for " + f + " among " + Listener.getChannelNames());
}
}

Expand All @@ -90,7 +89,7 @@ public class FilePathUtils {
* @param path a path as returned by {@link FilePath#getRemote}
* @return a corresponding file handle, if a node with that name is online, else null
*/
public static @CheckForNull FilePath find(@Nonnull String node, @Nonnull String path) {
public static @CheckForNull FilePath find(@NonNull String node, @NonNull String path) {
Jenkins j = Jenkins.getInstanceOrNull();
if (j == null) {
return null;
Expand All @@ -113,7 +112,7 @@ private FilePathUtils() {}

private static final Map<VirtualChannel,String> channelNames = Collections.synchronizedMap(new WeakHashMap<>());

static String getChannelName(@Nonnull VirtualChannel channel) {
static String getChannelName(@NonNull VirtualChannel channel) {
String channelName = channelNames.get(channel);

if (channelName == null) {
Expand Down Expand Up @@ -143,7 +142,7 @@ static Collection<String> getChannelNames() {
addChannel(c.getChannel(), c.getName());
}
}
@Override public void preOnline(Computer c, Channel channel, FilePath root, TaskListener listener) throws IOException, InterruptedException {
@Override public void preOnline(Computer c, Channel channel, FilePath root, TaskListener listener) {
addChannel(channel, c.getName());
}

Expand Down
Loading