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

Patch request for system.boardcolumn generates incorrect audit trails #2192

Open
sahil143 opened this issue Jul 27, 2018 · 4 comments
Open

Comments

@sahil143
Copy link

Expected behavior

  1. oldValue and newValue of boardcolumn audit should have name of column instead of id
  2. Should not generate Audit trail for assignes and label on system.boardcolumns patch

Actual behavior

  1. BoardColumn Audit has columnIds
  2. Extra logs are generated

Steps to reproduce the problem

  1. Send a patch request to update boardcolumn
    ex: https://api.prod-preview.openshift.io/api/workitems/52a89cab-b23b-4b80-9cda-ed6a6de79d7b
    Payload:
{"data":{"id":"52a89cab-b23b-4b80-9cda-ed6a6de79d7b","attributes":{"version":8},"links":{"self":"https://api.prod-preview.openshift.io/api/workitems/52a89cab-b23b-4b80-9cda-ed6a6de79d7b"},"relationships":{"system.boardcolumns":{"data":[{"id":"7389fa7d-39c8-4865-8094-eda9a7836161","type":"boardcolumns"}]}},"type":"workitems"}}

  1. fetch the audit trail for that workItem
    Audit log for above workitem: http://jsoneditoronline.org/?id=469723b429ce3b6abac3d009202ab530
    Notice that assignee and labels audit log has no values and should not be genrated
@jarifibrahim
Copy link
Member

Should not generate Audit trail for assignes and label on system.boardcolumns patch

I cannot reproduce it. I tried reproducing it via tests and via locally running fabric8-ui.

@jarifibrahim
Copy link
Member

The issue is in the reorder API. The reorder API sets the field values of type list to [] (empty list) and the PATCH request removes these [] which generates the audit log.

@DhritiShikhar
Copy link
Contributor

@jarifibrahim does the UX confirm that we do not want event log for reorder event?

@jarifibrahim
Copy link
Member

@DhritiShikhar

@jarifibrahim does the UX confirm that we do not want event log for reorder event?

The issue is about how we deal the empty arrays. The reorder API adds [] to fields of kind list and the workitem update API removes this. This creates an event log that we do not need.

@jarifibrahim jarifibrahim removed their assignment Apr 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants