Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc(proto): Add proto definition for LHR #6183

Merged
merged 31 commits into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a92af15
Initial proto definition of lhr*.
exterkamp Oct 4, 2018
0b0052d
Struct details in proto, added python to convert sample into proto an…
exterkamp Oct 4, 2018
48b4774
Added comments to extern.d.ts fields.
exterkamp Oct 4, 2018
9ab2045
Moved protos around and made them more nested in the .proto
exterkamp Oct 4, 2018
f52221e
Added proto junk to yarn clean.
exterkamp Oct 4, 2018
c42bd3b
Added in better proto README and yarn command to compile proto.
exterkamp Oct 4, 2018
85a4a9e
Added i18n_v1 message w/ListValues.
exterkamp Oct 5, 2018
f3a69eb
Removed python cleaning of i18n since ListValues doesn't need it.
exterkamp Oct 5, 2018
a9beffb
Cleaning up some docs + removing weird change to yarn changelog.
exterkamp Oct 5, 2018
a53c44e
Cleaned up python validator a bit.
exterkamp Oct 5, 2018
f836339
Review changes round 1. Newlines added, filenames changed, docs upda…
exterkamp Oct 5, 2018
0d56054
Forgot the link in proto.
exterkamp Oct 5, 2018
a3a6c77
Added new proto field definitions using Wrappers to accomodate null's…
exterkamp Oct 9, 2018
53e9649
Ignore empty strings in preprocessing, made config settings more gene…
exterkamp Oct 9, 2018
0b18d1e
Made proto test self contained with sample_v2_round_trip json.
exterkamp Oct 9, 2018
a0759df
Merge branch 'master' into proto-lhr
exterkamp Oct 9, 2018
2d8b923
Updated round trip to new strings. Made the json dump sort keys in p…
exterkamp Oct 9, 2018
89f0563
Forgot to sort output json keys.
exterkamp Oct 10, 2018
fc9e227
Added crc empty children removal to preprocessing.
exterkamp Oct 11, 2018
72a06c3
Added preprocessing step to running lighthouse in LR.
exterkamp Oct 11, 2018
af41fae
Merge branch 'master' into proto-lhr
exterkamp Oct 11, 2018
7ff805c
Added preprocessor to LR.
exterkamp Oct 11, 2018
3c2fe15
Merge branch 'master' into proto-lhr
exterkamp Oct 11, 2018
d513396
Added LighthouseError to proto def.
exterkamp Oct 11, 2018
6f1ce30
Changed proto-test to use the lib/preprocessor.
exterkamp Oct 11, 2018
a3330a5
Added preprocessing tests and hardened preprocessor.
exterkamp Oct 11, 2018
7f92586
Removed crc chain removal from preprocessing.
exterkamp Oct 11, 2018
e8be8e8
misc(proto): move scripts into scripts/ folder
paulirish Oct 12, 2018
95c0952
Feedback from Paul. Removed python preprocessor. Added typechecking…
exterkamp Oct 15, 2018
fdf1d6d
Switched from Popen to call, removed Popen legacy arg from first try …
exterkamp Oct 15, 2018
2ce9df0
Made in/out in arg reading better.
exterkamp Oct 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ yarn-error.log
/chrome.zip

plots/out**

*__pycache__
*_pb2.py
*.pyc
proto/*.json
exterkamp marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build-all:task:windows": "yarn build-extension && yarn build-viewer",
"build-extension": "cd ./lighthouse-extension && yarn build",
"build-viewer": "cd ./lighthouse-viewer && yarn build",
"clean": "rimraf *.report.html *.report.dom.html *.report.json *.devtoolslog.json *.trace.json || true",
"clean": "rimraf proto/*.json proto/*_pb2.py proto/*_pb2.pyc proto/__pycache__ *.report.html *.report.dom.html *.report.json *.devtoolslog.json *.trace.json || true",
"lint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe . || eslint .",
"smoke": "node lighthouse-cli/test/smokehouse/run-smoke.js",
"debug": "node --inspect-brk ./lighthouse-cli/index.js",
Expand Down Expand Up @@ -63,7 +63,8 @@
"diff:sample-json": "yarn i18n:checks && bash lighthouse-core/scripts/assert-golden-lhr-unchanged.sh",
"ultradumbBenchmark": "./lighthouse-core/scripts/benchmark.js",
"mixed-content": "./lighthouse-cli/index.js --chrome-flags='--headless' --preset=mixed-content",
"minify-latest-run": "./lighthouse-core/scripts/lantern/minify-trace.js ./latest-run/defaultPass.trace.json ./latest-run/defaultPass.trace.min.json && ./lighthouse-core/scripts/lantern/minify-devtoolslog.js ./latest-run/defaultPass.devtoolslog.json ./latest-run/defaultPass.devtoolslog.min.json"
"minify-latest-run": "./lighthouse-core/scripts/lantern/minify-trace.js ./latest-run/defaultPass.trace.json ./latest-run/defaultPass.trace.min.json && ./lighthouse-core/scripts/lantern/minify-devtoolslog.js ./latest-run/defaultPass.devtoolslog.json ./latest-run/defaultPass.devtoolslog.min.json",
"compile-proto": "protoc --python_out=./ ./proto/lighthouse-response.proto && python ./proto/proto_lhr_validator.py"
exterkamp marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"@types/chrome": "^0.0.60",
Expand Down
23 changes: 23 additions & 0 deletions proto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## How to compile protos + use locally

1. Get the latest proto [release](https://github.com/protocolbuffers/protobuf/releases) (select one with python included if you want to run this validator)
1. Install the [C++ Protocol Buffer Runtime](https://github.com/protocolbuffers/protobuf/blob/master/src/README.md)
exterkamp marked this conversation as resolved.
Show resolved Hide resolved
1. Run `yarn compile-proto` or run the commands seperately:
1. Compile proto python definitions
```bash
cd ./proto
protoc --python_out=./ lighthouse-response.proto
```
1. Run python round trip test
```bash
python proto_lhr_validator.py
```

## Proto Resources
- [Protobuf Github Repo](https://github.com/protocolbuffers/protobuf)
- [Protobuf Docs](https://developers.google.com/protocol-buffers/docs/overview)

## Hacking Hints
- Clean out compiled proto and json with `yarn clean`
- Round trips might jumble the order of your JSON keys and lists!
- Is your `six` installation troubling your `pip install protobuf`? Mine did. Try `pip install --ignore-installed six`.
Loading