Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Commit

Permalink
Remove the forward() from the rebuild AJAX call.
Browse files Browse the repository at this point in the history
We don't know why the forward exists. It raises a 404 error in the JS console,
so the URL it's trying to forward to apparently doesn't exist/make sense. And
we don't know what work there is to do at the point of the forward() call
anyway, since rebuilding has already been kicked off.
  • Loading branch information
Yash Parghi committed Oct 20, 2014
1 parent cf578ee commit 730ed65
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/main/java/com/etsy/jenkins/MasterProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public class MasterProject
extends Project<MasterProject, MasterBuild>
implements TopLevelItem {

@BindingAnnotation
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
@BindingAnnotation
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface PingTime {}

Expand All @@ -71,7 +71,7 @@ public class MasterProject

@DataBoundConstructor
public MasterProject(
ItemGroup parent,
ItemGroup parent,
String name) {
super(parent, name);
this.jobNames = Sets.<String>newHashSet();
Expand All @@ -97,7 +97,7 @@ public List<Builder> getBuilders() {
}

public List<Descriptor<Publisher>> getPotentialPublisherDescriptors() {
List<Descriptor<Publisher>> publishers =
List<Descriptor<Publisher>> publishers =
Lists.<Descriptor<Publisher>>newArrayList(MasterMailer.DESCRIPTOR);
if (hudson.getPlugin("ircbot") != null) {
publishers.add(IrcPublisher.DESCRIPTOR);
Expand All @@ -117,14 +117,13 @@ protected Class<MasterBuild> getBuildClass() {
return MasterBuild.class;
}

public void doRebuild(StaplerRequest req, StaplerResponse res)
public void doRebuild(StaplerRequest req, StaplerResponse res)
throws IOException, ServletException {
checkPermission(Permission.READ);

AbstractProject subProject = this.getSubProject(req);
MasterBuild masterBuild = this.getMasterBuild(req);
masterBuild.rebuild(subProject);
res.forward(masterBuild, masterBuild.getUrl(), req);
}

private AbstractProject getSubProject(StaplerRequest req)
Expand Down Expand Up @@ -174,7 +173,7 @@ public FormValidation doCheck(
if (item == null) {
return FormValidation.error(
Messages.BuildTrigger_NoSuchProject(
projectName,
projectName,
AbstractProject.findNearest(projectName).getName()));
}
if (!(item instanceof AbstractProject)) {
Expand Down Expand Up @@ -207,9 +206,9 @@ public AutoCompletionCandidates doAutoCompleteSubProjects(
}

@Override
protected void submit(StaplerRequest req, StaplerResponse res)
protected void submit(StaplerRequest req, StaplerResponse res)
throws IOException, ServletException, Descriptor.FormException {

// Handle the job list
jobNames.clear();
for (TopLevelItem item : Hudson.getInstance().getItems()) {
Expand Down Expand Up @@ -244,7 +243,7 @@ public Set<String> getSubProjectNames() {
}

@Extension
public static final TopLevelItemDescriptor DESCRIPTOR =
public static final TopLevelItemDescriptor DESCRIPTOR =
new TopLevelItemDescriptor() {

private Injector injector = Guice.createInjector(new MasterModule());
Expand Down

0 comments on commit 730ed65

Please sign in to comment.