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

New functionality by groovy-shared library #457

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

mPokornyETM
Copy link
Contributor

@mPokornyETM mPokornyETM commented Feb 8, 2023

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 the Used by {@code <panel>.jelly} Javadocs are annotated.
  • New or substantially changed JavaScript is not defined inline and does not call eval to 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-needed label 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.

PULL_REQUEST_TEMPLATE.md Outdated Show resolved Hide resolved
@mPokornyETM mPokornyETM added Good for Groovy shared library It might be done in groovy shared library much more easier than here enhancement dependencies Dependeny updates java Pull requests that update Java code documentation resource labels enhancement Improvements for resource-labels lock Jenkins node Lockable resource interactions with Jenkins nodes. Need test Automated tests shall be extended. labels Feb 8, 2023
@mPokornyETM mPokornyETM changed the title Provide groovy-shared library New functionality by groovy-shared library Feb 8, 2023
@frsantos
Copy link

frsantos commented Oct 4, 2024

Hi @mPokornyETM, would be nice to have these features. Is there any plan on continuing this PR?

@mPokornyETM
Copy link
Contributor Author

Hi @mPokornyETM, would be nice to have these features. Is there any plan on continuing this PR?

Hi, which features exactly you need?

@frsantos
Copy link

frsantos commented Oct 4, 2024

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?

@mPokornyETM
Copy link
Contributor Author

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 getResourcesFromBuild(Run build)
in
src\main\java\org\jenkins\plugins\lockableresources\LockableResourcesManager.java

@frsantos
Copy link

frsantos commented Oct 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment