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: show deployment status and timeline for helm apps deployed via gitops #3299

Conversation

prakash100198
Copy link
Contributor

Description

This pr incorporates the feature for showing deployment status timelines for helm apps that are deployed via gitops. Currently we only show deployment status timeline for devtron apps that are deployed via gitops.

Fixes #2429

How Has This Been Tested?

  • I've tested this by deploying the changes in my cluster as well as locally. Following are the test scenarios that I've covered:-
  1. Check if entries for newly deployed helm charts are getting stored correctly in the respective tables, such as app, installed_apps, installed_app_versions, inatelled_app_version_history.
  2. Check if the pipeline timeline status entries are being stored in these three tables or not for a corresponding helm chart:- pipeline_status_timeline, pipeline_status_timeline_resources and pipeline_status_timeline_sync_detail.
  3. Check for multiple cases when the helm chart deployment status is healthy , degraded, timed out. Progressing or etc.
  4. Deploy a chart with random values, then its status should be degraded, then if the resources are in a progressing state for some time then the entry stored in the database should be Timed Out, check multiple cases like this.
  5. Since this will also impact the code of all applications deployed via gitops be it devtron also checks by deploying devton apps via gitops, it should work as before.
  6. Check the behavior by simultaneously deploying multiple charts at once.
  7. Status on previously deployed helm apps.
  8. Status on previously deployed devtron apps
  9. Status on newly created devtron apps
  10. Deploy charts in bulk and see if entries are getting stored correctly in db or not

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


…oyment status for an app with resource tree call
…e status called when fetching resource tree for app store application
}
resourceName := handler.enforcerUtil.GetAppRBACNameByAppId(installedAppId)
token := r.Header.Get("token")
if ok := handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionGet, resourceName); !ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

need to check environment enforcer

var timelines []*PipelineStatusTimeline
err := impl.dbConnection.Model(&timelines).
Where("installed_app_version_history_id = ?", installedAppVersionHistoryId).
Where("status in (?)", pg.In(statuses)).Select()
Copy link
Contributor

Choose a reason for hiding this comment

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

check type of statueses

@@ -1153,7 +1155,7 @@ func (impl *WorkflowDagExecutorImpl) updatePreviousDeploymentStatus(currentRunne
UpdatedOn: time.Now(),
},
}
timelineErr = impl.pipelineStatusTimelineService.SaveTimeline(timeline, nil)
timelineErr = impl.pipelineStatusTimelineService.SaveTimeline(timeline, nil, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

isAppStore

vikramdevtron
vikramdevtron previously approved these changes May 2, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 8, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 28 Code Smells

No Coverage information No Coverage information
5.4% 5.4% Duplication

@prakash100198 prakash100198 merged commit 122fd0c into main May 8, 2023
@prakash100198 prakash100198 deleted the show-deployment-status-and-timeline-for-helm-apps-via-gitops branch May 8, 2023 13:45
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.

Feature: UI feedback required on Deployments
3 participants