Skip to content

Conversation

shaobo-he-aws
Copy link
Contributor

@shaobo-he-aws shaobo-he-aws commented May 8, 2025

This commit also fixes a bug where Cedar doesn't performance checks on tags.

Description of changes

Issue #, if available

Checklist for requesting a review

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

  • A bug fix or other functionality change requiring a patch to cedar-policy.

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

  • Updates the "Unreleased" section of the CHANGELOG with a description of my change (required for major/minor version bumps).

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

  • Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.

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

  • Does not require updates because my change does not impact the Cedar language specification.

This commit also fixes a bug where Cedar doesn't performance
checks on tags.

Signed-off-by: Shaobo He <shaobohe@amazon.com>
Copy link

github-actions bot commented May 8, 2025

Coverage Report

Head Commit: 0b2aa68aa56072695571fa95e199fdd33d705b91

Base Commit: 5afc1fabc98f4be3b9869bd96791c65ebcf30a5b

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 82.99%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-core/src/entities/conformance.rs 🟢 108/122 88.52% 139-145, 185-191
cedar-policy-core/src/entities/conformance/err.rs 🔴 8/13 61.54% 134-135, 140-141, 263
cedar-policy-core/src/entities/json/value.rs 🔴 6/12 50.00% 737-742

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 81.76%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-policy 🔴 3111/4528 68.71% --
cedar-policy-cli 🔴 571/972 58.74% --
cedar-policy-core 🟢 11966/14188 84.34% --
cedar-policy-formatter 🟢 914/1043 87.63% --
cedar-policy-validator 🟢 8745/10191 85.81% --
cedar-wasm 🔴 0/29 0.00% --

@@ -2189,6 +2190,57 @@ action "g" appliesTo {
"#;
assert_matches!(Entity::from_json_str(entity_str, Some(&schema)), Ok(_));
}

#[test]
fn from_entities_tags() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably include a test that conformance check succeeds if the correct type of tag is provided.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do it in another PR so that I can use the APIs now.

@shaobo-he-aws shaobo-he-aws merged commit 35182b6 into main May 8, 2025
20 checks passed
@shaobo-he-aws shaobo-he-aws deleted the refactor/shaobo/conformance branch May 8, 2025 20:24
shaobo-he-aws added a commit that referenced this pull request May 12, 2025
Signed-off-by: Shaobo He <shaobohe@amazon.com>
shaobo-he-aws added a commit that referenced this pull request May 12, 2025
This commit also added a couple of positive test cases.

Signed-off-by: Shaobo He <shaobohe@amazon.com>
shaobo-he-aws added a commit that referenced this pull request May 12, 2025
Signed-off-by: Shaobo He <shaobohe@amazon.com>
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.

3 participants