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

Introduce SubTask.getOwnerExecutable #7599

Merged
merged 2 commits into from
Jan 26, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented Jan 23, 2023

#5733 introduced a way to go from PlaceholderExecutable to WorkflowRun using supported APIs. For example: a Pipeline job

node('some-label') {
  sh 'something'
}

is running the sh step, and given the node block executor slot you want to look up the build which encompasses that (and perhaps other node blocks). However, if some-label were currently unavailable and this item was sitting in the queue waiting to be scheduled, there would be no PlaceholderExecutable yet, only a PlaceholderTask, and there was no supported way to find the corresponding WorkflowRun. Various plugins therefore added a dependency on workflow-durable-task-step and directly cast to PlaceholderTask to call its run or runForDisplay methods; for example I could find jenkinsci/blueocean-plugin#2388 as well as jenkinsci/throttle-concurrent-builds-plugin#197 (though for now this still needs a workflow-durable-task-step dep due to another call) as well as a number more in less common plugins. This new API allows the navigation to the owning build to be done in a proper way, assuming jenkinsci/workflow-durable-task-step-plugin#287.

Testing done

N/A

Proposed changelog entries

  • Developer: Introduced an API SubTask.getOwnerExecutable to be implemented in Pipeline.

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least two (2) approvals 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.
  • 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).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Jan 24, 2023
@NotMyFault NotMyFault merged commit 932a632 into jenkinsci:master Jan 26, 2023
@jglick jglick deleted the getOwnerExecutable branch January 26, 2023 12:14
jglick added a commit to jglick/workflow-durable-task-step-plugin that referenced this pull request Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Changes which impact plugin developers ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants