Skip to content

Conversation

mrdima
Copy link

@mrdima mrdima commented Mar 13, 2019

Based on the work of nemccarthy#123
We already use the original PR of tettaji successfully for the last one and a half years. In our workflow we do not automatically merge by only a successful jenkins build, we also require 2 human peer reviews next to the jenkins (build) review. We merge "manually" when we desire to do so after these 3 approvals.

Copy link

@proski proski left a comment

Choose a reason for hiding this comment

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

Good idea, but the implementation is somewhat dated. The formatting is bad in many places. A class is added for no good reason. Help files are missing for the new options.

repository.markStatus(pullRequestId, "NEEDS_WORK");
}
}
}
Copy link

Choose a reason for hiding this comment

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

I don't think StashMarkStatus needs to be a separate class. I'd rather stop proliferation of classes that have no state or map 1-to-1 to the existing classes.

Choose a reason for hiding this comment

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

Where is the best place for this handler?

Copy link

Choose a reason for hiding this comment

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

I would just put that code where it's being called. If the code gets too long, we care refactor it across more natural lines.



public StashApiClient(String stashHost, String username, String password, String project, String repositoryName, boolean ignoreSsl) {
this.credentials = new UsernamePasswordCredentials(username, password);
this.project = project;
this.username = username;
Copy link

Choose a reason for hiding this comment

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

We are going to reformat the whole codebase and enable automatic formatting, which would make formatting issues irrelevant. However, please use reasonable formatting in your submissions to facilitate reviews.

PutMethod httpput = new PutMethod(path);
//http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html; section 14.10.
//tells the server that we want it to close the connection when it has sent the response.
//address large amount of close_wait sockets client and fin sockets server side
Copy link

Choose a reason for hiding this comment

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

Please use complete sentences in large comments and add space after // for readability.

Choose a reason for hiding this comment

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

The same comment is used also in 2 other places. Do you think it should be also fixed there? Btw it just a extract from html rfc about closing connection - IMHO this comment can be removed entirely.

Copy link

Choose a reason for hiding this comment

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

Let's remove it then.

try {
//Run the http request in a future task so we have the opportunity
//to cancel it if it gets hung up; which is possible if stuck at
//socket native layer. see issue JENKINS-30558
Copy link

Choose a reason for hiding this comment

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

That issue is closed with "cannot reproduce". https://issues.jenkins-ci.org/browse/JENKINS-30558

Choose a reason for hiding this comment

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

This ticket is mentioned in few other places should we also remove it entirely?

Copy link

Choose a reason for hiding this comment

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

At least don't add it blindly. We can cleanup the existing comments in a separate PR.

</f:entry>
<f:entry title="Mark PR with Needs Work on build failure" field="needsWorkOnBuildFailure">
<f:checkbox default="false"/>
</f:entry>
Copy link

Choose a reason for hiding this comment

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

Please add html help files for those fields.

Copy link

@jakub-bochenski jakub-bochenski left a comment

Choose a reason for hiding this comment

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

I second @proski comments.

Please take care to add good help/documentation. It's great that this works for you, but describing the feature well is key to enabling others to make use of it.

@jakub-bochenski
Copy link

With the changes just merged to master local build should format the files automatically

@dawidmalina
Copy link

@jakub-bochenski, @proski I think that @mrdima just grabbed original pull request nemccarthy#123 as is without any code modification so he is not directly guilty :)

As I'm also interested in this change I can give a hand on this. Just please guide us through all required by you code change which should be applied.

@dawidmalina
Copy link

I've created new pull request with provided resolved conflict, formatting and help files in #56

@proski
Copy link

proski commented Mar 15, 2019

Let's close this PR in favor of PR #56 to avoid parallel discussions. It's out of date anyway.

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.

4 participants