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

Add table to track changes to report objects #31

Open
preaction opened this issue Aug 3, 2018 · 0 comments
Open

Add table to track changes to report objects #31

preaction opened this issue Aug 3, 2018 · 0 comments

Comments

@preaction
Copy link
Member

preaction commented Aug 3, 2018

As we begin to change the reports from what the reporter gave us, we need a way to track these changes. This tracking should give us a way to re-create the original report so as to be able to track down problems with reporter machines.

Create a new table, test_report_changes, with the following schema:

  • id - an autoincrement ID to identify the change
  • test_report_id - the ID of the test report that was changed

We need to find a good way to express the changes. Some possibilities:

  • Two columns, old_value and new_value:
    • old_value and new_value work like JSON masks, both copying the structure of the original object.
    • Array items in old_value missing in new_value means array items were removed.
    • An empty array in old_value and a non-empty array in new_value means array items were added.
    • Object properties in old_value not in new_value were removed.
    • null array items in both old_value and new_value are context, and define what position in the array the value could be found
  • One column, changes, describing the changes made to create the new version
    • changes is a JSON array of objects with the following keys:
      • path - The path that was changed
      • old_value - The old value we're replacing, if any
      • new_value - The new value we're adding, if any
      • old_index - Optional, the index of the array changed or removed
      • new_index - Optional, the index of the array changed (moved) or added

We should do some research to find prior art for describing changes to a large object.

Then we should provide a method on the TestReport result class to change the report and add the appropriate history to the changes table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant