Skip to content
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

ensure that the closed_at is set for closed issues #5449

Merged
merged 1 commit into from
Dec 2, 2018

Conversation

r-52
Copy link

@r-52 r-52 commented Dec 2, 2018

right now the closed_at field for json responses is not filled during the APIIssue creation for api responses.

For a closed issue you get a result like:
(truncated json)

"state":"open","comments":0,"created_at":"2018-11-29T16:39:24+01:00",
"updated_at":"2018-11-30T10:49:19+01:00","closed_at":null,
"due_date":null,"pull_request":null}

which has no information about the closing date. (which exists in the db and ui)
With this PR the result changes to this:

(truncated json)

"assignee":null,"assignees":null,
"state":"closed",
"comments":0,"created_at":"2018-11-29T16:43:05+01:00",
"updated_at":"2018-12-02T19:17:05+01:00",
"closed_at":"2018-12-02T19:17:05+01:00",
"due_date":null,"pull_request":null}

It includes now the correct closed_at date for closed issues.

fixes: #5446

right now the `closed_at` field for json responses is not filled during
the `APIIssue` creation for api responses.

For a closed issue you get a result like:
```json
"state":"open","comments":0,"created_at":"2018-11-29T16:39:24+01:00",
"updated_at":"2018-11-30T10:49:19+01:00","closed_at":null,
"due_date":null,"pull_request":null}
```
which has no information about the closing date. (which exists in the
db and ui)
with this PR the result changes to this:

```json
:null,"assignee":null,"assignees":null,
"state":"closed",
"comments":0,"created_at":"2018-11-29T16:43:05+01:00",
"updated_at":"2018-12-02T19:17:05+01:00",
"closed_at":"2018-12-02T19:17:05+01:00",
"due_date":null,"pull_request":null}
```

fixes: go-gitea#5446
Signed-off-by: Roman <[email protected]>
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@ce4885f). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5449   +/-   ##
=========================================
  Coverage          ?   37.56%           
=========================================
  Files             ?      317           
  Lines             ?    46824           
  Branches          ?        0           
=========================================
  Hits              ?    17588           
  Misses            ?    26737           
  Partials          ?     2499
Impacted Files Coverage Δ
models/issue.go 48.4% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce4885f...8644320. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 2, 2018
@lafriks lafriks added this to the 1.7.0 milestone Dec 2, 2018
@bkcsoft bkcsoft added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 2, 2018
@bkcsoft bkcsoft added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 2, 2018
@techknowlogick techknowlogick merged commit 2d707fe into go-gitea:master Dec 2, 2018
@techknowlogick
Copy link
Member

@romankl please send backport to release/v1.6 branch 😄

@r-52
Copy link
Author

r-52 commented Dec 2, 2018

@techknowlogick sure!

@r-52 r-52 deleted the r-fix-json-issue-info branch December 2, 2018 20:49
@techknowlogick techknowlogick added the backport/done All backports for this PR have been created label Dec 2, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Web API: closed_at field null even though ticket is closed.
5 participants