fabric8-services / fabric8-wit

wit stands for Work Item Tracker
http://devdoc.almighty.io/
Apache License 2.0
45 stars 86 forks source link

Add onField to the /workitem/event response #2337

Closed jarifibrahim closed 5 years ago

jarifibrahim commented 6 years ago

~Depends on https://github.com/fabric8-services/fabric8-wit/pull/2335~

As a part of field renames (see https://github.com/fabric8-services/fabric8-wit/issues/2177) we need to update the /workitem/event/list response so that we can return the new field name without breaking existing functionality. We cannot return two event where one has name system.title and system_title. The client would show two events for a single event.

This PR adds onField attribute to the response. The new response looks like

{
  "data": [
    {
      "attributes": {
        "onField": "system_title",
        "name": "system.title",
        "newValue": "New Title",
        "oldValue": "work item 00000000-0000-0000-0000-000000000001",
        "revisionId": "00000000-0000-0000-0000-000000000002",
        "timestamp": "0001-01-01T00:00:00Z"
      },
      "id": "00000000-0000-0000-0000-000000000003",
      "relationships": {  ...   },
      "type": "events"
    }
  ]
}

NOTE - name will have the old field name (system.field) and onField will have the new field name (system_field)

codecov[bot] commented 6 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (osio-story-743-rename-fields@5300ce5). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##             osio-story-743-rename-fields    #2337   +/-   ##
===============================================================
  Coverage                                ?   70.09%           
===============================================================
  Files                                   ?      171           
  Lines                                   ?    16648           
  Branches                                ?        0           
===============================================================
  Hits                                    ?    11669           
  Misses                                  ?     3848           
  Partials                                ?     1131
Impacted Files Coverage Δ
workitem/workitemtype.go 73.62% <ø> (ø)
controller/workitem.go 81.72% <100%> (ø)
controller/workitemtype.go 67.6% <100%> (ø)
controller/work_item_events.go 77.77% <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 5300ce5...86a1580. Read the comment docs.

codecov-io commented 6 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (osio-story-743-rename-fields@1428510). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##             osio-story-743-rename-fields    #2337   +/-   ##
===============================================================
  Coverage                                ?   70.23%           
===============================================================
  Files                                   ?      171           
  Lines                                   ?    16687           
  Branches                                ?        0           
===============================================================
  Hits                                    ?    11720           
  Misses                                  ?     3833           
  Partials                                ?     1134
Impacted Files Coverage Δ
workitem/workitemtype.go 73.62% <ø> (ø)
controller/workitem.go 81.72% <100%> (ø)
controller/workitemtype.go 67.6% <100%> (ø)
controller/work_item_events.go 84.07% <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 1428510...d22188e. Read the comment docs.