Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Use jq to extract the version of protoc that Pants uses #2068

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

christophermaier
Copy link
Contributor

Rather than using grep on TOML to extract which version of protoc is being used (which works, but can be fragile), we will instead parse a gigantic JSON dump of Pants' state and extract the version using jq.

This is more robust because it takes into account the layering that Pants uses (i.e., CLI options override pants.toml configuration, which in turn overrides hardcoded defaults). This means we don't even have to pin a version in pants.toml and the script will still work!

For now, however, I have opted to keep the pin in pants.toml, purely for visibility and explicitness.

Signed-off-by: Christopher Maier [email protected]

Rather than using `grep` on TOML to extract which version of `protoc`
is being used (which works, but can be fragile), we will instead parse
a gigantic JSON dump of Pants' state and extract the version using
`jq`.

This is more robust because it takes into account the layering that
Pants uses (i.e., CLI options override `pants.toml` configuration,
which in turn overrides hardcoded defaults). This means we don't even
have to pin a version in `pants.toml` and the script will still work!

For now, however, I *have* opted to keep the pin in `pants.toml`,
purely for visibility and explicitness.

Signed-off-by: Christopher Maier <[email protected]>
@christophermaier christophermaier force-pushed the cm/extract-protoc-version-from-pants branch from ac76320 to 78934a0 Compare October 19, 2022 21:13
@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Base: 39.37% // Head: 39.41% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (78934a0) compared to base (0017906).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2068      +/-   ##
==========================================
+ Coverage   39.37%   39.41%   +0.03%     
==========================================
  Files         436      434       -2     
  Lines       10155    10148       -7     
==========================================
+ Hits         3999     4000       +1     
+ Misses       6156     6148       -8     
Impacted Files Coverage Δ
src/rust/graph-query/src/property_query.rs 0.00% <0.00%> (ø)
src/rust/graph-mutation/src/table_names.rs
src/rust/graph-query/src/table_names.rs
...rust-proto/src/graplinc/grapl/api/graph/v1beta1.rs 54.57% <0.00%> (+0.30%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@christophermaier christophermaier merged commit 5995041 into main Oct 19, 2022
@christophermaier christophermaier deleted the cm/extract-protoc-version-from-pants branch October 19, 2022 21:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants