Branch API2.0.8Minimum Jenkins requirement: 1.642.3ID: branch-api
This plugin provides an API for multiple branch based projects.
The following concepts are provided:
- Multibranch projects: projects consisting in a group of several projects, one for each defined branch.
- Organizational folders: a folder-like collection of Multibranch projects, one per repository.
- Branch properties: add additional information linked to the branch, which can then be used to take decisions. Some properties are provided:
- Do not trigger builds for branch.
- Do not trigger builds for organizational folder.
- Override triggering behaviour for multibranch project or organizational folder.
- Untrusted author.
- Limit builds for a branch to a certain rate.
- Discard old builds for branch.
If you have to try and diagnose issues with events or indexing, the following information may be of assistance:
Jobs triggered by SCM Events try to capture their origin.
The origin is available as a tool-tip on the build cause:
This can be very helpful to quickly identify where events that trigger builds are coming from.
More detailed event processing information is available from the event logs.
By default, the CloudBees Folders plugin will only retain the logs of the last scan / index. If you are having issues with scanning / indexing, it can help to turn on the retention with the system property com.cloudbees.hudson.plugins.folder.computed.FolderComputation.BACKUP_LOG_COUNT (note that you can write directly to that field using the System Groovy Console, so you can change the value on a running system without a restart)
The Multi-branch projects will log the initial arrival of events and any routing decisions in the $JENKINS_HOME/logs/jenkins.branch.MultiBranchProject.log file (which will be rolled every 32kB, limit of 5 files)
- Once an event has been routed to a specific Multi-branch project, the responsibility for logging the event will belong with that Multi-branch project and will be stored in the $JENKINS_HOME/jobs/$PATH_TO_PROJECT/indexing/events.log (which will be rolled every 150kB, limit of BACKUP_LOG_COUNT files)
The Organization folder projects will log the initial arrival of events and any routing decisions in the $JENKINS_HOME/logs/jenkins.branch.OrganizationFolder.log file (which will be rolled every 32kB, limit of 5 files)
- Once an event has been routed to a specific Organization folder project, the responsibility for logging the event will belong with that Organization folder project and will be stored in the $JENKINS_HOME/jobs/$PATH_TO_PROJECT/computation/events.log (which will be rolled every 150kB, limit of BACKUP_LOG_COUNT files)
- JENKINS-37364 Tabs should indicate the number of items they have
- JENKINS-34522 On versions of Jenkins core with this change merged, provide the correct action text for Scan now
- JENKINS-42511 When events are concurrent with scanning, ensure that events and scanning do not create shadow items resulting in duplicate builds with the same build number
- JENKINS-34564 Allow workspace paths to be less than 54 characters
- JENKINS-42009 Update some test harness related code
- JENKINS-42151 Pick up API changes and return event processing to multi-threaded
- JENKINS-42234 A missing call to SCMHeadEvent.isMatch() could cause some events to trigger incorrect branches
- JENKINS-42000 If there is a problem when scanning an Organization Folder, do not storm off in a huff and delete all the jobs in the organization folder!
- JENKINS-41948 (workaround) Restore some binary compatibility by adding a bridge method that got removed with the upgrade to CloudBees Folders 5.17
- JENKINS-41980 SCM events should be ignored when suppressing SCM triggering.
- JENKINS-41927 Orphaned branches should have name in
- JENKINS-41883 Global event logs were being overwritten on every event making them less useful than they should be
- JENKINS-41795 Report the origin of SCM Events when available
- JENKINS-41517 Branch API's event logging could be more consistent in reporting the event class
- JENKINS-41171 Superfluous New Item added for "Organization Folder"
- JENKINS-41124 Can't get a human readable job name anymore
- JENKINS-41255 Upgrading from a navigator that did not assign consistent source ids to a version that does assign consistent source ids causes a build storm on first scan
- JENKINS-41121 GitHub Branch Source upgrade can cause a lot of rebuilds
- JENKINS-41209 NPE during loading of branch jobs when migrating from 1.x to 2.x
- JENKINS-41125 Branch API 2.0.0 event processing doesn't consistently mangle names
- Please read this Blog Post before upgrading
- JENKINS-40865 Org folders do not encode child project names
- JENKINS-40876 ObjectMetadataAction objectUrl never gets populated for PRs or Branches
- Log exceptions during scan/indexing with tracking details
- Where the SCM Source reports tags (no known implementations yet), tags should not be built by default
- Suppress scans when configuration unchanged but trigger if there has not been a scan with current configuration
- JENKINS-40832 Primary branches should have their name in bold
- JENKINS-40829 Provide an API to retrieve a SCMSource from a given Item
- JENKINS-40828 Provide a way for tests using MockSCMController to inject failures
- JENKINS-40827 Clarify the content of ObjectMetadataAction's getDescription() and getDisplayName()
- JENKINS-39355 Pick up SCM API improvements
- JENKINS-39816 Fix PCT against >= 2.16
- JENKINS-39520 CustomOrganizationFolderDescriptor breaks when multiple branch sources are added
- JENKINS-39026 Add a ViewJobFilter specialized for filtering by Branch
- JENKINS-38987 Use contextual naming for SCMHead/SCMSource/SCMNavigator instances
- Available in the experimental update center only
- Pick up API changes from SCM API 2.0 (requires SCM API 2.0.1-beta-1 and if you have either of the github-branch-source or bitbucket-branch-source plugins you must upgrade them to at least 2.0.0-beta-1)
- JENKINS-39520 Error when dynamically installing multiple branch source plugins.
- JENKINS-34564 Branch projects now get custom workspace paths inside the node’s workspace directory, capped by default at 80 characters and using only ASCII letters, numbers, and simple punctuation (in particular, no %).
- JENKINS-37219 Added a job property for overriding the implicit branch indexing trigger flag, allowing a multibranch Jenkinsfile to customize its own triggering behavior after the initial build.
|Some projects running external processes that cannot handle even moderately long pathnames will not work with the new default workspace locations. The system property jenkins.branch.WorkspaceLocatorImpl.PATH_MAX may be set to 0 to restore the previous behavior (which will then break some processes which cannot handle funny characters, or projects using long branch names etc.). The default value is 80; values as low as 54 (but no lower) are possible. When feasible, fix the external process to be more robust, or on Windows use
as a prefix before the remote filesystem root.
Another workaround in Pipeline scripts is to use the ws step with an absolute pathname. You can then choose any path, and concurrent builds will still get distinct workspaces automatically; but you are on the hook for finding a valid path on the node, unrelated projects might overwrite each other’s workspaces between builds (reducing beneficial caches of SCM checkouts and the like), and the custom workspaces will not be automatically deleted if the branch project is deleted. The first problem could be avoided by using a pathname like ../custom rather than an absolute path.
Note that the sshagent Pipeline step (SSH Agent Plugin) when used inside an Image.inside block (Docker Pipeline Plugin) will not currently work when the workspace path exceeds 108 characters, due to a poor choice of constant in most Linux kernels: JENKINS-36997.
A full fix should probably come in JENKINS-2111 for all project types.
- JENKINS-34246 Improve organization folder API to allow project recognizers to indicate removed repositories or edited configuration.
- JENKINS-32178 Broken links in custom views of multibranch projects.
- JENKINS-32396 Option to suppress automatic SCM trigger.
- JENKINS-33819 OrphanedItemStrategy is now propagated to multibranch projects.
- Added extra log messages from branch indexing.
- A regression was introduced in 1.7 while JENKINS-34259 was fixed.
- JENKINS-34259 Some links (in left menu) in Pipeline Multibranch projects and GitHub Organization projects are broken when there are no branch sources defined or the GitHub Organization is empty.
- Documented build environment variables.
- JENKINS-33808 Support for Item categorization. More information about this new feature in core here JENKINS-31162
- JENKINS-32670 Suppress whole branch property UI for project types which do not have any supported branch properties, such as multibranch Pipeline.
- JENKINS-33106 Organization folder types not displayed under New Item without a restart.
- JENKINS-33309 Using API for defining variables associated with pull requests.
- JENKINS-32782 Welcome view failed to display Delete Folder link.
- Prevent NPE while unserialization of BranchSources with a null SCMSource
- JENKINS-32493 Adapt to Parent POM 2.3
- JENKINS-31949 Bogus New Item option inside folders.
- JENKINS-31516 Children not reindexed on organization folder reindex.
- Useless MultiBranchProjectDescriptor.getSCMDescriptors API deleted.
- JENKINS-31381 Show more helpful welcome text for empty multibranch projects and organization folders.
- Fix to RateLimitBranchProperty for the benefit of Workflow multibranch properties step.
- Ensure that SCMSource.setOwner is called consistently.
- JENKINS-30252 New environment variable BRANCH_NAME.
- JENKINS-30595 Implemented new API.
- Suppress non-read view permissions on multi-branch projects within an organization folder.
- Add PeriodicFolderTrigger by default.
- JENKINS-30744 Fixed handling of branches with slashes in the name.
- JENKINS-31432 NPE under some conditions.
Warning: settings compatibility for this release has not yet been tested. If you have an existing project using the Literate plugin in particular, the dead branch retention strategy might be reset to “delete immediately” after the upgrade.
- Introduced an “organization folder” top-level item type. Hidden unless there are some SCM providers (GitHub Branch Source Plugin), and project factories (Pipeline Plugin).
- Major refactoring to use ComputedFolder API in CloudBees Folders Plugin.
- Always run branch indexing on the master node.
- Compatibility with 1.576+ icon captions.
- API changes useful for Workflow.
- Initial release.