#763 Initial comment for PR - #571
Merged by pingou. Opened by cverna.
cverna/pagure pagure_571  into  master

Download 763.patch
no initial comment

Pull-Request has been updated

Does code need to be added to return the initial_comment as part of the JSON representation of a PR?

I would say no , as initial_comment becomes a normal comment once the PR is created.
So it should be with all the PR's comments in the JSON.

I guess I would have use form.initial_comment.data != '', maybe with a .strip() as well to prevent the ' '

Pull-Request has been updated

Looks good to me, should we add some tests or adjust the existing ones?

I ll change that :)

I did look at the current tests in test_pagure_flask_ui_fork. But could not really see what I could adjust to test the comment.

I ll have a deeper look, otherwise maybe it needs a new test.

You could just add an initial_comment when creating a PR and check if the comment is indeed added to the PR.

Pull-Request has been updated

Pull-Request has been updated

Pull-Request has been rebased

I have added the test and changed the if statement

Should we strip the comment here as well then?

kinda curious of checking what happens if initial_comment is ''.

I guess it would not hurt :smile:

I have tested it locally and it just create a comment with ''. Which I think is correct as the comment field was not empty.
Do you want to add a test case for that ? Or a case where the comment is only whitespaces ?

I was thinking of a test case with only whitespaces or an empty string (which is what I meant by '').

haha :laughing: . I ll add this

Pull-Request has been updated

I have added the test case with initial_comment set to ''

Cool, thanks!

Pull-Request has been merged by pingou

Metadata