Bug 1092188

Summary: Standardise the freeze/snapshot functionality
Product: [Community] PressGang CCMS Reporter: Lee Newson <lnewson>
Component: CCMS-CoreAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.4CC: mcaspers
Target Milestone: ---   
Target Release: 1.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-28 21:56:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lee Newson 2014-04-28 23:23:44 UTC
Currently we have a "Freeze" button in DocBuilder that only adds the "Frozen" tag and then we have the "snapshot" csprocessor command. These two do entirely different things and should be standardised to do the same thing.

Once that is done we could also add a freeze/snapshot button into the standard UI.

Comment 1 Lee Newson 2014-05-16 03:06:03 UTC
Fixed in 1.6-SNAPSHOT build 201405161207

Server:

The rest server now has a few more endpoints to deal with freezing specs:

POST /rest/1/contentspec/freeze/json/{id}
POST /rest/1/contentspec/freeze/json+text/{id}
POST /rest/1/contentspec/freeze/text/{id}
GET  /rest/1/contentspec/freeze/preview/text/{id}
GET  /rest/1/contentspec/freeze/preview/text/{id}/r/{rev}

These endpoints also have the following query parameters:

latestRevisions - boolean - If the all topics should be updated to their latest versions in the case where some topics are already frozen.
createNewSpec - boolean - If the content spec should be frozen as a new content specification.
maxRevision - Integer - The maximum revision to freeze topics to (see the snapshot --max-revision option).

Note: There isn't a way to freeze a content spec from a revision and the preview endpoint is only there for the pull-snapshot CLI command.

UI:

The "Actions" menu in the UI now has a "Freeze" option. This will open up an extended LogMessage dialog with some additional freeze options. From the dialog there is also a "Preview" button which will allow the user to preview their freeze before actually performing it.

I've also added a way to open a spec with the freeze dialog open from a URL. The format is:

#ContentSpecFilteredResultsAndContentSpecView;id=<ID>;action=freeze;

(I've also setup "translationPush" and "translationSync" for the possible actions)

CLI:

The pull-snapshot and snapshot commands have been updated to use the new REST API endpoints instead of doing the snapshots on the users machine.

DocBuilder:

The DocBuilder index page has been updated so that when the spec isn't frozen there will be a button that will open a new tab to the UI freeze dialog. If the book is already frozen, then it will just show "Frozen" as text.

Comment 3 Matthew Casperson 2014-05-22 23:14:21 UTC
The following tested ok:
* freezing an invalid spec, which displayed the appropriate error
* freezing a spec with no frozen topics
* freezing a spec with a mix of unfrozen and frozen topics
* create new specs or updating the existing one
* previewing

Comment 4 Matthew Casperson 2014-05-22 23:21:02 UTC
The following in various combinations with csprocessor snapshot
* --new
* --latest
* --max-topic-revision

All worked as expected.

Comment 7 Matthew Casperson 2014-05-22 23:24:31 UTC
The freeze UI doesn't provide the ability to set the max revision.

Comment 9 Matthew Casperson 2014-05-23 00:23:45 UTC
Ignore the comments about the "ERROR: No data was found for the specified ID!" message. I didn't copy the spec id properly.

Comment 10 Matthew Casperson 2014-05-23 00:27:06 UTC
Tested snapshot and pull-snapshot ok.
Tested max revision from UI ok.
Confirmed that the ContentSpecFilteredResultsAndContentSpecView;id=<ID>;action=freeze; url opens the spec with the freeze dialog open.

Comment 11 Lee Newson 2014-05-23 00:29:46 UTC
Fixed in 1.6-SNAPSHOT build 201405231021

Added a "Max Topic Revision" field that will only accept numbers.

Note: This version has been deployed to the test/development server.

Comment 14 Lee Newson 2014-05-23 01:10:55 UTC
Fixed in 1.6-SNAPSHOT build 201405231055

The action dialogs weren't being closed during the close() method.

Comment 15 Matthew Casperson 2014-05-25 20:29:34 UTC
Verified