ampproject / amp-github-apps

GitHub Apps for the AMP Project
http://amp.dev
Apache License 2.0
34 stars 38 forks source link

How does App X work? #535

Closed rcebulko closed 4 years ago

rcebulko commented 5 years ago

Overview

There are a handful of apps in this repository, each with different owners, deployment strategies, permissions, environments, etc. Most of this is documented, in one way or another, in the project subdirectories READMEs or code comments. The goal of this thread is to collect high-level info about each project (not full deployment instructions or READMEs). The below template contains questions which each app owner could answer to provide a useful starting point for looking at all the apps in one place and seeing where we might want to unify or standardize approaches:

Template

[App Name]

Owner(s): rcebulko, rsimha, ... Directory: /my-app Deployed on: [GCE | GAE | ???] Project ID: amp-github-app-name URL: [None | amp-app-link.appspot.com] README link: README Portability: [Can only work with amphtml | Could be modified to be used on other repos | is repository-agnostic/configurable]

Incoming requests:

Outgoing requests:

Database: [Yes | No] Authentication [No | GitHub OAuth | Basic Auth] Custom lint config: [Yes | No]

Language/Framework: Probot If Probot:

Package management: [Yarn | npm | idk] Testing framework: Jest Test command: npm run test Tests run on presubmit: [Yes | No]

Deployment workflow: [Manual | Automated] Can this be run locally?: [Yes | No] If so:

Public environment (ie. config): [Shell script &| .env &| app.yaml &| GCE/GAE metadata &| deploy command arguments &| config file(s)] Private environment (ie. secrets, tokens, keys): [Shell script &| .env &| app.yaml &| GCE/GAE metadata &| deploy command arguments &| config file(s)] App uses a private-key.pem file for authentication: [Yes | No]

Plan

I'm going to start posting for the apps I've created/worked on, and then will start trying to do the same for the other apps with as much info as I can find in the repo.

