cedar-policy / cedar

Implementation of the Cedar Policy Language
https://www.cedarpolicy.com
Apache License 2.0
892 stars 80 forks source link

Add function to get SDK and Lang version #1219

Closed shaobo-he-aws closed 2 months ago

shaobo-he-aws commented 2 months ago

Description of changes

Issue #, if available

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

I confirm that this PR (choose one, and delete the other options):

I confirm that cedar-spec (choose one, and delete the other options):

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

john-h-kastner-aws commented 2 months ago

If we want this function (as opposed to a function returning the lang version). We should be able to get the SDK version from env vars to avoid the need for a manual update on every release.

  • CARGO_PKG_VERSION — The full version of your package.
  • CARGO_PKG_VERSION_MAJOR — The major version of your package.
  • CARGO_PKG_VERSION_MINOR — The minor version of your package.
  • CARGO_PKG_VERSION_PATCH — The patch version of your package.
  • CARGO_PKG_VERSION_PRE — The pre-release version of your package.

This information should also be available to Cedar consumers from their Cargo.lock file (using this crate), so I'm not sure I see the need for this. Cedar langauge version on the other hand is something only that can only be known if we explicitly report it.

shaobo-he-aws commented 2 months ago

Can you add a function to the CLI to get the version number?

Yes, working on it.

shaobo-he-aws commented 2 months ago

Can you add a function to the CLI to get the version number?

Done.