In the 'legal' use cases of the Evolving URLs functionality, there are scenarios where we need to remove any public-facing trace of a URL (e.g. some contentious headline, that the original URL was formed from).
However we need to ensure that path can never be taken again, so we effectively need to flag it as deleted in path-manager, change the data-structure in composer to support this concept too, then filter out deleted aliasPaths in the aliasPaths list which goes off to CAPI (see https://github.com/guardian/flexible-content/pull/3641).
What does this change?
Adds an optional isRemoved flag to path records (optional so as not to pollute/confuse other records)
Adds a new POST endpoint /paths/aliasPathIsRemoved which takes a path query parameter and a body of true or false (the latter allowing for an alias path to restored if accidentally 'deleted') which sets the above flag on the specified alias path record and returns the full list of aliases (so the composer can overwrite its list of aliasPaths with the latest - see https://github.com/guardian/flexible-content/pull/3641).
To test the new functionality directly, checkout this branch and launch using sbt start then using Postman make a POST to https://pathmanager.local.dev-gutools.co.uk/paths?path=ALIAS_PATH (where ALIAS_PATH is a valid alias path already in path-manager - see https://github.com/guardian/path-manager/pull/33 for how to convert canonicals to alias paths) you should get back a full list of alias paths with the isRemoved property of the path you used for ALIAS_PATH marked accordingly.
How can we measure success?
Users with the 'Evolving URLs' permission in composer will be able to 'delete' previous URLs in legal scenarios (and then restore if 'deleted' by mistake).
https://trello.com/c/eRxPU16A/451-support-deleting-alias-paths
In the 'legal' use cases of the Evolving URLs functionality, there are scenarios where we need to remove any public-facing trace of a URL (e.g. some contentious headline, that the original URL was formed from).
However we need to ensure that path can never be taken again, so we effectively need to flag it as deleted in
path-manager
, change the data-structure in composer to support this concept too, then filter out deleted aliasPaths in thealiasPaths
list which goes off to CAPI (see https://github.com/guardian/flexible-content/pull/3641).What does this change?
isRemoved
flag to path records (optional so as not to pollute/confuse other records)POST
endpoint/paths/aliasPathIsRemoved
which takes apath
query parameter and a body oftrue
orfalse
(the latter allowing for an alias path to restored if accidentally 'deleted') which sets the above flag on the specified alias path record and returns the full list of aliases (so thecomposer
can overwrite its list ofaliasPaths
with the latest - see https://github.com/guardian/flexible-content/pull/3641).How to test
Easiest way to test is probably via the testing instructions in https://github.com/guardian/flexible-content/pull/3641 (as composer essentially proxies this new functionality).
To test the new functionality directly, checkout this branch and launch using
sbt start
then using Postman make aPOST
tohttps://pathmanager.local.dev-gutools.co.uk/paths?path=ALIAS_PATH
(whereALIAS_PATH
is a valid alias path already in path-manager - see https://github.com/guardian/path-manager/pull/33 for how to convert canonicals to alias paths) you should get back a full list of alias paths with theisRemoved
property of the path you used forALIAS_PATH
marked accordingly.How can we measure success?
Users with the 'Evolving URLs' permission in composer will be able to 'delete' previous URLs in legal scenarios (and then restore if 'deleted' by mistake).