/cc @ampproject/wg-infra let me know if you think of anything that might be missing. Ideally we can identify some pieces of this to standardize, if not with actual infrastructure then at least with more standard processes for things like keeping track of permissions, which apps use which tokens (since you can't see which token is which in the GitHub UI, making it risky to ever delete any), manage deployments, testing, etc.

rcebulko commented 5 years ago

Owners Bot

Owner(s): rcebulko, erwinmombay Directory: /owners Deployed on: GCE (requires local disk for local repo) Project ID: amp-owners-bot URL: No public URL README link: README Portability: Could be modified to be used on other repos

Incoming requests:

Outgoing requests:

Database: No Authentication: No Custom lint config: Yes

Language/Framework: Probot

Package management: npm Testing framework: Jest Test command: npm run test Tests run on presubmit: Yes

Deployment workflow: Manual (push to cloud repo, reset GCE instance) Can this be run locally?: Yes (for accessing status/info pages) If so:

Public environment (ie. config): Shell script, GCE/GAE metadata, deploy command arguments Private environment (ie. secrets, tokens, keys): Shell script, GCE/GAE metadata, deploy command arguments App uses a private-key.pem file for authentication: Yes

rcebulko commented 5 years ago

Project Metrics

Owner(s): rcebulko Directory: /project-metrics Deployed on: GAE Project ID: amp-project-metrics URL: https://amp-project-metrics.appspot.com README link: README Portability: is repository-agnostic/configurable

Incoming requests:

Outgoing requests:

Database: PostgreSQL (CloudSQL) Authentication: No Custom lint config: No

Language/Framework: Python/Flask GitHub:

Package management: pip Testing framework: unittest Test command: python -m unittest discover -s . -p '*_test.py' Tests run on presubmit: No

Deployment workflow: Manual (gcloud app deploy app.yaml) Can this be run locally?: No (depends on AppEngine-provided imports)

Public environment (ie. config): env.yaml Private environment (ie. secrets, tokens, keys): env.yaml App uses a private-key.pem file for authentication: No

rcebulko commented 5 years ago

Bundle-size Bot

Owner(s): danielrozenberg Directory: /bundle-size Deployed on: GAE Project ID: amp-bundle-size-bot URL: https://amp-bundle-size-bot.appspot.com README link: README Portability: can only work with amphtml

Incoming requests:

Outgoing requests:

Database: Yes Authentication: No Custom lint config: No

Language/Framework: Probot

Package management: npm Testing framework: Jest Test command: npm run test Tests run on presubmit: Yes

Deployment workflow: ??? Can this be run locally?: Yes

Public environment (ie. config): app.yaml Private environment (ie. secrets, tokens, keys): db-config.js, .env App uses a private-key.pem file for authentication: Yes

@danielrozenberg Please verify/fill in the ??? blanks if possible

rcebulko commented 5 years ago

PR Deploy Bot

Owner(s): estherkim Directory: /pr-deploy Deployed on: GAE Project ID: amp-pr-deploy-bot URL: https://amp-pr-deploy-bot.appspot.com README link: README Portability: is repository-agnostic/configurable

Incoming requests:

Outgoing requests:

Database: No Authentication: No Custom lint config: Yes

Language/Framework: TypeScript + Probot

Package management: npm Testing framework: Jest Test command: npm run test Tests run on presubmit: Yes

Deployment workflow: ??? Can this be run locally?: Yes

Public environment (ie. config): .env Private environment (ie. secrets, tokens, keys): .env App uses a private-key.pem file for authentication: Yes

@estherkim Please verify/fill in the ??? blanks if possible

rcebulko commented 5 years ago

Test Status Bot

Owner(s): danielrozenberg Directory: /test-status Deployed on: GAE Project ID: amp-test-status-bot URL: https://amp-test-status-bot.appspot.com/ README link: README Portability: is repository-agnostic/configurable

Incoming requests:

Outgoing requests:

Database: Yes Authentication: GitHub OAuth Custom lint config: No

Language/Framework: Probot

Package management: npm Testing framework: Jest Test command: npm run test Tests run on presubmit: ???

Deployment workflow: ??? Can this be run locally?: Yes

Public environment (ie. config): app.yaml Private environment (ie. secrets, tokens, keys): db-config.js, .env App uses a private-key.pem file for authentication: Yes

@danielrozenberg Please verify/fill in the ??? blanks if possible

rcebulko commented 5 years ago

Just based on what I've gathered looking through the existing apps and READMEs and environment files and configurations, a few free-floating thoughts in no particular order:

rcebulko commented 5 years ago

Additional thought: Project Metrics doesn't really fit this repo. It's not a GitHub app, it's a separate Python web app that should probably live in its own repository. If that project were to be moved out, all other projects here are Probot GitHub apps.

rcebulko commented 5 years ago

Relevant to #410 /cc @ampproject/wg-infra

rsimha commented 5 years ago

A couple apps have custom ESLint configs; it may be possible to cut some of them down/out so linting is consistent throughout

This is definitely worth doing. Eslint lets you add an .eslintrc at the root with repo-wide settings, and separate .eslintrc files in each directory that contain rules specific to that directory.

It would be nice for the repository-level README to list each of the apps, a quick description of what it does, and possibly a link to the README

+1!

Project Metrics doesn't really fit this repo. It's not a GitHub app, it's a separate Python web app that should probably live in its own repository. If that project were to be moved out, all other projects here are Probot GitHub apps.

Any ideas for where you'd move it?

Another suggestion for standardization (if it's not already done): Pick one workflow for package management (yarn vs. npm). We use yarn for amphtml because npm would generate different package-lock.json files on different OSs, causing the file to bounce back and forth as people made changes.

rcebulko commented 5 years ago

@rsimha Re: last item, all of the apps are currently using npm. I think we've been lucky in that we all use Linux

rcebulko commented 5 years ago

Re: second item, I think project-metrics should probably just live in its own mini-repo? WDYT? Not sure of any obvious other repo that should hold it.

rcebulko commented 5 years ago

I think the ideal here would be if we could deploy all apps together (see https://probot.github.io/docs/deployment/#combining-apps). Might take some massaging and time to get there, but a reasonable goal. Then we could set up auto-deploys of the whole repo on a (nightly?) regular interval, get all the configuration in one place, etc.

rcebulko commented 4 years ago

Archiving this.