tree: 00f0ef17ca1077cdf0a9dae12ccf9cd967ca77f2
  1. common/
  2. first_party/
  3. gae_libs/
  4. handlers/
  5. libs/
  6. local_libs/
  7. model/
  8. services/
  9. static/
  10. templates/
  11. test/
  12. third_party/
  13. ui/
  14. waterfall/
  15. .gcloudignore
  16. .gitignore
  17. .style.yapf
  18. .vpython3
  19. app.yaml
  20. auxiliary_main.py
  21. backend_main.py
  22. cron.yaml
  23. default_main.py
  24. deploy_with_olddeps.py
  25. DEPLOYMENT_HACK_REASON.md
  26. dispatch.yaml
  27. frontend_main.py
  28. import_utils.py
  29. index.yaml
  30. makefile
  31. module-code-coverage-auxiliary-coverage-worker.yaml
  32. module-code-coverage-backend.yaml
  33. module-code-coverage-frontend.yaml
  34. OWNERS
  35. queue.yaml
  36. README.md
  37. requirements.txt
  38. test.py
appengine/findit/README.md

Assumptions

The Current Working Directory is $SRC_ROOT/infra/appengine/findit, i.e. the directory that contains this file. Please cd into it for the commands below to work.

Note:

  1. For Mac, if GoogleAppEngineLauncher is used to run Findit locally, you may have to set the field “Extra Flags” under “Launch Settings” with value “$SRC_ROOT/infra/appengine/findit/waterfall-backend.yaml $SRC_ROOT/infra/appengine/findit/waterfall-frontend.yaml”.
  2. For Windows, you may have to read the contents of the makefile to learn how to run all of the commands manually.

How to run Findit locally?

From command line, run: make run

Then open http://localhost:8080 for the home page.

How to run unit tests for Findit?

From command line, run:

  • make pytest to run all tests;
  • make pytest TEST_GLOB=<path to a sub dir> to run tests in a sub directory;
  • make pytest TEST_GLOB=<path to a sub dir>:*<test name>* to run a given test.

If a code path branch is not tested and no line number is shown in the command line output, you could check the code coverage report shown in the output.

How to automatically format python code?

From command line, run: git cl format

How to deploy to appengine?

[!IMPORTANT] Modern main checkouts contain a newer version of npm_modules that is missing critical legacy Polymer 2.0 files, causing UI elements (like the top bar) to crash. To deploy successfully, we use an automated script that force-pins legacy dependencies, patches the version generator to bypass taint checks, executes the deployment, and cleanly restores your workspace state afterward. For a detailed technical explanation of this issue, see DEPLOYMENT_HACK_REASON.md.

An automated script deploy_with_olddeps.py is available in this directory to handle the entire deployment process and guarantee a clean state rollback afterward.

Staging Deployment (Default)

To deploy Code Coverage to the staging instance (findit-for-me-staging):

./deploy_with_olddeps.py

Production Deployment

To deploy Code Coverage to the production instance (findit-for-me):

./deploy_with_olddeps.py --prod

Script Features & Safety:

  • Auto-Cleanup: The script is guaranteed to restore your workspace to its original state (reverting branches, restoring the patched calculate_version.py file, deleting temp branches, syncing submodules back to main, and restoring your stashed local changes) even if the deployment fails or is interrupted (Ctrl+C).
  • Auto-Confirmation: It automatically answers Y to the App Engine deployment confirmation prompts.
  • Custom Pinning (Optional): If you need to pin a different npm_modules revision, you can pass the --npm-rev <revision_hash> flag.

Code Structure

  • Findit
    • handlers/ contains logic to handle incoming http requests
    • services/ contains core logic for cron jobs.