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

[JENKINS-33309] Use ChangeRequestAction #29

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

jglick
Copy link
Member

@jglick jglick commented Mar 8, 2016

Downstream of jenkinsci/scm-api-plugin#7.

Can use cloudbeers/PR-demo#9 as a demo.

@reviewbybees

Also make sure SCMHead.actions are exported to REST.
@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@ghost
Copy link

ghost commented Mar 8, 2016

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);
Copy link
Member

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?

Copy link
Member

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)?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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 Actionables, 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).

Copy link
Member

Choose a reason for hiding this comment

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

Ok, got it.

@amuniz
Copy link
Member

amuniz commented Mar 10, 2016

🐝

@jglick
Copy link
Member Author

jglick commented Mar 10, 2016

@reviewbybees done

(@stephenc merge if you agree)

jglick added a commit that referenced this pull request Mar 11, 2016
@jglick jglick merged commit 72ab0f9 into jenkinsci:master Mar 11, 2016
@jglick jglick deleted the SCMHead-Actionable-JENKINS-33309 branch March 11, 2016 21:04
jglick added a commit that referenced this pull request Mar 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants