The JSON output created by Facia-press
that is ingested by Facia
does not have the properties that Facia
is expecting. You need to re-press the fronts to re-create the JSON. Read the Fronts architecture here.
Tests are failing because of mis pressed data committed. In the Teamcity PR build, you can see things like:
FaciaMetaDataTest.should Include item list metadata
FaciaMetaDataTest.should Include organisation metadata
FaciaControllerTest.should render fronts in mf2 format
FaciaControllerTest.should render fronts in mf2 format (no section provided)
FaciaControllerTest.should render fronts with content that has been pre-fetched from facia-press
- Check your
facia.stage
property in yourfrontend.conf
file is pointing at DEV (not PROD!) - Check you are using your own switches file and not the
PROD
orCODE
one.- To do this, create your own properties file in the the S3 bucket named
aws-frontend-store
. Add it to yourfrontend.conf
like this:switches.key=DEV/config/switches-nbaltazar.properties
- To do this, create your own properties file in the the S3 bucket named
- Ensure you have the test AWS SQS queues in your
frontend.conf
properties- Add two properties:
frontpress.sqs.tool_queue_url
andfrontpress.sqs.cron_queue_url
- Set both properties to the value
"https://sqs.eu-west-1.amazonaws.com/<id-here>/Frontend-TEST-page-presser-queue"
- You can get the correct ID by going to SQS in the AWS console and finding the
Frontend-TEST-page-presser-queue
and find the URL field in the details tab
- Add two properties:
- Ensure your CAPI endpoint is PROD (
content.api.host
infrontend.conf
)
- Delete the files in
data/pressedPage/
- Run the
admin
project locally and turn onfacia-press-on-demand
andfacia-inline-embeds
switch - Stop admin and run
facia-press
locally - Go to
http://localhost:9000
just to get the switches file warmed up, then
curl -v -X POST http://localhost:9000/press/live/music
curl -v -X POST http://localhost:9000/press/live/inline-embeds
curl -v -X POST http://localhost:9000/press/live/uk
curl -v -X POST http://localhost:9000/press/live/au/media
- Stop facia press, switch to
facia
project and runtest
- Re-running the tests will recreate the JSON in the
data/pressedPage
folder - you'll need to commit those files. - Note: The S3 buckets for pressed fronts and configs can be found in the CMS for Fronts account rather than the Frontend one on AWS. There is old data probably hanging around the Frontend account but you want to be looking at CMS if you're wondering why tests aren't working.
- Re-running the tests will recreate the JSON in the
This is more tricky especially if you are making a breaking change (i.e. new facia can't work with the old format and old facia can't work with the new)
If you just ship new facia without pressing things will break until the presser kicks in.
- Choose a quiet time of day, and this will take an hour
- Can you
ssh
onto the facia-press instances forCODE
andPROD
? No? - Turn off continuous integration for
CODE
andPROD
(via riff-raff) - Block deploys: Add a restriction to Riff-Raff
- Let team know what you're doing
- Email core central prod to let them know preview fronts may error
- Merge to
main
- Deploy facia-press & turn on the
facia-press-on-demand
switch in CODE gutools - Set the
facia-press
AWS auto scaling group desired value to 2 SSH
into the facia presser instance and post to http://localhost:9000/press/draft/all (have patience, it takes a couple of mins) to repress all the draft fronts (curl -v -X POST -H 'Content-Length: 0' http://localhost:9000/press/draft/all
)- The reason we SSH in and hit localhost instead of
curl
ing the ELB is because the curl request times out before the response.
- The reason we SSH in and hit localhost instead of
- Back in CODE
frontend.gutools
go to/press
and clickStandard Frequency Fronts For Press
, then wait a while for the most used CODE fronts to press- Monitor the SQS queue size to know when it's done (
frontend-CODE-FrontPressCronJobQueue-*
)
- Monitor the SQS queue size to know when it's done (
- Check that code facia still works (e.g. /uk and click around to some other fronts)
- If you want to debug, go to a facia press load balancer:
http://<frontend-faciapre-elb>/pressed/live/uk/money
to see the JSON format - If you're adding a field, things will likely work fine as the old format should just ignore your new field.
- If you want to debug, go to a facia press load balancer:
- Once you're happy, deploy
facia
and check things still work (/uk etc) - Deploy everything else in
dotcom
- Deploy facia-press & turn on the
facia-press-on-demand
switch in PROD gutools SSH
into the facia presser instance and post to http://localhost:9000/press/draft/all (have patience, it takes a couple of mins) to repress all the draft fronts (curl -v -X POST -H 'Content-Length: 0' http://localhost:9000/press/draft/all
)- The fronts in prod are pressed automatically every 5 minutes, but if you like, use
frontend.gutools
to/press
them - if you do just clickAll Frequency Fronts For Press
. This will be speedy due to multiple instances. - Point your local machine to
facia.stage=PROD
infrontend.conf
and make sure everything is working before you deploy for real - Deploy
preview
and check it still works - Deploy facia etc and check they still work
- Deploy everything else and check they still work
- Turn off the
facia-press-on-demand
switches - Set the
facia-press
AWS auto scaling group desired value back to what it was - Turn on auto deploys again
- Change your local machine back to DEV facia bucket!
- Unblock deploys (remove the restriction in Riff-Raff)
- Let Central Prod know things are hunky-dory
- Celebrate! 🎉
Follow the above instructions, only deploy the new facia (that doesn't need the field) first, check it works, and then follow the presser steps to repress the fronts without the field.
This is a real pain because at the moment you just have to ship one change to add the new field, and another to remove the old field. If you hit this situation, you're going to need to think hard.
If you are seeing a 500
for a front and you can't re-press it try to access it via the elb (http://<frontend-faciapre-elb>/pressed/live/uk/money
).
If it returns Not found
:
- Check whether the fronts tool for that front has any error messages. If so - delete that item.
- Check the fronts tool
/editorial/config
- Open each item in the front and click
check
on each of the backfills
- Open each item in the front and click
- If the backfills are fine, check the snaps
- In the fronts tool
/editorial
, find the sections that contain snaps, the titles are surrounded by { curly braces } - In the fronts tool
/config
find the collections associated with those snap sections and go to/config/<collection-id>
for each one - Make sure that all
snapUri
values, where the path is a realtive tag path andsnapType
islatest
, return a valid response from internal CAPI - Eg: If
"snapUri": "lifeandstyle/series/modern-tribes"
checkhttp://<capi>/lifeandstyle/series/gardening-what-to-do-this-week
- When you find it... delete it from the fronts tool and refresh
- In the fronts tool