Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Inconsistency in comment id when creating vs showing #714

Closed
xcoulon opened this issue Feb 1, 2017 · 2 comments
Closed

Inconsistency in comment id when creating vs showing #714

xcoulon opened this issue Feb 1, 2017 · 2 comments
Assignees

Comments

@xcoulon
Copy link
Contributor

xcoulon commented Feb 1, 2017

There's an inconsistency in https://github.com/almighty/almighty-core/blob/master/design/comments.go: when creating a workitem comment, the returned id is a UUID, whereas when calling /comments/:id, the id is a string:

Payload definition to create a workitem comment:

var comment = a.Type("Comment", func() {
	a.Description(`JSONAPI store for the data of a comment.  See also http://jsonapi.org/format/#document-resource-object`)
	a.Attribute("type", d.String, func() {
		a.Enum("comments")
	})
	a.Attribute("id", d.UUID, "ID of comment", func() {
		a.Example("40bbdd3d-8b5d-4fd6-ac90-7236b669af04")
	})
	...
})

(source

Endpoint definition to show a comment:

a.Action("show", func() {
	a.Routing(
		a.GET("/:id"),
	)
	a.Params(func() {
		a.Param("id", d.String, "id")
	})
	...

(source)

Should we unify the comment ID to have a UUID in both cases ?

@kwk
Copy link
Collaborator

kwk commented Feb 1, 2017

I'd say yes. This needs to be unified to be d.UUID.

@xcoulon xcoulon self-assigned this Feb 2, 2017
@xcoulon
Copy link
Contributor Author

xcoulon commented Feb 2, 2017

@kwk ok, let me work on a fix for this, then.

xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 2, 2017
…s#714)

Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 2, 2017
…s#714)

Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 2, 2017
…s#714)

Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 2, 2017
…s#714)

Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 3, 2017
…s#714)

Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 3, 2017
…s#714)

Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 6, 2017
…s#714)

Taking review comments into account.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 6, 2017
…s#714)

minor editing of comments.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 6, 2017
…s#714)

Taking review comments into account.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 6, 2017
…s#714)

Taking review comments into account.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 6, 2017
…s#714)

Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 6, 2017
…s#714)

Taking review comments into account.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
xcoulon added a commit to xcoulon/fabric8-wit that referenced this issue Feb 7, 2017
…s#714)

Taking review comments into account.

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@kwk kwk closed this as completed in #716 Feb 7, 2017
kwk pushed a commit that referenced this issue Feb 7, 2017
Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Fixes #714 

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
AdamJ pushed a commit to AdamJ/almighty-core that referenced this issue Mar 7, 2017
…s#714) (fabric8-services#716)

Replaced the `string` type with `UUID` for the `ID` parameter
in the `show` and `update` operations.

Added a `comments_backbox_test.go` to verify that comments can
be shown with and without auth, but cannot be updated without auth
or when the user was not the comment author.

Fixes fabric8-services#714 

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants