Commit Graph

3 Commits

Author SHA1 Message Date
Felipe Monteiro 035841416b Validate bucket diffing works with revision rollback
Adds a unit test to validate following scenario:

1) create revision 1 with document
2) create revision 2 with no documents
3) rollback to revision 1 (creating revision 3)

Validate that diffing works for rolled-back revision.
All cases above use same bucket.

Also refactors some test logic for neatness.

Change-Id: I71bf7d34e8aae3ad5abb3c53b05cb96a7038ddc2
2018-10-18 19:07:42 +01:00
Felipe Monteiro 2155a3f5bd Fix up tags attribute in revisions API
Currently the GET /revisions endpoint returns the tags associated
with each revision like:

    tags:
      foo:
        name: foo

Which is strange, because the name of the tag is recursively referenced
also as `name: foo`. Thus, this PS re-formats this response body to
be more sensible:

    tags:
      foo: {}

Where the key is the name of the tag and the value is the data, if any,
associated with the tag. If no data is associated, the dict is empty.

This PS also makes necessary documentation and functional test updates.

Change-Id: I3156a539da11c40fee403806b3bd72b62d5b555d
2017-12-08 16:30:44 +00:00
Felipe Monteiro 7b0a69b39a [feat] DECKHAND-36 Revision tagging API
This commit adds an additional attribute called `tags` to each
Revision DB model. This allows Revisions to be tagged with whatever
arbitrary tag/tag data a service chooses to identify a revision by.

This commit:
  - creates a new DB model called `RevisionTag`
  - adds the following endpoints:
     * POST /api/v1.0/revisions/{revision_id}/tags/{tag} (create a tag)
     * GET /api/v1.0/revisions/tags/{tag} (show tag details)
     * GET /api/v1.0/revisions/{revision_id}/tags (list revision tags)
     * DELETE /api/v1.0/revisions/{revision_id}/tags/{tag} (delete a tag)
     * DELETE /api/v1.0/revisions/{revision_id}/tags (delete all tags)
  - adds appropriate unit test coverage for the changes
  - adds functional testing for each API endpoint

Change-Id: I49a7155ef5aa274c3a85ff6f8b85951f155a4b92
2017-08-29 15:41:20 +01:00