guardian / path-manager

Service that manages paths for a domain. Ensures they are unique etc.
2 stars 0 forks source link

return all the alias paths when `updateCanonicalWithAlias` (with a `lastModified`) #38

Closed twrichards closed 4 years ago

twrichards commented 4 years ago

What does this change?

PLUS it looks like the Stage of TeamCity has changed to something other than DEVINFRA and as such TC agent was attempting to connect to Dynamo in AWS (rather than the local one launched via DockerKit) - so changed this initialisation to rely on the App tag being path-manager (which we control and so less likely to break without us realising).

How to test (with postman or similar)

  1. run path-manager locally (easiest way is sbt start)
  2. POST https://pathmanager.local.dev-gutools.co.uk/paths
    • Content-Type: application/x-www-form-urlencoded
    • with a path property set to something of your choice (e.g. pr/testing/1 )
    • with a system property set to something like test
  3. POST https://pathmanager.local.dev-gutools.co.uk/paths/{ ID_FROM_STEP_2 }?shouldFormAlias=true
    • with { ID_FROM_STEP_2 } replaced accordingly
    • Content-Type: application/x-www-form-urlencoded
    • with a path property set to something of your choice (e.g. pr/testing/2, i.e different from step 2 )
  4. repeat step 3 with a another path
  5. Observe the response...
    • your path from step 4, should be in the canonical record
    • your paths from step 2 & 3 should be alias records
    • each alias record should have a lastModified property

How can we measure success?

This is a facilitates a composer PR which integrates the alias functionality in path-manager for use in the Evolving URLs project - https://github.com/guardian/flexible-content/pull/3620.

Have we considered potential risks?

Main risk would be performance, if this is used for articles which have a large amount of aliases, but I suggest we cross that bridge at the time if it actually causes problems.

twrichards commented 4 years ago

Manually regression tested in CODE ✅ (i.e. create two new articles, try and give them the same path, see URL in use error on the second)

twrichards commented 4 years ago

PROD deployment : https://riffraff.gutools.co.uk/deployment/view/637ea12e-b144-4537-87fc-d588da583711