REST API always applies versioning

Description

The current behaviour of the createNode REST API is:

  • Creating an empty file without content (via POST JSON) is not auto-versioned, and any subsequent file content updates are not versioned

  • creating a file with content (via POST of multipart/form-data) is always auto-versioned, and any subsequent file content updates are versioned

Is is not possible to create a node with content without having the versonable aspect automatically applied. This inconsistent but more importantly it results in very significant DB bloat for this unwanted version data.

The createNode API needs an option to allow control over versioning being applied whist preserving the existing behaviour if the call is used as per the current implementation.

Environment

None

Testcase ID

None

Activity

Show:
Andrew Leach
November 17, 2020, 9:33 AM

Thank you

Alexandru Epure
November 17, 2020, 8:51 AM

Repository HF 6.2.2.6 has just been released.

Artifacts can be found on:

I`ll continue with merging to 6.2.N branch.

Alexandru Epure
November 16, 2020, 5:09 PM

Big thanks to who put tremendous effort constantly reviewing and improving the solution.

Update :

https://github.com/Alfresco/alfresco-community-repo/pull/149 has been merged to master branch.

I have created:

  • - for release/6.2.2

  • - for 6.2.N

API Spec has been updated in the following PRs:

  • - for master

  • - for 6.2.N

 

I have started the release process for 6.2.2.6.

Alexandru Epure
November 13, 2020, 3:17 PM

Update:

After the initial implementation, suggested that it would be better to add a flag called versioningEnabled of type boolean more details can be found on the PR comment→ https://github.com/Alfresco/alfresco-community-repo/pull/149#pullrequestreview-529923717

I have updated the PR with the suggested changes, so now the PR contains the fix and tests, it is ready for review.

Alexandru Epure
November 12, 2020, 4:19 PM

Update:

Thank you for your valuable input.

I have created a PR with the work so far implementing the fix Gavin suggested →

Fixed

Assignee

Unassigned

Reporter

Mike Farman

Labels

None

Security Issue

None

Escalated By

CSO

Hot Fix Version

ACT Numbers

01018598

Regression Since

None

Premier Customer

None

Work Funnel End

None

Patch Attached

None

Dependent Version/s

None

Prioritization Score

None

Delivery Team

Customer Excellence

Bug Priority

Category 1

Components

Fix versions

Affects versions