Skip to content

CreateUser, DeleteUser and AddParticipant endpoints #145

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

Merged
merged 2 commits into from
Jul 10, 2018

Conversation

jawoszek
Copy link

@jawoszek jawoszek commented Jul 2, 2018

For issue #144.

It's adding three endpoints - PUT for PR participant (main goal of PR) and two endpoints for admin api (POST and DELETE user) which are needed for participant PUT integ tests.

@jawoszek jawoszek force-pushed the jawoszek/NewAdminAndPREndpoints branch 3 times, most recently from 77b8948 to fc7d2ff Compare July 2, 2018 07:56
@cdancy cdancy self-assigned this Jul 2, 2018
@cdancy cdancy added this to the v2.1.5 milestone Jul 2, 2018
return new AutoValue_DetailedUser(BitbucketUtils.nullToEmpty(errors), name, emailAddress, id, displayName,
active, slug, type, directoryName, deletable, lastAuthenticationTimestamp, mutableDetails, mutableGroups);
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Lets move the changes here into the User domain object instead of creating something new.

Copy link
Author

@jawoszek jawoszek Jul 2, 2018

Choose a reason for hiding this comment

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

But what about the errors? I mean, there was instruction somewhere that domain objects that are used to create request can't be an error holders.

@Fallback(BitbucketFallbacks.RequestStatusOnError.class)
@ResponseParser(RequestStatusParser.class)
@POST
RequestStatus postUser(@QueryParam("name") String name,
Copy link
Owner

@cdancy cdancy Jul 2, 2018

Choose a reason for hiding this comment

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

Lets change the method name to createUser.

@Path("/{project}/repos/{repo}/pull-requests/{pullRequestId}/participants/{userSlug}")
@Fallback(ParticipantsOnError.class)
@PUT
Participants putParticipant(@PathParam("project") String project,
Copy link
Owner

Choose a reason for hiding this comment

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

Lets change the method name to addParticipant.

@cdancy
Copy link
Owner

cdancy commented Jul 2, 2018

A few comments on changing the names of things. Basically all methods named "put" replace with "add" and methods named "post" replace with "create". Make sure to update tests as well. Other than that the PR is in pretty good shape.

@cdancy
Copy link
Owner

cdancy commented Jul 2, 2018

And make sure to merge the DetailedUser into the already present User object and we should be good to go.

Feel free to give the project a star/like as well :)

@cdancy cdancy changed the title PostUser, DeleteUser and PutParticipant endpoints CreateUser, DeleteUser and AddParticipant endpoints Jul 2, 2018
@jawoszek jawoszek force-pushed the jawoszek/NewAdminAndPREndpoints branch 3 times, most recently from 78a68fa to 03ed76a Compare July 3, 2018 08:40
@cdancy
Copy link
Owner

cdancy commented Jul 10, 2018

When I run ./gradlew clean build mockTest I get 12 PMD violations. Have you run this locally to see how things fare? It's curious that travis did not catch this...

@jawoszek jawoszek force-pushed the jawoszek/NewAdminAndPREndpoints branch from 03ed76a to 1ebeeb1 Compare July 10, 2018 14:09
@cdancy cdancy merged commit c16ccde into cdancy:master Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants