-
Notifications
You must be signed in to change notification settings - Fork 142
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
[JENKINS-33309] Use ChangeRequestAction #29
[JENKINS-33309] Use ChangeRequestAction #29
Conversation
Also make sure SCMHead.actions are exported to REST.
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
// Note: not using Branch.name, since in the future that could be something different | ||
// than SCMHead.name, which is what we really want here. | ||
envs.put("BRANCH_NAME", projectFactory.getBranch(j).getHead().getName()); | ||
envs.put("BRANCH_NAME", head.getName()); | ||
ChangeRequestAction cr = head.getAction(ChangeRequestAction.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who is adding this action to head
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IOW where is the TransientActionFactory
implementation (as per jenkinsci/scm-api-plugin#7)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation is in github-branch-source
(see linked PR) and uses an override rather than TransientActionFactory
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. So there are currently two ways to add actions to an SCMHead
: extend it and override getAllActions
or add an implementation of TransientActionFactory
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. Similar to the situation for Actionable
s, where you can override getActions
, etc., from the inside; or use TransientActionFactory
from the outside. Actionable
also exposes addAction
from the outside, though this presumes that there is mutable persisted action storage, an imposition I did not really want to apply to SCMHead
(besides the other API problems with Actionable
mentioned in a linked JIRA ticket).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, got it.
🐝 |
@reviewbybees done (@stephenc merge if you agree) |
[JENKINS-33309] Use ChangeRequestAction
Downstream of jenkinsci/scm-api-plugin#7.
Can use cloudbeers/PR-demo#9 as a demo.
@reviewbybees