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

feat: Adding ClusterAnalysisTemplate support for Stage verifications #2673

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

BenHesketh21
Copy link
Contributor

@BenHesketh21 BenHesketh21 commented Oct 6, 2024

closes #2481

ClusterAnalysisTemplate Support

This PR adds the ability to refer to cluster level analysis templates using the clusterScope option (inspired by Argo Rollouts).
The verification process finds all the templates and combines them in one run, in the same way as before but now will also find referenced ClusterAnalysisTemplates if clusterScope is set to true.
The UI has also been updated to show both scopes of analysis templates.

Image from Gyazo

@BenHesketh21 BenHesketh21 requested review from a team as code owners October 6, 2024 22:33
Copy link

netlify bot commented Oct 6, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit c1fd414
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/670313a8391e19000817b21d
😎 Deploy Preview https://deploy-preview-2673.kargo.akuity.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 6, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 84ef8cc
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/6739066a870e2b0008a8a48c
😎 Deploy Preview https://deploy-preview-2673.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@BenHesketh21 BenHesketh21 changed the title Adding ClusterAnalysisTemplate support for Stage verifications feat: Adding ClusterAnalysisTemplate support for Stage verifications Oct 6, 2024
Copy link

codecov bot commented Oct 6, 2024

Codecov Report

Attention: Patch coverage is 89.11917% with 21 lines in your changes missing coverage. Please review.

Project coverage is 50.20%. Comparing base (aa66473) to head (aba7dc4).

Files with missing lines Patch % Lines
...ternal/api/get_clusteranalysistemplate_v1alpha1.go 82.00% 6 Missing and 3 partials ⚠️
...ntroller/rollouts/api/v1alpha1/analysis_helpers.go 72.22% 5 Missing ⚠️
internal/controller/stages/verification.go 95.06% 3 Missing and 1 partial ⚠️
...rnal/api/list_clusteranalysistemplates_v1alpha1.go 85.71% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2673      +/-   ##
==========================================
+ Coverage   49.97%   50.20%   +0.22%     
==========================================
  Files         276      279       +3     
  Lines       24811    24967     +156     
==========================================
+ Hits        12400    12535     +135     
- Misses      11724    11740      +16     
- Partials      687      692       +5     

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

@krancour krancour modified the milestones: v1.0.0, Post-GA Oct 7, 2024
@krancour
Copy link
Member

krancour commented Nov 7, 2024

@BenHesketh21 thank you for your patience with this. I've finally started reviewing this in earnest. What I've looked at so far looks solid, but this is big and there's a lot more to still look at.

Due to the size and complexity, I'm going to ask @hiddeco and @Marvin9 for help with this. Group effort.

@hiddeco since this touches the Stages reconciler, which you are actively refactoring, controller changes here probably need to be on your radar.

@Marvin9 if you don't mind looking at the UI portions of this, it would be a huge help.

I am happy to review the remainder -- e.g. API server changes, docs, and such.

We will try to get this into v1.1.0, but it cannot be guaranteed.

import { EditAnalysisTemplateModal } from './edit-analysis-template-modal';
import { EditClusterAnalysisTemplateModal } from './edit-cluster-analysis-template-modal';

const ClusterAnalysisTemplatesList = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please split this component out in separate file? You might want to revert (not git revert) this change back to its previous state anyways for the reason I will put in my next comment.

Copy link
Contributor

@Marvin9 Marvin9 left a comment

Choose a reason for hiding this comment

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

Sorry for late review, Overall UI LGTM!

Only thing that is blocking is that since Cluster scoped templates are not really project scoped they should not be in individual projects page. I would suggest to have same clickops experience as in project analysis templates but rather on home page (ie. project list page).

Let me know if you have any question

@BenHesketh21
Copy link
Contributor Author

@Marvin9 Thanks for the review. Definitely makes sense to take it out of projects and into a different page. Would we want to add a "Analysis Templates" section to the left side menu? or introduce a similar tab system to the project list page?

@BenHesketh21
Copy link
Contributor Author

@Marvin9 I've gone with the approach of adding an Analysis button to the left hand menu for now, let me know if you would rather it be done a different way.
ee926285ac6ed5088b06d6188bb82a1a

Signed-off-by: BenHesketh21 <[email protected]>
@krancour
Copy link
Member

Would we want to add a "Analysis Templates" section to the left side menu? or introduce a similar tab system to the project list page?

I would suggest, instead, a "Settings" item on the sidebar (with a gear as the icon) and have the UI for this be under a "Verifications" tab on that settings page. We currently lack any sort of UI for these other "cluster-scoped" things:

  • Credentials (Really, these are Secrets in designated namespaces since there's no such thing as a cluster-scoped Secret.)
  • ServiceAccounts. (Again, these are actually in designated namespaces.)
  • ClusterRoles + ClusterRoleBindings for the aforementioned SAs

As we add those, a tabbed settings page would prevent the left sidebar from getting too noisy. And I think this is a fairly conventional approach anyway.

@krancour krancour modified the milestones: v1.1.0, v1.2.0 Nov 15, 2024
@Marvin9
Copy link
Contributor

Marvin9 commented Nov 15, 2024

I agree with @krancour here. I initially thought put in sidebar and new page but couldn't find a reason to justify its place there (its the only cluster wide settings at the moment). I am fine under "settings" with "verification" tab. I would use Menu component from Antd to have vertical tab.

@BenHesketh21
Copy link
Contributor Author

I'll get on that, thank you for the pointers

@BenHesketh21
Copy link
Contributor Author

@Marvin9 One thing I'm not so sure on if you could clarify. I'm looking at a vertical tab using the Menu from Antd. I'm struggling to picture how it would look and where it would go? Here's my thinking so far.

  1. It could be like a second sidebar on the left
  2. We could move it to the right
  3. The verification and others could be children items of the settings button on the left sidebar

Let me know your thoughts, thanks.

@BenHesketh21
Copy link
Contributor Author

I've done the main parts of this, just waiting to see what the tabs should look like if they need to be vertical. I've put it in a horizontal one for now as it was the default. But the settings page with different tabs should be working.
585db1c6f8c5777213543506aad39010

@Marvin9
Copy link
Contributor

Marvin9 commented Nov 18, 2024

Sure thing @BenHesketh21 here is how I imagine it would look like considering more settings incoming

image

Let me know if its feasible to you otherwise I would refactor the layout later this PR and for now we can keep the tab as in your screenshot. I will put my comments after we finalise what are we scoping for this PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stages should support referencing of ClusterAnalysisTemplates
4 participants