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

Implement custom rego functions for PURL handling #1173

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

mbestavros
Copy link
Contributor

This PR adds two basic custom Rego functions to handle PURLs: ec.purl.is_valid and ec.purl.parse.

Marking as WIP due to lacking tests.

Resolves #1053.

internal/evaluator/rego.go Outdated Show resolved Hide resolved
internal/evaluator/rego.go Outdated Show resolved Hide resolved
internal/evaluator/rego.go Outdated Show resolved Hide resolved
internal/evaluator/rego.go Outdated Show resolved Hide resolved
@mbestavros mbestavros force-pushed the gh-1053 branch 2 times, most recently from ede0261 to 4215a74 Compare November 21, 2023 17:48
internal/evaluator/rego.go Outdated Show resolved Hide resolved
@mbestavros mbestavros force-pushed the gh-1053 branch 3 times, most recently from 44f6d65 to 4a48180 Compare November 21, 2023 19:55
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Merging #1173 (5211e45) into main (78d5df3) will increase coverage by 7.44%.
Report is 5 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1173      +/-   ##
==========================================
+ Coverage   77.00%   84.45%   +7.44%     
==========================================
  Files          57       66       +9     
  Lines        4836     5287     +451     
==========================================
+ Hits         3724     4465     +741     
+ Misses       1112      822     -290     
Flag Coverage Δ
acceptance 69.05% <59.34%> (?)
generative 4.31% <ø> (ø)
integration 18.10% <ø> (ø)
unit 76.51% <100.00%> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
internal/evaluator/rego.go 96.27% <100.00%> (+4.84%) ⬆️

... and 36 files with indirect coverage changes

internal/evaluator/rego.go Outdated Show resolved Hide resolved
@mbestavros mbestavros force-pushed the gh-1053 branch 2 times, most recently from a26a6e5 to 35f0a43 Compare November 21, 2023 21:10
internal/evaluator/rego.go Outdated Show resolved Hide resolved
@mbestavros mbestavros marked this pull request as ready for review November 22, 2023 02:15
Copy link
Member

@zregvart zregvart left a comment

Choose a reason for hiding this comment

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

LGTM

@mbestavros mbestavros merged commit f9f4690 into enterprise-contract:main Nov 22, 2023
11 checks passed
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.

Create a custom built-in rego function to parse PURLs
3 participants