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

Refactor out backend code #198

Merged
merged 3 commits into from
Feb 10, 2022
Merged

Conversation

willbeason
Copy link
Member

@willbeason willbeason commented Feb 8, 2022

Note to reviewers: This changes how Client is instantiated, so it breaks
Gatekeeper's usage of it. This can easily be remedied with a small change
to the Gatekeeper repo.

Having the backend intermediate type for instantiating and using Client
adds complexity, code length, and unnecessary error paths. This change
makes using Client easier and streamlines options to a single type, all
specified when instantiating the Client.

This commit fully removes backend without breaking any existing
funcitonality.

Signed-off-by: Will Beason willbeason@google.com

Having the backend intermediate type for instantiating and using Client
adds complexity, code length, and unnecessary error paths.

This commit fully removes backend without breaking any existing
funcitonality.

Signed-off-by: Will Beason <willbeason@google.com>
@willbeason willbeason self-assigned this Feb 8, 2022
Signed-off-by: Will Beason <willbeason@google.com>
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #198 (b22e758) into master (cd1085b) will decrease coverage by 0.21%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #198      +/-   ##
==========================================
- Coverage   48.10%   47.88%   -0.22%     
==========================================
  Files          59       59              
  Lines        2871     2865       -6     
==========================================
- Hits         1381     1372       -9     
- Misses       1241     1243       +2     
- Partials      249      250       +1     
Flag Coverage Δ
unittests 47.88% <ø> (-0.22%) ⬇️

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

Impacted Files Coverage Δ
...nt/frameworks/constraint/pkg/client/client_opts.go 100.00% <0.00%> (ø)
...-agent/frameworks/constraint/pkg/client/backend.go
...ent/frameworks/constraint/pkg/client/new_client.go 61.11% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd1085b...b22e758. Read the comment docs.

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

Signed-off-by: Will Beason <willbeason@google.com>
@willbeason
Copy link
Member Author

Note that Gatekeeper failing is expected since backend instantiation changed. I'll send a PR to fix in gatekeeper.

@willbeason willbeason merged commit 2c8fe2d into open-policy-agent:master Feb 10, 2022
@willbeason willbeason deleted the no-backend branch February 10, 2022 18:44
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

4 participants