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

Expose a "glean" command #105

Merged
merged 6 commits into from
Mar 18, 2021
Merged

Expose a "glean" command #105

merged 6 commits into from
Mar 18, 2021

Conversation

Dexterp37
Copy link
Contributor

@Dexterp37 Dexterp37 commented Mar 18, 2021

This exposes a "glean" command to be used as an interface for running the glean_parser by glean.js
consuming products. It takes care of setting up a virtual environment and making sure that the parser
and its dependencies are up to date.

How to test this:

  • Add glean.js to a project via npm link
  • Run npx glean .... and check the generated output.

For rally, I had this output:

dexter@DX-WORKHORSE:/mnt/d/Mozilla/rally/core-addon$ npx glean translate metrics.yaml pings.yaml -f javascript -o public/generated
Checking for a Glean virtual environment at /mnt/d/Mozilla/rally/core-addon/.venv
Using Glean virtual environment at /mnt/d/Mozilla/rally/core-addon/.venv

TODO:

  • Test on MacOS.
  • Verify that the command gets published.
  • Add unit tests? (we're not going to add them, but instead we're adding this command to the samples)

This exposes a "glean" command to be used as an
interface for running the glean_parser by glean.js
consuming products. It takes care of setting up a
virtual environment and making sure that the parser
and its dependencies are up to date.
@Dexterp37 Dexterp37 self-assigned this Mar 18, 2021
@brizental
Copy link
Contributor

Tested on MacOS and it works. Let's file a follow up for showing some status, specially the first run takes a long long time and it looks like it's frozen. Can you send commits with changes to the sample extensions? Currently they rely on a globally installed glean_parser.

@Dexterp37 Dexterp37 marked this pull request as ready for review March 18, 2021 09:46
@Dexterp37
Copy link
Contributor Author

Tested on MacOS and it works. Let's file a follow up for showing some status, specially the first run takes a long long time and it looks like it's frozen. Can you send commits with changes to the sample extensions? Currently they rely on a globally installed glean_parser.

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1699391 and https://bugzilla.mozilla.org/show_bug.cgi?id=1699392 as potential follow-up work.

Copy link
Contributor

@brizental brizental left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc. This is great.

glean/src/cli.ts Show resolved Hide resolved
samples/web-extension/javascript/README.md Show resolved Hide resolved
@Dexterp37 Dexterp37 merged commit 6a7066b into mozilla:main Mar 18, 2021
@Dexterp37 Dexterp37 deleted the glean_cmd branch March 18, 2021 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants