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

Cleanup kustomize manifests rendering action #1353

Conversation

lburgazzoli
Copy link
Contributor

@lburgazzoli lburgazzoli commented Nov 7, 2024

This commit is meant to cleanup the kustomize manifest redering by:

  • removing a useless parameter related to the caching mechanism
  • moving the code to the kustomize package to accomodate other rendering
    engines
  • introduce metrics tro track how many resources have been rendered and
    to perform blackbox testing against the action
➜ http :8080/metrics | grep action
# HELP action_renderer_manifests_total Number of rendered resources
# TYPE action_renderer_manifests_total counter
action_renderer_manifests_total{controller="dashboard",engine="kustomize"} 36

Description

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Comment on lines +241 to +248
switch i {
case 0:
g.Expect(rc).Should(BeNumerically("==", 1))
case 1:
g.Expect(rc).Should(BeNumerically("==", 2))
case 2:
g.Expect(rc).Should(BeNumerically("==", 2))
}
Copy link
Member

Choose a reason for hiding this comment

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

not sure i fully understand this case:
so we have 3 replica of dashboard,
for the 1st one, gauge should set be 1
for the 2nd one, then gauge to 2
and the last one, to 3.
or i mistunderstood this

Copy link
Contributor Author

@lburgazzoli lburgazzoli Nov 7, 2024

Choose a reason for hiding this comment

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

no, this is not about replicas, this is about testing the cache so:

  • 1st iteration, the counter should be 1, because nothing did exist before
  • 2nd iteration, it should be 2, because the Generation field of the live object has changed
  • 3rd iteration, it should still 3, because nothing has changed so no rendering should have been performed and values are taken from the cache

Copy link
Member

Choose a reason for hiding this comment

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

ok i see, so the test is to generate a 3 times-loop to minic :
i = 0, first time creation, no cache, increase in guage
i= 1, render when generateion already as 1, get from cache, increase in gauge
i= 2, render but with same generation value, no increase in gauge
no need more, till be same as i=2

Copy link
Contributor

Choose a reason for hiding this comment

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

So, case 1,2: that you do not spend effort to compare symbol by symbol equal branches?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in 1,2 is where the action return the previously rendered resources because the source of customization has not changed

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (feature-operator-refactor@4906ffe). Learn more about missing BASE report.

Additional details and impacted files
@@                     Coverage Diff                      @@
##             feature-operator-refactor    #1353   +/-   ##
============================================================
  Coverage                             ?   24.45%           
============================================================
  Files                                ?       53           
  Lines                                ?     4294           
  Branches                             ?        0           
============================================================
  Hits                                 ?     1050           
  Misses                               ?     3113           
  Partials                             ?      131           

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

This commit is meant to cleanup the kustomize manifest redering by:
- removing a useless parameter related to the caching mechanism
- moving the code to the kustomize package to accomodate other rendering
  engines
- introduce metrics tro track how many resources have been rendered and
  to perform blackbox testing against the action
@lburgazzoli lburgazzoli force-pushed the render-action-cleanup branch from bc1410e to 5ccb9c4 Compare November 8, 2024 08:21
Comment on lines +241 to +248
switch i {
case 0:
g.Expect(rc).Should(BeNumerically("==", 1))
case 1:
g.Expect(rc).Should(BeNumerically("==", 2))
case 2:
g.Expect(rc).Should(BeNumerically("==", 2))
}
Copy link
Member

Choose a reason for hiding this comment

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

ok i see, so the test is to generate a 3 times-loop to minic :
i = 0, first time creation, no cache, increase in guage
i= 1, render when generateion already as 1, get from cache, increase in gauge
i= 2, render but with same generation value, no increase in gauge
no need more, till be same as i=2

@openshift-ci openshift-ci bot added the lgtm label Nov 8, 2024
Copy link

openshift-ci bot commented Nov 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zdtsw

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Nov 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit f941791 into opendatahub-io:feature-operator-refactor Nov 8, 2024
10 checks passed
@lburgazzoli lburgazzoli deleted the render-action-cleanup branch November 8, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants