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

Releasebot global image v2 #4927

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1620bf3
fix: trim space from git repo Url on create and update material (#4787)
Shivam-nagar23 Mar 13, 2024
3851f82
feat: active inactive user phase 3 (#4649)
Shivam-nagar23 Mar 18, 2024
d68d034
fix: extra check added for mono-repo migraiton (#4764)
prakash100198 Mar 18, 2024
ef2bc39
added request method in audit logger (#4817)
raunit-verma Mar 19, 2024
4c59576
fix: rolefilters correction with all applications and particular app…
Shivam-nagar23 Mar 20, 2024
3cbf2b1
fix: 5xx 4.0 iter (#4620)
prakash100198 Mar 20, 2024
dc49da4
chore: refactoring v4 (#4775)
kartik-579 Mar 20, 2024
8e4cc36
fix: hide ldap creds in in get req (#4788)
prakash100198 Mar 20, 2024
4da24a7
pointer binding (#4826)
Shivam-nagar23 Mar 21, 2024
b93c00f
feat: Branch Divergence Checker Plugin (#4806)
YashasviDevtron Mar 21, 2024
392b156
feat: Added Apply job in k8s plugin (#4828)
kirandevtn Mar 21, 2024
c7d2add
feat: Information of Linked CI Pipelines on Parent CI Pipeline (#4786)
Ash-exp Mar 21, 2024
ce94374
feat:Github Pull Request Closer (#4833)
YashasviDevtron Mar 22, 2024
dc0cf7d
chore: Image scanning refactoring (#4802)
kartik-579 Mar 22, 2024
3467863
fix: helm deployements stucked in queued for devtron apps (#4842)
Ash-exp Mar 27, 2024
a37e3df
ns not found in case ips is being injected in cluster (#4844)
prakash100198 Mar 28, 2024
ab5233f
misc: Pagerduty issue template change (#4796)
prakarsh-dt Mar 28, 2024
126b697
Update pager-duty.yaml (#4850)
prakarsh-dt Mar 28, 2024
698e4ab
Update github_pagerduty_score_calculation.yml (#4853)
prakarsh-dt Mar 28, 2024
ed12278
Added Field Path in Deployment Template (#4852)
ashokdevtron Mar 28, 2024
4874646
misc: Refactoring Pagerduty Issue Calculator script (#4856)
YashasviDevtron Apr 1, 2024
8ceed72
feat: Add support for git hash in the app and app group overview sect…
RajeevRanjan27 Apr 1, 2024
ac6802f
feat:MailMaster Plugin v1.0 (#4825)
akshatsinha007 Apr 1, 2024
907142d
return nil,err on git material fetch error (#4857)
prakash100198 Apr 2, 2024
9cb524d
removed code for gitops repo migration in devtron apps (#4838)
prakash100198 Apr 3, 2024
6b74445
fix: update argo app repo url in patch (#4876)
gireesh-naidu Apr 3, 2024
0b45f25
fix: injected app-serveice dependency into DeployedApplicationEventPr…
gireesh-naidu Apr 3, 2024
606a33b
fix: depandabot version upgrade (#4792)
ShashwatDadhich Apr 4, 2024
ee355d1
expose global container registry for all microservices
Apr 6, 2024
724dfd9
merge global-image expose branch
Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ scripts/devtron-reference-helm-charts @prakarsh-dt @pawan-mehta-dt @nishant-d

#Migration scripts
scripts/sql @prakarsh-dt @vikramdevtron @kripanshdevtron @nishant-d
scripts/utilities @prakarsh-dt @nishant-d @pawan-mehta-dt

#Github Specific
.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt
73 changes: 58 additions & 15 deletions .github/ISSUE_TEMPLATE/pager-duty.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,66 @@ body:
description: "A clear and concise description of what the bug is."
placeholder: "It bugs out when ..."
- type: dropdown
id: criticality
id: affected-areas
attributes:
label: "Criticality"
description: "How critical is the issue? Please include the impact in the "
label: "Affected areas"
description: "What areas of Devtron are impacted by the issue?"
options:
- P0 - Critical/Blocking
- P1 - High
- P2 - Medium
- P3 - Low
- Devtron dashboard completely down
- Login issues
- RBAC Issues
- CI
- CD
- App creation
- Deployment from Chart store
- Security features
- CI/CD Plugins
- Other CRITICAL functionality
- Other NON-CRITICAL functionality
- type: dropdown
id: additional-affected-areas
attributes:
label: "Additional affected areas"
description: "Are there any additional affected areas?"
options:
- Devtron dashboard completely down
- Login issues
- RBAC Issues
- CI
- CD
- App creation
- Deployment from Chart store
- Security features
- CI/CD Plugins
- Other CRITICAL functionality
- Other NON-CRITICAL functionality
- type: dropdown
id: prod-environment
attributes:
label: "Prod/Non-prod environments?"
description: "Is the issue affecting Prod environments?"
options:
- Prod
- Non-prod
- type: dropdown
id: user-unblocked
attributes:
label: "Is User unblocked?"
description: "Is the User unblocked?"
options:
- 'Yes'
- 'No'
- type: dropdown
id: user-unblocked-reason
attributes:
label: "How was the user un-blocked?"
description: "If the user was unblocked. How was the user un-blocked?"
options:
- TEMPORARILY - By disabling a CRITICAL functionality
- TEMPORARILY - By disabling a NON-CRITICAL functionality
- TEMPORARILY - By doing some changes from the backend/DB
- PERMANENTLY - By giving a workaround (From outside Devtron)
- PERMANENTLY - By giving a workaround (Within Devtron)
- type: textarea
id: impact
validations:
Expand Down Expand Up @@ -91,14 +142,6 @@ body:
- Something Else
validations:
required: true
- type: textarea
id: environment
validations:
required: false
attributes:
label: "🧱 Your Environment"
description: "Is your environment customized in any way? Provide your Browser version as well."
placeholder: "I use XYZ for ..."
- type: textarea
id: solution
validations:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/github_pagerduty_score_calculation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Issue Created
on:
issues:
types: [opened]

jobs:
extract-issue-body:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Check if pager-duty template is used
if: ${{ contains(github.event.issue.labels.*.name, 'pager-duty') && contains(github.event.issue.labels.*.name, 'bug') }}
run: |
echo "Issue was created using pager-duty template"
python3 scripts/utilities/github_pagerduty_issue_score_calculation.py
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_BODY: ${{ github.event.issue.body }}
GITHUB_TOKEN: ${{ github.token }}
PAGERDUTY_SCORE_THRESHOLD: ${{ vars.PAGERDUTY_SCORE_THRESHOLD }}
4 changes: 0 additions & 4 deletions App.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (

"github.com/casbin/casbin"
authMiddleware "github.com/devtron-labs/authenticator/middleware"
pubsub "github.com/devtron-labs/common-lib/pubsub-lib"
"github.com/devtron-labs/devtron/api/router"
"github.com/devtron-labs/devtron/api/sse"
"github.com/devtron-labs/devtron/internal/middleware"
Expand All @@ -52,7 +51,6 @@ type App struct {
Enforcer *casbin.SyncedEnforcer
server *http.Server
db *pg.DB
pubsubClient *pubsub.PubSubClientServiceImpl
posthogClient *telemetry.PosthogClient
centralEventProcessor *eventProcessor.CentralEventProcessor
// used for local dev only
Expand All @@ -67,7 +65,6 @@ func NewApp(router *router.MuxRouter,
sse *sse.SSE,
enforcer *casbin.SyncedEnforcer,
db *pg.DB,
pubsubClient *pubsub.PubSubClientServiceImpl,
sessionManager2 *authMiddleware.SessionManager,
posthogClient *telemetry.PosthogClient,
loggingMiddleware util.LoggingMiddleware,
Expand All @@ -81,7 +78,6 @@ func NewApp(router *router.MuxRouter,
SSE: sse,
Enforcer: enforcer,
db: db,
pubsubClient: pubsubClient,
serveTls: false,
sessionManager2: sessionManager2,
posthogClient: posthogClient,
Expand Down
9 changes: 0 additions & 9 deletions Wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import (
status3 "github.com/devtron-labs/devtron/api/router/app/pipeline/status"
trigger2 "github.com/devtron-labs/devtron/api/router/app/pipeline/trigger"
workflow2 "github.com/devtron-labs/devtron/api/router/app/workflow"
"github.com/devtron-labs/devtron/api/router/pubsub"
"github.com/devtron-labs/devtron/api/server"
"github.com/devtron-labs/devtron/api/sse"
"github.com/devtron-labs/devtron/api/team"
Expand Down Expand Up @@ -491,12 +490,6 @@ func InitializeApp() (*App, error) {

pubsub1.NewPubSubClientServiceImpl,

pubsub.NewGitWebhookHandler,
wire.Bind(new(pubsub.GitWebhookHandler), new(*pubsub.GitWebhookHandlerImpl)),

pubsub.NewApplicationStatusHandlerImpl,
wire.Bind(new(pubsub.ApplicationStatusHandler), new(*pubsub.ApplicationStatusHandlerImpl)),

rbac.NewEnforcerUtilImpl,
wire.Bind(new(rbac.EnforcerUtil), new(*rbac.EnforcerUtilImpl)),

Expand Down Expand Up @@ -966,8 +959,6 @@ func InitializeApp() (*App, error) {
pipeline.NewPluginInputVariableParserImpl,
wire.Bind(new(pipeline.PluginInputVariableParser), new(*pipeline.PluginInputVariableParserImpl)),

pipeline.NewPipelineConfigListenerServiceImpl,
wire.Bind(new(pipeline.PipelineConfigListenerService), new(*pipeline.PipelineConfigListenerServiceImpl)),
cron2.NewCronLoggerImpl,

imageDigestPolicy.NewImageDigestPolicyServiceImpl,
Expand Down
11 changes: 6 additions & 5 deletions api/appbean/AppDetail.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
"github.com/devtron-labs/devtron/pkg/chartRepo/repository"
"github.com/devtron-labs/devtron/pkg/pipeline/bean"
"github.com/devtron-labs/devtron/pkg/pipeline/bean/CiPipeline"
)

type AppDetail struct {
Expand Down Expand Up @@ -45,11 +46,11 @@ type GitMaterial struct {
}

type DockerConfig struct {
DockerRegistry string `json:"dockerRegistry" validate:"required"`
DockerRepository string `json:"dockerRepository" validate:"required"`
CiBuildConfig *bean.CiBuildConfigBean `json:"ciBuildConfig"`
DockerBuildConfig *DockerBuildConfig `json:"dockerBuildConfig,omitempty"` // Deprecated, should use CiBuildConfig for development
CheckoutPath string `json:"checkoutPath"`
DockerRegistry string `json:"dockerRegistry" validate:"required"`
DockerRepository string `json:"dockerRepository" validate:"required"`
CiBuildConfig *CiPipeline.CiBuildConfigBean `json:"ciBuildConfig"`
DockerBuildConfig *DockerBuildConfig `json:"dockerBuildConfig,omitempty"` // Deprecated, should use CiBuildConfig for development
CheckoutPath string `json:"checkoutPath"`
}

type DockerBuildConfig struct {
Expand Down
62 changes: 40 additions & 22 deletions api/auth/user/UserRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"
"errors"
"fmt"
util2 "github.com/devtron-labs/devtron/api/auth/user/util"
"github.com/devtron-labs/devtron/pkg/auth/user/helper"
"github.com/gorilla/schema"
"net/http"
Expand Down Expand Up @@ -110,6 +111,23 @@ func (handler UserRestHandlerImpl) CreateUser(w http.ResponseWriter, r *http.Req
userInfo.UserId = userId
handler.logger.Infow("request payload, CreateUser", "payload", userInfo)

// struct Validations
handler.logger.Infow("request payload, CreateUser ", "payload", userInfo)
err = handler.validator.Struct(userInfo)
if err != nil {
handler.logger.Errorw("validation err, CreateUser", "err", err, "payload", userInfo)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
// Doing this as api is not compatible with previous release of dashboard, groups has been migrated to userRoleGroups
isGroupsPresent := util2.IsGroupsPresent(userInfo.Groups)
if isGroupsPresent {
handler.logger.Errorw("validation error , createUser ", "err", err, "payload", userInfo)
err := &util.ApiError{Code: "406", HttpStatusCode: 406, UserMessage: "Not compatible with request", InternalMessage: "Not compatible with the request payload, as groups has been migrated to userRoleGroups"}
common.WriteJsonResp(w, err, nil, http.StatusNotAcceptable)
return
}

// RBAC enforcer applying
token := r.Header.Get("token")
isActionUserSuperAdmin := false
Expand Down Expand Up @@ -143,8 +161,8 @@ func (handler UserRestHandlerImpl) CreateUser(w http.ResponseWriter, r *http.Req
}

// auth check inside groups
if len(userInfo.Groups) > 0 {
groupRoles, err := handler.roleGroupService.FetchRolesForGroups(userInfo.Groups)
if len(userInfo.UserRoleGroup) > 0 {
groupRoles, err := handler.roleGroupService.FetchRolesForUserRoleGroups(userInfo.UserRoleGroup)
if err != nil && err != pg.ErrNoRows {
handler.logger.Errorw("service err, UpdateUser", "err", err, "payload", userInfo)
common.WriteJsonResp(w, err, "", http.StatusInternalServerError)
Expand Down Expand Up @@ -173,14 +191,6 @@ func (handler UserRestHandlerImpl) CreateUser(w http.ResponseWriter, r *http.Req
}
//RBAC enforcer Ends

handler.logger.Infow("request payload, CreateUser ", "payload", userInfo)
err = handler.validator.Struct(userInfo)
if err != nil {
handler.logger.Errorw("validation err, CreateUser", "err", err, "payload", userInfo)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}

res, err := handler.userService.CreateUser(&userInfo, token, handler.CheckManagerAuth)
if err != nil {
handler.logger.Errorw("service err, CreateUser", "err", err, "payload", userInfo)
Expand Down Expand Up @@ -222,6 +232,14 @@ func (handler UserRestHandlerImpl) UpdateUser(w http.ResponseWriter, r *http.Req
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
// Doing this as api is not compatible with previous release of dashboard,groups has been migrated to userRoleGroups
isGroupsPresent := util2.IsGroupsPresent(userInfo.Groups)
if isGroupsPresent {
handler.logger.Errorw("validation error , createUser ", "err", err, "payload", userInfo)
err := &util.ApiError{Code: "406", HttpStatusCode: 406, UserMessage: "Not compatible with request, please update to latest version", InternalMessage: "Not compatible with the request payload, as groups has been migrated to userRoleGroups"}
common.WriteJsonResp(w, err, nil, http.StatusNotAcceptable)
return
}

res, rolesChanged, groupsModified, restrictedGroups, err := handler.userService.UpdateUser(&userInfo, token, handler.CheckManagerAuth)

Expand Down Expand Up @@ -327,10 +345,10 @@ func (handler UserRestHandlerImpl) GetAllV2(w http.ResponseWriter, r *http.Reque
return
}
var roleFilters []bean.RoleFilter
if len(user.Groups) > 0 {
groupRoleFilters, err := handler.userService.GetRoleFiltersByGroupNames(user.Groups)
if len(user.UserRoleGroup) > 0 {
groupRoleFilters, err := handler.userService.GetRoleFiltersByUserRoleGroups(user.UserRoleGroup)
if err != nil {
handler.logger.Errorw("Error in getting role filters by group names", "err", err, "groupNames", user.Groups)
handler.logger.Errorw("Error in getting role filters by group names", "err", err, "UserRoleGroup", user.UserRoleGroup)
common.WriteJsonResp(w, err, "", http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -397,10 +415,10 @@ func (handler UserRestHandlerImpl) GetAll(w http.ResponseWriter, r *http.Request
return
}
var roleFilters []bean.RoleFilter
if len(user.Groups) > 0 {
groupRoleFilters, err := handler.userService.GetRoleFiltersByGroupNames(user.Groups)
if len(user.UserRoleGroup) > 0 {
groupRoleFilters, err := handler.userService.GetRoleFiltersByUserRoleGroups(user.UserRoleGroup)
if err != nil {
handler.logger.Errorw("Error in getting role filters by group names", "err", err, "groupNames", user.Groups)
handler.logger.Errorw("Error in getting role filters by group names", "err", err, "UserRoleGroup", user.UserRoleGroup)
common.WriteJsonResp(w, err, "", http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -784,10 +802,10 @@ func (handler UserRestHandlerImpl) FetchRoleGroupsV2(w http.ResponseWriter, r *h
return
}
var roleFilters []bean.RoleFilter
if len(user.Groups) > 0 {
groupRoleFilters, err := handler.userService.GetRoleFiltersByGroupNames(user.Groups)
if len(user.UserRoleGroup) > 0 {
groupRoleFilters, err := handler.userService.GetRoleFiltersByUserRoleGroups(user.UserRoleGroup)
if err != nil {
handler.logger.Errorw("Error in getting role filters by group names", "err", err, "groupNames", user.Groups)
handler.logger.Errorw("Error in getting role filters by group names", "err", err, "UserRoleGroup", user.UserRoleGroup)
common.WriteJsonResp(w, err, "", http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -855,10 +873,10 @@ func (handler UserRestHandlerImpl) FetchRoleGroups(w http.ResponseWriter, r *htt
return
}
var roleFilters []bean.RoleFilter
if len(user.Groups) > 0 {
groupRoleFilters, err := handler.userService.GetRoleFiltersByGroupNames(user.Groups)
if len(user.UserRoleGroup) > 0 {
groupRoleFilters, err := handler.userService.GetRoleFiltersByUserRoleGroups(user.UserRoleGroup)
if err != nil {
handler.logger.Errorw("Error in getting role filters by group names", "err", err, "groupNames", user.Groups)
handler.logger.Errorw("Error in getting role filters by group names", "err", err, "UserRoleGroup", user.UserRoleGroup)
common.WriteJsonResp(w, err, "", http.StatusInternalServerError)
return
}
Expand Down
8 changes: 8 additions & 0 deletions api/auth/user/util/util.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package util

func IsGroupsPresent(groups []string) bool {
if len(groups) > 0 {
return true
}
return false
}
Loading
Loading