Skip to content

fix: generate mock name for expanded resources#2529

Merged
ritazh merged 6 commits into
open-policy-agent:masterfrom
davis-haba:expansion-mock-names
Mar 14, 2023
Merged

fix: generate mock name for expanded resources#2529
ritazh merged 6 commits into
open-policy-agent:masterfrom
davis-haba:expansion-mock-names

Conversation

@davis-haba
Copy link
Copy Markdown
Contributor

@davis-haba davis-haba commented Jan 21, 2023

Signed-off-by: davis-haba davishaba@google.com

What this PR does / why we need it:

Generates a mock name for expanded resources. The mock name is a function of the generator's name, and the resultant kind.

A deployment named nginx-deployment which expands into a Pod would create a resultant Pod with a name nginx-deployment-pod.

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Partly fixes #2485

Fix to update match schema will be added in separate PR.

@davis-haba davis-haba requested a review from maxsmythe January 21, 2023 02:06
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.78%. Comparing base (1a3fee5) to head (a0c0d37).
Report is 650 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2529      +/-   ##
==========================================
+ Coverage   53.68%   53.78%   +0.09%     
==========================================
  Files         120      120              
  Lines       10634    10643       +9     
==========================================
+ Hits         5709     5724      +15     
+ Misses       4496     4491       -5     
+ Partials      429      428       -1     
Flag Coverage Δ
unittests 53.78% <100.00%> (+0.09%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread pkg/expansion/system.go Outdated
Comment thread pkg/expansion/system.go
Copy link
Copy Markdown
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 with one nit

Comment thread pkg/expansion/system.go Outdated
@maxsmythe
Copy link
Copy Markdown
Contributor

Though it looks like unit tests are breaking

Copy link
Copy Markdown
Contributor

@acpana acpana left a comment

Choose a reason for hiding this comment

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

pending fix for TestExpand

@maxsmythe
Copy link
Copy Markdown
Contributor

DCO check is failing?

Signed-off-by: davis-haba <davishaba@google.com>
Signed-off-by: davis-haba <davishaba@google.com>
Signed-off-by: davis-haba <davishaba@google.com>
Signed-off-by: davis-haba <davishaba@google.com>
@davis-haba davis-haba force-pushed the expansion-mock-names branch from 7e18e49 to f4bdf03 Compare March 10, 2023 06:51
@maxsmythe maxsmythe requested review from ritazh and sozercan March 13, 2023 23:19
Copy link
Copy Markdown
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.

LGTM

Copy link
Copy Markdown
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

LGTM

I updated the PR description to match the updated implementation.

@ritazh ritazh merged commit f4d2d0f into open-policy-agent:master Mar 14, 2023
davis-haba added a commit to davis-haba/gatekeeper that referenced this pull request Mar 23, 2023
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
salaxander pushed a commit to salaxander/gatekeeper that referenced this pull request Apr 5, 2023
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
Signed-off-by: Xander Grzywinski <xandergr@microsoft.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.

Expanded resource not evaluated for constraint

7 participants