Code Monkey home page Code Monkey logo

google-amp's Introduction

google-amp

Circle CI Known Vulnerabilities

AMP HTML rendering for FT articles

Getting started

  1. Install the project dependencies, make install

  2. Fetch the environment variables for the app, make .env

  3. Generate a self-signed certificate:

    make certificate
    

    And add the certificate to your keychain:

    security import cert.pem; security add-trusted-cert cert.pem
    
  4. Run the app (no build is required in development mode), make run

  5. Open https://local.ft.com:5050/content/<Content UUID>

Barrier flow diagram

https://app.lucidchart.com/invitations/accept/97a58184-f4b9-4ebf-b253-17f62799e460

Tests

To run the tests and linter locally, run npm test.

A Day in the Life of an AMP Article

  1. Google crawls FT.com and finds an article, /content/ffffffff-ffff-ffff-ffff-ffffffffffff
  2. The article has a <link rel="amphtml">, with href pointing to amp.ft.com/content/ffffffff-ffff-ffff-ffff-ffffffffffff
  3. The Google crawler fetches the AMP URL, which hits this service
  4. The amp-page.js controller runs
    1. It fetches the content from Elastic Search using n-es-client
    2. It runs various transforms on the article data and body HTML
    3. It renders the transformed data into the template and responds with it
  5. The crawler validates the returned markup, and if it's valid AMP markup, stores it in the AMP cache
  6. When a mobile user searches for something that returns articles from FT with AMP versions, they're preloaded, and if the user taps on one of those results the AMP page is displayed immediately.

Deployment

The main branch deploys automatically to prod once the tests are green. Pull requests deploy to review apps, look out for the @username deployed to google-amp-prod-eu-pr-XXX messages in the PR.

Rolling back

Use the Roll back to... button on the Heroku activity tab or the heroku releases:rollback command.

google-amp's People

Contributors

adgad avatar alexflorisca avatar andygout avatar angelaft avatar apaleslimghost avatar doramatadora avatar edds avatar emortong avatar georgecrawford avatar glynnphillips avatar i-like-robots avatar jakechampion avatar jenniferemshepherd avatar jkerr321 avatar joannaskao avatar liamkeaton avatar mifkata avatar nickcolley avatar ottlikg avatar remybach avatar renovate-bot avatar richard-still-ft avatar rowanbeentje avatar simonplend avatar sjparkinson avatar ststdimov avatar thegreatercurve avatar timdavenportft avatar vladdubrovskis avatar ytcleon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-amp's Issues

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • Update dependency @financial-times/n-gage to v9
  • Update dependency @financial-times/n-heroku-tools to v14
  • Update dependency @financial-times/n-test to v4
  • Update dependency chai to v4
  • Update dependency chalk to v5
  • Update dependency dirty-chai to v2
  • Update dependency mocha to v10
  • Update dependency mocha-junit-reporter to v2
  • Update dependency nock to v13
  • Update dependency nodemon to v2
  • Update dependency proxyquire to v2
  • Update dependency sinon to v14

Rate Limited

These updates are currently rate limited. Click on a checkbox below to force their creation now.

  • Update Node.js to v16
  • Update Node.js to v17
  • Update dependency @financial-times/fastly-tools to v4
  • Update dependency @financial-times/n-es-client to v4
  • Update dependency csso to v5
  • Update dependency glob to v8
  • Update dependency http-errors to v2

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.


  • Check this box to trigger a request for Renovate to run again on this repository

Update Dependencies (Renovate Bot)

This master issue contains a list of Renovate updates and their statuses.

Pending Approval

These PRs will be created by Renovate only once you click their checkbox below.

  • Update dependency lintspaces-cli to ^0.7.0
  • Update dependency ansi-escapes to v4
  • Update dependency chai to v4
  • Update dependency chalk to v2
  • Update dependency dirty-chai to v2
  • Update dependency mocha to v6
  • Update dependency nock to v10
  • Update dependency proxyquire to v2
  • Update dependency sinon to v7
  • Update linters (major) (eslint, eslint-config-airbnb-base)

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Closed/Ignored

These updates were closed unmerged and will not be recreated unless you click a checkbox below.

Dependency deprecation warning: @financial-times/change-request (npm)

On registry https://registry.npmjs.org/, the "latest" version (v1.1.1) of dependency @financial-times/change-request has the following deprecation notice:

Module has been renamed to @financial-times/release-log

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about @financial-times/change-request's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Dependency deprecation warning: fs-promise (npm)

On registry https://registry.npmjs.org/, the "latest" version (v2.0.3) of dependency fs-promise has the following deprecation notice:

Use mz or fs-extra^3.0 with Promise Support

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about fs-promise's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Configure WAF for our Google AMP Fastly service

We need to add and configure the Fastly WAF to this project's Fastly service.

The service ID is 4g6XuZYa26LQSfxdzhXXMu.

Fastly have published some documentation on how to configure their WAF on a service.

We'll need to work with the Fastly support team to get this setup, you can raise an issue with them by posting in the #fastly-support Slack channel and adding a 🔑 emoji to the message.

We should first ensure that we are logging from Fastly to Splunk.

We should configure a custom response that is a valid AMP page and matches this products design.

There is a command line tool Fastly are currently working on to configure a services WAF.

Dependency deprecation warning: @quarterto/heroku-version-infer (npm)

On registry https://registry.npmjs.org/, the "latest" version (v4.0.1) of dependency @quarterto/heroku-version-infer has the following deprecation notice:

heroku-version-infer has been renamed to @quarterto/git-version-infer

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about @quarterto/heroku-version-infer's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Dependency deprecation warning: bower (npm)

On registry https://registry.npmjs.org/, the "latest" version (v1.8.4) of dependency bower has the following deprecation notice:

We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about bower's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Use new Change API since CRAPI is going away

Google AMP is one of very few systems left which is using Konstructor's Change Request API (CRAPI) to create release log into RemedyForce. Since CRAPI is hosted on-prem and is a really old and unmanaged java app, we plan to decommission it by the end of this quarter.

To replace it, we have created a brand new and much nicer Change API which is much more simpler and reliable. More info here.

Please try it out ! ( ideally before the end of Q3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.