New functionality by groovy-shared library
This PR extend plugin functionality in simple way and provide a solution for end-user with much more then one lock() step.
Fix #148 Fix #207 Fix #213 Fix #251 Fix #341 Fix #455 Fix #428 Fix #381 Close #253
Following PRs may closed by this changes. Close #307
Testing done
Proposed upgrade guidelines
N/A
Localizations
- [ ] English
- [ ] German
- [ ] French
- [ ] Slovak
- [ ] Czech
- [ ] ...
Submitter checklist
- [ ] The Jira / Github issue, if it exists, is well-described.
- [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples).
- The changelog generator for plugins uses the pull request title as the changelog entry.
- Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during the upgrade.
- [ ] There is automated testing or an explanation that explains why this change has no tests.
- [ ] New public functions for internal use only are annotated with
@NoExternalUse. In case it is used by non java code theUsed by {@code <panel>.jelly}Javadocs are annotated.
- [ ] New or substantially changed JavaScript is not defined inline and does not call
evalto ease the future introduction of Content Security Policy (CSP) directives (see documentation). - [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [ ] For new APIs and extension points, there is a link to at least one consumer.
- [ ] Any localizations are transferred to *.properties files.
- [ ] Changes in the interface are documented also as examples.
Maintainer checklist
Before the changes are marked as ready-for-merge:
- [ ] There is at least one (1) approval for the pull request and no outstanding requests for change.
- [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [ ] Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically. See also release-drafter-labels.
- [ ] If the change needs additional upgrade steps from users, the
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example). - [ ] java code changes are tested by automated test.
Hi @mPokornyETM, would be nice to have these features. Is there any plan on continuing this PR?
Hi @mPokornyETM, would be nice to have these features. Is there any plan on continuing this PR?
Hi, which features exactly you need?
My use case is the following: we need to disable branches from a multibranch pipeline on demand, but as that is not supported by Jenkins, we may go by the lock path, that is, skip the build if a resource is (manually) reserved.
However, there is no visual indication whether that branch is locked or not in the jobs view, only on the resources page which is not immediate to notice. So I was thinking on adding a column to the jobs view (same as https://github.com/jenkinsci/extra-columns-plugin) showing if a lock is locked or not. I think this would require https://github.com/jenkinsci/lockable-resources-plugin/issues/207 to be implemented.
Explaining this here made me thing that this may be already available from the Java point of view?
My use case is the following: we need to disable branches from a multibranch pipeline on demand, but as that is not supported by Jenkins, we may go by the lock path, that is, skip the build if a resource is (manually) reserved.
However, there is no visual indication whether that branch is locked or not in the jobs view, only on the resources page which is not immediate to notice. So I was thinking on adding a column to the jobs view (same as https://github.com/jenkinsci/extra-columns-plugin) showing if a lock is locked or not. I think this would require #207 to be implemented.
Explaining this here made me thing that this may be already available from the Java point of view?
maybe is this what you need
LRM.getResourcesFromBuild(
see also:
public List<LockableResource> getResourcesFromBuild(Run, ?> build)
in
src\main\java\org\jenkins\plugins\lockableresources\LockableResourcesManager.java
maybe is this what you need LRM.getResourcesFromBuild()
I don't think this is useful to me (for I wanted originally, maybe for a different column can be useful), as I need to show the state of a given lock, whether it is being using or not by any build. But looking at the code, I think I may use isFree or isReserved on a resource. I'll try to go that way, thanks.