Skip to content

Commit

Permalink
misc: sync with common-lib changes with release candidate 18 (#5830)
Browse files Browse the repository at this point in the history
* added config sql script (#5681)

* feat: CVE severity categorisation and scan result listing API enhancements (#5617)

* feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support

* fix: query fix for appName sort or envName sort

* fix: sql script number change

* fix: minor changes

* fix: review fix

* fix: remove dml on cve_store and handle it in code handling this versioning

* fix: review comments

* fix: update script numbers

* fix: minor fix

* feat: casbin deny policy sql scripts (#5677)

* system controller scripts

* script additions

* sql cript update

* sql script number chnage

* feat: Config diff phase 2 oss (#5488)

* story(configDiffView) : open api spec

* story(configDiffView) : open api spec updated

* story(configDiffView) : open api spec updated for error state

* story(configDiffView) : WIP

* story(configDiffView) : WIP "some code changed"

* story(configDiffView) : support for names added

* story(configDiffView) : iota removed

* story(configDiffView) : pg no rows handled

* story(configDiffView) : spelling check

* story(configDiffView) : code review comment resolved

* story(configDiffView) : env id added

* story(configDiffView) : intersection added

* story(configDiffView) : comments removed

* story(configDiffView) : code review comment resolved

* story(configDiffView) : comment removed

* story(configDiffView) : CMCSNames DTO moved

* story(configDiffView) : null case handled

* story(configDiffView) : logger added

* story(configDiffView) : code refactored

* story(configDiffView) : code refactored v2

* story(configDiffView) : spec updated

* story(configDiffView) : code refactored

* story(configDiffView) : config names

* main sync

* overridden and global flag introduced in config diff autocomplete api

* ent sync

* get config data in resthandler

* new api for showing all config data in config/data :- Service func -> GetAllConfigData

* using a single key instead of global and overridden key in config/autocomplete api

* ConfigState made string instead of int

* not sending inheriting in case base config

* code review comment incorporation

* ent sync

* code review comment incorp -1

* code review comment incorp -2

* code review comment incorp -3

* small fix in plugin

* migration number changes (#5692)

* main sync

* minor fix

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* scipt number change

---------

Co-authored-by: adi6859 <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>

* fix: Helm apps entries in Ea mode (#5652)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* executed make after merging with develop branch

* feat: refactoring deployment app name usage (#5702)

* removing hard coded deployment app name

* removing %s-%s usage

* wip: query change for enterprise

* wip

* wip

* wip

* adding release mode in deployment config

* wip: release changes

* left join on pco and artifact

* handling empty release mode - backward compatibility

* fixing panic

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* migration updated

* main merge and migration script updated

* wip

* review changes

* fix sql no

---------

Co-authored-by: Prakash <[email protected]>

* migration syn with ent (#5719)

* fix: group image vulnerabilities by base/os image (#5680)

* feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support

* fix: query fix for appName sort or envName sort

* fix: sql script number change

* fix: minor changes

* fix: review fix

* fix: remove dml on cve_store and handle it in code handling this versioning

* fix: review comments

* feat: storing target,class and type values in imageScanExecutionResults

* feat: add sql script

* feat: add sql script

* fix: add new columns

* fix: update script numbers

* fix: correct down script

* fix: minor fix

* chore: script number update

* fix: remove sql script (#5727)

* Revert "fix: Helm apps entries in Ea mode (#5652)" (#5733)

This reverts commit f1aa1fca0624af32de5e620ceba4548488a07127.

* chore: custom argo-workflow dependency (#5731)

* bumped github.com/argoproj/argo-workflows/v3 v3.5.10 => github.com/devtron-labs/argo-workflows/v3 v3.5.10

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

* reverted main branch changes

* reverted main branch changes

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>

* chore: fix go.sum file (#5734)

* misc: Main sync develop (#5737)

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>

* chore: sql scripts sync (#5763)

* fix: Scan tool migration fix develop (#5773)

* scan tool active check removed

* query fix

* chore: Oss sync 2 sept 2024 oss (#5779)

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

* doc: Edit Deployment Chart Schema (#5735)

* Edit Deployment Chart Schema

* Fixes

* PM + CO Feedback Incorporated

* doc: Redirection of old entry in gitbook.yaml (#5738)

* Edit Deployment Chart Schema

* Fixes

* PM + CO Feedback Incorporated

* Redirected Old Entry

* docs: added Documentation for Air-Gapped Installation (#5360)

* added docs for air-gapped-installation

* added all the images in 7.0.0

* modified yq command in the docs

* added an entry in summary.md

* added installation commands

* modified statements

* modified variable name

* added steps to navigation

* added the latest oss chart images

* added a note for docker

* Added Intro + Proofreading + Structuring

* Other fixes

* Lang fix

* added docs for ea-mode only

* modified lang

* Update install-devtron-in-airgapped-environment.md

Changed h3 header to fit the ToC on the RHS

* added changes

* modified changes

---------

Co-authored-by: Badal Kumar Prusty <[email protected]>
Co-authored-by: ashokdevtron <[email protected]>

* feat: Env description handling (#5744)

* env description handling added

* license handling

* misc: Main sync rc - branch update (#5753)

* added config sql script (#5681)

* feat: CVE severity categorisation and scan result listing API enhancements (#5617)

* feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support

* fix: query fix for appName sort or envName sort

* fix: sql script number change

* fix: minor changes

* fix: review fix

* fix: remove dml on cve_store and handle it in code handling this versioning

* fix: review comments

* fix: update script numbers

* fix: minor fix

* feat: casbin deny policy sql scripts (#5677)

* system controller scripts

* script additions

* sql cript update

* sql script number chnage

* feat: Config diff phase 2 oss (#5488)

* story(configDiffView) : open api spec

* story(configDiffView) : open api spec updated

* story(configDiffView) : open api spec updated for error state

* story(configDiffView) : WIP

* story(configDiffView) : WIP "some code changed"

* story(configDiffView) : support for names added

* story(configDiffView) : iota removed

* story(configDiffView) : pg no rows handled

* story(configDiffView) : spelling check

* story(configDiffView) : code review comment resolved

* story(configDiffView) : env id added

* story(configDiffView) : intersection added

* story(configDiffView) : comments removed

* story(configDiffView) : code review comment resolved

* story(configDiffView) : comment removed

* story(configDiffView) : CMCSNames DTO moved

* story(configDiffView) : null case handled

* story(configDiffView) : logger added

* story(configDiffView) : code refactored

* story(configDiffView) : code refactored v2

* story(configDiffView) : spec updated

* story(configDiffView) : code refactored

* story(configDiffView) : config names

* main sync

* overridden and global flag introduced in config diff autocomplete api

* ent sync

* get config data in resthandler

* new api for showing all config data in config/data :- Service func -> GetAllConfigData

* using a single key instead of global and overridden key in config/autocomplete api

* ConfigState made string instead of int

* not sending inheriting in case base config

* code review comment incorporation

* ent sync

* code review comment incorp -1

* code review comment incorp -2

* code review comment incorp -3

* small fix in plugin

* migration number changes (#5692)

* main sync

* minor fix

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* scipt number change

---------

Co-authored-by: adi6859 <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>

* fix: Helm apps entries in Ea mode (#5652)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* executed make after merging with develop branch

* feat: refactoring deployment app name usage (#5702)

* removing hard coded deployment app name

* removing %s-%s usage

* wip: query change for enterprise

* wip

* wip

* wip

* adding release mode in deployment config

* wip: release changes

* left join on pco and artifact

* handling empty release mode - backward compatibility

* fixing panic

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* migration updated

* main merge and migration script updated

* wip

* review changes

* fix sql no

---------

Co-authored-by: Prakash <[email protected]>

* migration syn with ent (#5719)

* fix: group image vulnerabilities by base/os image (#5680)

* feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support

* fix: query fix for appName sort or envName sort

* fix: sql script number change

* fix: minor changes

* fix: review fix

* fix: remove dml on cve_store and handle it in code handling this versioning

* fix: review comments

* feat: storing target,class and type values in imageScanExecutionResults

* feat: add sql script

* feat: add sql script

* fix: add new columns

* fix: update script numbers

* fix: correct down script

* fix: minor fix

* chore: script number update

* fix: remove sql script (#5727)

* Revert "fix: Helm apps entries in Ea mode (#5652)" (#5733)

This reverts commit f1aa1fca0624af32de5e620ceba4548488a07127.

* chore: custom argo-workflow dependency (#5731)

* bumped github.com/argoproj/argo-workflows/v3 v3.5.10 => github.com/devtron-labs/argo-workflows/v3 v3.5.10

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

* reverted main branch changes

* reverted main branch changes

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>

* chore: fix go.sum file (#5734)

* misc: Main sync develop (#5737)

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>

* fix: Validate config cm cs (#5750)

* validateConfigRequest before CMGlobalAddUpdate and CSGlobalAddUpdate

* checkIfConfigDataAlreadyExist

---------

Co-authored-by: ayu-devtron <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>
Co-authored-by: Gireesh Naidu <[email protected]>
Co-authored-by: Shivam Nagar <[email protected]>
Co-authored-by: Prakash <[email protected]>
Co-authored-by: adi6859 <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: iamayushm <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>
Co-authored-by: Asutosh Das <[email protected]>
Co-authored-by: Vikram <[email protected]>
Co-authored-by: Prakarsh <[email protected]>

* doc: Update prerequisites of code-scan (#5625)

* Update prerequisites of code-scan

* Hyperlinked the Vulnerability scanning doc

---------

Co-authored-by: ashokdevtron <[email protected]>

* fix: ci patch rbac for branch update (#5759)

* feat: Added basic auth support for servicemonitor (#5761)

* Added support for basic auth in servicemonitor

* Added support for namespace selector and custom matchLabels

* Fixed indentations

* fix: Bitnami chart repo tls issue (#5740)

* bitnami_chart_fix

* Rename 278_bitnami_chart_fix.down.sql to 282_bitnami_chart_fix.down.sql

* Rename 278_bitnami_chart_fix.up.sql to 282_bitnami_chart_fix.up.sql

---------

Co-authored-by: Pawan Mehta <[email protected]>

* doc: Cosign plugin doc (#5665)

* doc for cosign plugin

* edits in task name

* updates in intro and other fixes.

* Attached link to Cosign GitHub repo

* Hyperlink fixes

---------

Co-authored-by: ashokdevtron <[email protected]>

* fix: check rbac on env if envName is present (#5765)

* admin check fix in config draft

* minor fix

* doc: CraneCopy plugin doc (#5658)

* doc for

* edits in task name

* spelling correction

* Updated password

---------

Co-authored-by: ashokdevtron <[email protected]>

* doc: Devtron CD Trigger Plugin doc  (#5747)

* devtron-cd-trigger plugin doc

* minor update

* Proofreading done

* Update devtron-cd-trigger.md

* Removed unwanted phrase

* Changed wording

* Changed plurality

* Updated devtron token

---------

Co-authored-by: ashokdevtron <[email protected]>

* doc: DockerSlim plugin doc (#5660)

* doc for DockerSlim plugin

* Updated Docker-Slim to DockerSlim

* Minor fixes

* url update

* Fixes in url

---------

Co-authored-by: ashokdevtron <[email protected]>

* doc: Devtron Job Trigger Plugin doc (#5742)

* devtron-job-trigger plugin doc

* summary updated

* Updated input variable description

* token value updated

---------

Co-authored-by: ashokdevtron <[email protected]>

* fix: scan tool active check removed (#5771)

* scan tool active check removed

* query fix

* feat: Docker pull env driven (#5767)

* useDockerApiToGetDigest menv driven flag to control pulling image either using docker pull or docker API

* UseAppDockerConfigForPrivateRegistries in workflow request

* revert

* revert

* fix: panic handlings and argocd app delete stuck in partial stage (#5770)

* fix: panic handlings

* fix: false positive matrics on gitOps failures

* fix: for GetConfigForHelmApps err: pg no row

* feat: plugin creation support (#5630)

* wip: new plugin creation api and min plugin api with only shared plugin list

* wip: create new plugin version code

* wip:plugin type SHARED by default

* wip:find plugin either by identifier or by id while creating a new version of existing plugin

* wip: create new plugin tag logic improved

* wip: optimize GetAllFilteredPluginParentMetadata query

* wip: create plugin tag new flow

* wip: minor fix

* wip: minor fix

* wip: minor fix

* wip: newTagsPresent -> areNewTagsPresent

* wip: icon is not  mandatory code incorporated

* wip:minor refactoring

* wip: prevent duplicate version from being created and save tags relation only when

* wip: minor fix

* wip: details api, get all plugin data or non

* wip: code review incorp part -1

* wip: code review incorp part -2

* wip: code review incorp part -3

* wip: remove code duplication

* wip: hardcode isExposed to true

* wip: hardcode StepType= inline

* wip: set default VariableStepIndex= 1

* Revert "feat: plugin creation support (#5630)" (#5778)

This reverts commit 4296366ae288f3a67f87e547d2b946acbcd2dd65.

* script no. fix

---------

Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>
Co-authored-by: ashokdevtron <[email protected]>
Co-authored-by: Badal Kumar <[email protected]>
Co-authored-by: Badal Kumar Prusty <[email protected]>
Co-authored-by: kripanshdevtron <[email protected]>
Co-authored-by: kartik-579 <[email protected]>
Co-authored-by: ayu-devtron <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>
Co-authored-by: Gireesh Naidu <[email protected]>
Co-authored-by: Shivam Nagar <[email protected]>
Co-authored-by: adi6859 <[email protected]>
Co-authored-by: iamayushm <[email protected]>
Co-authored-by: Asutosh Das <[email protected]>
Co-authored-by: Vikram <[email protected]>
Co-authored-by: Prakarsh <[email protected]>
Co-authored-by: Bhushan Nemade <[email protected]>
Co-authored-by: Pawan Mehta <[email protected]>
Co-authored-by: akshatsinha007 <[email protected]>

* chore: plugin creation oss (#5780)

* wip: new plugin creation api and min plugin api with only shared plugin list

* wip: create new plugin version code

* wip:plugin type SHARED by default

* wip:find plugin either by identifier or by id while creating a new version of existing plugin

* wip: create new plugin tag logic improved

* wip: optimize GetAllFilteredPluginParentMetadata query

* wip: create plugin tag new flow

* wip: minor fix

* wip: minor fix

* wip: minor fix

* wip: newTagsPresent -> areNewTagsPresent

* wip: icon is not  mandatory code incorporated

* wip:minor refactoring

* wip: prevent duplicate version from being created and save tags relation only when

* wip: minor fix

* wip: details api, get all plugin data or non

* wip: code review incorp part -1

* wip: code review incorp part -2

* wip: code review incorp part -3

* wip: remove code duplication

* wip: hardcode isExposed to true

* wip: hardcode StepType= inline

* wip: set default VariableStepIndex= 1

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

* doc: Edit Deployment Chart Schema (#5735)

* Edit Deployment Chart Schema

* Fixes

* PM + CO Feedback Incorporated

* doc: Redirection of old entry in gitbook.yaml (#5738)

* Edit Deployment Chart Schema

* Fixes

* PM + CO Feedback Incorporated

* Redirected Old Entry

* docs: added Documentation for Air-Gapped Installation (#5360)

* added docs for air-gapped-installation

* added all the images in 7.0.0

* modified yq command in the docs

* added an entry in summary.md

* added installation commands

* modified statements

* modified variable name

* added steps to navigation

* added the latest oss chart images

* added a note for docker

* Added Intro + Proofreading + Structuring

* Other fixes

* Lang fix

* added docs for ea-mode only

* modified lang

* Update install-devtron-in-airgapped-environment.md

Changed h3 header to fit the ToC on the RHS

* added changes

* modified changes

---------

Co-authored-by: Badal Kumar Prusty <[email protected]>
Co-authored-by: ashokdevtron <[email protected]>

* feat: Env description handling (#5744)

* env description handling added

* license handling

* misc: Main sync rc - branch update (#5753)

* added config sql script (#5681)

* feat: CVE severity categorisation and scan result listing API enhancements (#5617)

* feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support

* fix: query fix for appName sort or envName sort

* fix: sql script number change

* fix: minor changes

* fix: review fix

* fix: remove dml on cve_store and handle it in code handling this versioning

* fix: review comments

* fix: update script numbers

* fix: minor fix

* feat: casbin deny policy sql scripts (#5677)

* system controller scripts

* script additions

* sql cript update

* sql script number chnage

* feat: Config diff phase 2 oss (#5488)

* story(configDiffView) : open api spec

* story(configDiffView) : open api spec updated

* story(configDiffView) : open api spec updated for error state

* story(configDiffView) : WIP

* story(configDiffView) : WIP "some code changed"

* story(configDiffView) : support for names added

* story(configDiffView) : iota removed

* story(configDiffView) : pg no rows handled

* story(configDiffView) : spelling check

* story(configDiffView) : code review comment resolved

* story(configDiffView) : env id added

* story(configDiffView) : intersection added

* story(configDiffView) : comments removed

* story(configDiffView) : code review comment resolved

* story(configDiffView) : comment removed

* story(configDiffView) : CMCSNames DTO moved

* story(configDiffView) : null case handled

* story(configDiffView) : logger added

* story(configDiffView) : code refactored

* story(configDiffView) : code refactored v2

* story(configDiffView) : spec updated

* story(configDiffView) : code refactored

* story(configDiffView) : config names

* main sync

* overridden and global flag introduced in config diff autocomplete api

* ent sync

* get config data in resthandler

* new api for showing all config data in config/data :- Service func -> GetAllConfigData

* using a single key instead of global and overridden key in config/autocomplete api

* ConfigState made string instead of int

* not sending inheriting in case base config

* code review comment incorporation

* ent sync

* code review comment incorp -1

* code review comment incorp -2

* code review comment incorp -3

* small fix in plugin

* migration number changes (#5692)

* main sync

* minor fix

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* scipt number change

---------

Co-authored-by: adi6859 <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>

* fix: Helm apps entries in Ea mode (#5652)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* executed make after merging with develop branch

* feat: refactoring deployment app name usage (#5702)

* removing hard coded deployment app name

* removing %s-%s usage

* wip: query change for enterprise

* wip

* wip

* wip

* adding release mode in deployment config

* wip: release changes

* left join on pco and artifact

* handling empty release mode - backward compatibility

* fixing panic

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* migration updated

* main merge and migration script updated

* wip

* review changes

* fix sql no

---------

Co-authored-by: Prakash <[email protected]>

* migration syn with ent (#5719)

* fix: group image vulnerabilities by base/os image (#5680)

* feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support

* fix: query fix for appName sort or envName sort

* fix: sql script number change

* fix: minor changes

* fix: review fix

* fix: remove dml on cve_store and handle it in code handling this versioning

* fix: review comments

* feat: storing target,class and type values in imageScanExecutionResults

* feat: add sql script

* feat: add sql script

* fix: add new columns

* fix: update script numbers

* fix: correct down script

* fix: minor fix

* chore: script number update

* fix: remove sql script (#5727)

* Revert "fix: Helm apps entries in Ea mode (#5652)" (#5733)

This reverts commit f1aa1fca0624af32de5e620ceba4548488a07127.

* chore: custom argo-workflow dependency (#5731)

* bumped github.com/argoproj/argo-workflows/v3 v3.5.10 => github.com/devtron-labs/argo-workflows/v3 v3.5.10

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

* reverted main branch changes

* reverted main branch changes

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>

* chore: fix go.sum file (#5734)

* misc: Main sync develop (#5737)

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>

* fix: Validate config cm cs (#5750)

* validateConfigRequest before CMGlobalAddUpdate and CSGlobalAddUpdate

* checkIfConfigDataAlreadyExist

---------

Co-authored-by: ayu-devtron <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>
Co-authored-by: Gireesh Naidu <[email protected]>
Co-authored-by: Shivam Nagar <[email protected]>
Co-authored-by: Prakash <[email protected]>
Co-authored-by: adi6859 <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: iamayushm <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>
Co-authored-by: Asutosh Das <[email protected]>
Co-authored-by: Vikram <[email protected]>
Co-authored-by: Prakarsh <[email protected]>

* doc: Update prerequisites of code-scan (#5625)

* Update prerequisites of code-scan

* Hyperlinked the Vulnerability scanning doc

---------

Co-authored-by: ashokdevtron <[email protected]>

* fix: ci patch rbac for branch update (#5759)

* feat: Added basic auth support for servicemonitor (#5761)

* Added support for basic auth in servicemonitor

* Added support for namespace selector and custom matchLabels

* Fixed indentations

* fix: Bitnami chart repo tls issue (#5740)

* bitnami_chart_fix

* Rename 278_bitnami_chart_fix.down.sql to 282_bitnami_chart_fix.down.sql

* Rename 278_bitnami_chart_fix.up.sql to 282_bitnami_chart_fix.up.sql

---------

Co-authored-by: Pawan Mehta <[email protected]>

* doc: Cosign plugin doc (#5665)

* doc for cosign plugin

* edits in task name

* updates in intro and other fixes.

* Attached link to Cosign GitHub repo

* Hyperlink fixes

---------

Co-authored-by: ashokdevtron <[email protected]>

* fix: check rbac on env if envName is present (#5765)

* admin check fix in config draft

* minor fix

* doc: CraneCopy plugin doc (#5658)

* doc for

* edits in task name

* spelling correction

* Updated password

---------

Co-authored-by: ashokdevtron <[email protected]>

* doc: Devtron CD Trigger Plugin doc  (#5747)

* devtron-cd-trigger plugin doc

* minor update

* Proofreading done

* Update devtron-cd-trigger.md

* Removed unwanted phrase

* Changed wording

* Changed plurality

* Updated devtron token

---------

Co-authored-by: ashokdevtron <[email protected]>

* doc: DockerSlim plugin doc (#5660)

* doc for DockerSlim plugin

* Updated Docker-Slim to DockerSlim

* Minor fixes

* url update

* Fixes in url

---------

Co-authored-by: ashokdevtron <[email protected]>

* doc: Devtron Job Trigger Plugin doc (#5742)

* devtron-job-trigger plugin doc

* summary updated

* Updated input variable description

* token value updated

---------

Co-authored-by: ashokdevtron <[email protected]>

* fix: scan tool active check removed (#5771)

* scan tool active check removed

* query fix

* feat: Docker pull env driven (#5767)

* useDockerApiToGetDigest menv driven flag to control pulling image either using docker pull or docker API

* UseAppDockerConfigForPrivateRegistries in workflow request

* revert

* revert

* fix: panic handlings and argocd app delete stuck in partial stage (#5770)

* fix: panic handlings

* fix: false positive matrics on gitOps failures

* fix: for GetConfigForHelmApps err: pg no row

* feat: plugin creation support (#5630)

* wip: new plugin creation api and min plugin api with only shared plugin list

* wip: create new plugin version code

* wip:plugin type SHARED by default

* wip:find plugin either by identifier or by id while creating a new version of existing plugin

* wip: create new plugin tag logic improved

* wip: optimize GetAllFilteredPluginParentMetadata query

* wip: create plugin tag new flow

* wip: minor fix

* wip: minor fix

* wip: minor fix

* wip: newTagsPresent -> areNewTagsPresent

* wip: icon is not  mandatory code incorporated

* wip:minor refactoring

* wip: prevent duplicate version from being created and save tags relation only when

* wip: minor fix

* wip: details api, get all plugin data or non

* wip: code review incorp part -1

* wip: code review incorp part -2

* wip: code review incorp part -3

* wip: remove code duplication

* wip: hardcode isExposed to true

* wip: hardcode StepType= inline

* wip: set default VariableStepIndex= 1

* Revert "feat: plugin creation support (#5630)" (#5778)

This reverts commit 4296366ae288f3a67f87e547d2b946acbcd2dd65.

---------

Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>
Co-authored-by: ashokdevtron <[email protected]>
Co-authored-by: Badal Kumar <[email protected]>
Co-authored-by: Badal Kumar Prusty <[email protected]>
Co-authored-by: kripanshdevtron <[email protected]>
Co-authored-by: kartik-579 <[email protected]>
Co-authored-by: ayu-devtron <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>
Co-authored-by: Gireesh Naidu <[email protected]>
Co-authored-by: Shivam Nagar <[email protected]>
Co-authored-by: adi6859 <[email protected]>
Co-authored-by: iamayushm <[email protected]>
Co-authored-by: Asutosh Das <[email protected]>
Co-authored-by: Vikram <[email protected]>
Co-authored-by: Prakarsh <[email protected]>
Co-authored-by: Bhushan Nemade <[email protected]>
Co-authored-by: Pawan Mehta <[email protected]>
Co-authored-by: akshatsinha007 <[email protected]>

* fix: Sql injection fix develop (#5785)

* sql injection fixes

* query param init fix

* feat: add support for tag name for external CI (#5689)

* remove validation that url exists in external artifact

* handle docker tag name regex validation

* sync with enterprise

* sync with enterprise

* added validation for external ci tag name

* fix log

* mark deployment aborted if validation fails

* digest validation added

* fix typo

* common lib update

---------

Co-authored-by: prakhar katiyar <[email protected]>

* argo-assets moved out (#5788)

* query param split (#5801) (#5803)

* feat: acr polling plugin support  (#5724)

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* chore: polling plugin refactored

* chore: refactored method name

* update polling plugin response struct

* updated migration number

* updated polling plugin image

* updated polling plugin migration script

* fix: same digest for different image issue

* fix: plugin migration handling

* updated polling plugin migration script

* updated migration number

* fix: empty artifact issue

* chore: polling plugin migration prod-image updated

* updated common-lib version

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>

* fix: build failed due to argo assets (#5805)

* handled the release not found case for app detail of external app (#5791)

Co-authored-by: Rajeev Ranjan<[email protected]>

* chore: Main develop sync bd5118 (#5817)

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

* doc: Edit Deployment Chart Schema (#5735)

* Edit Deployment Chart Schema

* Fixes

* PM + CO Feedback Incorporated

* doc: Redirection of old entry in gitbook.yaml (#5738)

* Edit Deployment Chart Schema

* Fixes

* PM + CO Feedback Incorporated

* Redirected Old Entry

* docs: added Documentation for Air-Gapped Installation (#5360)

* added docs for air-gapped-installation

* added all the images in 7.0.0

* modified yq command in the docs

* added an entry in summary.md

* added installation commands

* modified statements

* modified variable name

* added steps to navigation

* added the latest oss chart images

* added a note for docker

* Added Intro + Proofreading + Structuring

* Other fixes

* Lang fix

* added docs for ea-mode only

* modified lang

* Update install-devtron-in-airgapped-environment.md

Changed h3 header to fit the ToC on the RHS

* added changes

* modified changes

---------

Co-authored-by: Badal Kumar Prusty <[email protected]>
Co-authored-by: ashokdevtron <[email protected]>

* feat: Env description handling (#5744)

* env description handling added

* license handling

* misc: Main sync rc - branch update (#5753)

* added config sql script (#5681)

* feat: CVE severity categorisation and scan result listing API enhancements (#5617)

* feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support

* fix: query fix for appName sort or envName sort

* fix: sql script number change

* fix: minor changes

* fix: review fix

* fix: remove dml on cve_store and handle it in code handling this versioning

* fix: review comments

* fix: update script numbers

* fix: minor fix

* feat: casbin deny policy sql scripts (#5677)

* system controller scripts

* script additions

* sql cript update

* sql script number chnage

* feat: Config diff phase 2 oss (#5488)

* story(configDiffView) : open api spec

* story(configDiffView) : open api spec updated

* story(configDiffView) : open api spec updated for error state

* story(configDiffView) : WIP

* story(configDiffView) : WIP "some code changed"

* story(configDiffView) : support for names added

* story(configDiffView) : iota removed

* story(configDiffView) : pg no rows handled

* story(configDiffView) : spelling check

* story(configDiffView) : code review comment resolved

* story(configDiffView) : env id added

* story(configDiffView) : intersection added

* story(configDiffView) : comments removed

* story(configDiffView) : code review comment resolved

* story(configDiffView) : comment removed

* story(configDiffView) : CMCSNames DTO moved

* story(configDiffView) : null case handled

* story(configDiffView) : logger added

* story(configDiffView) : code refactored

* story(configDiffView) : code refactored v2

* story(configDiffView) : spec updated

* story(configDiffView) : code refactored

* story(configDiffView) : config names

* main sync

* overridden and global flag introduced in config diff autocomplete api

* ent sync

* get config data in resthandler

* new api for showing all config data in config/data :- Service func -> GetAllConfigData

* using a single key instead of global and overridden key in config/autocomplete api

* ConfigState made string instead of int

* not sending inheriting in case base config

* code review comment incorporation

* ent sync

* code review comment incorp -1

* code review comment incorp -2

* code review comment incorp -3

* small fix in plugin

* migration number changes (#5692)

* main sync

* minor fix

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* scipt number change

---------

Co-authored-by: adi6859 <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>

* fix: Helm apps entries in Ea mode (#5652)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* executed make after merging with develop branch

* feat: refactoring deployment app name usage (#5702)

* removing hard coded deployment app name

* removing %s-%s usage

* wip: query change for enterprise

* wip

* wip

* wip

* adding release mode in deployment config

* wip: release changes

* left join on pco and artifact

* handling empty release mode - backward compatibility

* fixing panic

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* migration updated

* main merge and migration script updated

* wip

* review changes

* fix sql no

---------

Co-authored-by: Prakash <[email protected]>

* migration syn with ent (#5719)

* fix: group image vulnerabilities by base/os image (#5680)

* feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support

* fix: query fix for appName sort or envName sort

* fix: sql script number change

* fix: minor changes

* fix: review fix

* fix: remove dml on cve_store and handle it in code handling this versioning

* fix: review comments

* feat: storing target,class and type values in imageScanExecutionResults

* feat: add sql script

* feat: add sql script

* fix: add new columns

* fix: update script numbers

* fix: correct down script

* fix: minor fix

* chore: script number update

* fix: remove sql script (#5727)

* Revert "fix: Helm apps entries in Ea mode (#5652)" (#5733)

This reverts commit f1aa1fca0624af32de5e620ceba4548488a07127.

* chore: custom argo-workflow dependency (#5731)

* bumped github.com/argoproj/argo-workflows/v3 v3.5.10 => github.com/devtron-labs/argo-workflows/v3 v3.5.10

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

* reverted main branch changes

* reverted main branch changes

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>

* chore: fix go.sum file (#5734)

* misc: Main sync develop (#5737)

* migration number changes (#5692)

* refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)

* fix: Decode secret fix on add update oss (#5695)

* ValidateEncodedDataByDecoding in case add or update secret

* wire fix from main

* minor refactor

* comment

* saving pco concurrency case handled (#5688)

* fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701)

* script for pipelineStageStepVariable, making input value and default_value text from varchar255

* erro log fix

* fix: ea fixes for helm app (#5708)

* added the ea apps entry app table

* resolved the ea mode multiple rows error during configuration of app

* modified the ea dockerfile in ca-certificates cmd

* uncommented the code and left the ea helm app making way untouched

* remodified the dockerfile as previous state

* modified the docker file ea mode

* dockerfile exit code 100 due to ap install alternative in ea mode dockerfile

* execute make after main merge

* modified changes in dockerfile ea mode

* resolved comments after first level review

* Revert "fix: ea fixes for helm app (#5708)" (#5713)

This reverts commit 3e31f49f95d373f92b13afbe1806606ac4a39d85.

* fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712)

* SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation

* minor refactor

* minor refactor

* migration syn with ent (#5718)

---------

Co-authored-by: Prakash <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>

* fix: Validate config cm cs (#5750)

* validateConfigRequest before CMGlobalAddUpdate and CSGlobalAddUpdate

* checkIfConfigDataAlreadyExist

---------

Co-authored-by: ayu-devtron <[email protected]>
Co-authored-by: Vikram Singh <[email protected]>
Co-authored-by: Gireesh Naidu <[email protected]>
Co-authored-by: Shivam Nagar <[email protected]>
Co-authored-by: Prakash <[email protected]>
Co-authored-by: adi6859 <[email protected]>
Co-authored-by: Rajeev Ranjan <[email protected]>
Co-authored-by: iamayushm <[email protected]>
Co-authored-by: prakhar katiyar <[email protected]>
Co-authored-by: Asutosh Das <[email protected]>
Co-authored-by: Vikram <[email protected]>
Co-authored-by: Prakarsh <[email protected]>

* doc: Update prerequisites of code-scan (#5625)

* Update prerequisites of code-scan

* Hyperlinked the Vulnerability scanning doc

---------

Co-authored-by: ashokdevtron <[email protected]>

* fix: ci patch rbac for branch update (#5759)

* feat: Added basic auth support for servicemonitor (#5761)

* Added support for basic auth in servicemonitor

* Added support for namespace selector and custom matchLabels

* Fixed indentations

* fix: Bitnami chart repo tls issue (#5740)

* bitnami_chart_fix

* Rename 278_bitnami_chart_fix.down.sql to 282_bitnami_chart_fix.down.sql

* Rename 278_bitnami_chart_fix.up.sql to 282_bitnami_chart_fix.up.sql

---------

Co-authored-by: Pawan Mehta <[email protected]>

* doc: Cosign plugin doc (#5665)

* doc for cosign plugin

* edits in task name

* updates in int…
  • Loading branch information
1 parent e332df2 commit 8e78d6e
Show file tree
Hide file tree
Showing 75 changed files with 1,986 additions and 4,213 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ RUN apt clean autoclean
RUN apt autoremove -y && rm -rf /var/lib/apt/lists/*
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/devtron .
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/argocd-assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/sql scripts/sql
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/casbin scripts/casbin
Expand Down
3 changes: 2 additions & 1 deletion DockerfileEA
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ RUN apt autoremove -y && rm -rf /var/lib/apt/lists/*
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/cmd/external-app/devtron-ea .

COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/argocd-assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/sql scripts/sql
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/casbin scripts/casbin
Expand Down
9 changes: 6 additions & 3 deletions api/argoApplication/ArgoApplicationRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"errors"
"github.com/devtron-labs/devtron/api/restHandler/common"
"github.com/devtron-labs/devtron/pkg/argoApplication"
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
"go.uber.org/zap"
"net/http"
Expand All @@ -34,14 +35,16 @@ type ArgoApplicationRestHandler interface {

type ArgoApplicationRestHandlerImpl struct {
argoApplicationService argoApplication.ArgoApplicationService
readService read.ArgoApplicationReadService
logger *zap.SugaredLogger
enforcer casbin.Enforcer
}

func NewArgoApplicationRestHandlerImpl(argoApplicationService argoApplication.ArgoApplicationService,
logger *zap.SugaredLogger, enforcer casbin.Enforcer) *ArgoApplicationRestHandlerImpl {
readService read.ArgoApplicationReadService, logger *zap.SugaredLogger, enforcer casbin.Enforcer) *ArgoApplicationRestHandlerImpl {
return &ArgoApplicationRestHandlerImpl{
argoApplicationService: argoApplicationService,
readService: readService,
logger: logger,
enforcer: enforcer,
}
Expand Down Expand Up @@ -101,9 +104,9 @@ func (handler *ArgoApplicationRestHandlerImpl) GetApplicationDetail(w http.Respo
return
}
}
resp, err := handler.argoApplicationService.GetAppDetail(resourceName, namespace, clusterId)
resp, err := handler.readService.GetAppDetail(resourceName, namespace, clusterId)
if err != nil {
handler.logger.Errorw("error in listing all argo applications", "err", err, "resourceName", resourceName, "clusterId", clusterId)
handler.logger.Errorw("error in getting argo application app detail", "err", err, "resourceName", resourceName, "clusterId", clusterId)
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
return
}
Expand Down
4 changes: 4 additions & 0 deletions api/argoApplication/wire_argoApplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ package argoApplication

import (
"github.com/devtron-labs/devtron/pkg/argoApplication"
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
"github.com/google/wire"
)

var ArgoApplicationWireSet = wire.NewSet(
read.NewArgoApplicationReadServiceImpl,
wire.Bind(new(read.ArgoApplicationReadService), new(*read.ArgoApplicationReadServiceImpl)),

argoApplication.NewArgoApplicationServiceImpl,
wire.Bind(new(argoApplication.ArgoApplicationService), new(*argoApplication.ArgoApplicationServiceImpl)),

Expand Down
11 changes: 9 additions & 2 deletions api/helm-app/HelmAppRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ import (
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service"
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/EAMode"
"github.com/devtron-labs/devtron/pkg/argoApplication"
"github.com/devtron-labs/devtron/pkg/argoApplication/helper"
clientErrors "github.com/devtron-labs/devtron/pkg/errors"
"github.com/devtron-labs/devtron/pkg/fluxApplication"
bean2 "github.com/devtron-labs/devtron/pkg/k8s/application/bean"
"github.com/devtron-labs/devtron/pkg/pipeline"
"net/http"
"strconv"
"strings"
Expand Down Expand Up @@ -144,6 +146,11 @@ func (handler *HelmAppRestHandlerImpl) GetApplicationDetail(w http.ResponseWrite
//RBAC enforcer Ends
appdetail, err := handler.helmAppService.GetApplicationDetail(context.Background(), appIdentifier)
if err != nil {

if pipeline.CheckAppReleaseNotExist(err) {
common.WriteJsonResp(w, err, nil, http.StatusNotFound)
return
}
apiError := clientErrors.ConvertToApiError(err)
if apiError != nil {
err = apiError
Expand Down Expand Up @@ -226,7 +233,7 @@ func (handler *HelmAppRestHandlerImpl) handleFluxApplicationHibernate(r *http.Re
return handler.fluxApplication.HibernateFluxApplication(r.Context(), appIdentifier, hibernateRequest)
}
func (handler *HelmAppRestHandlerImpl) handleArgoApplicationHibernate(r *http.Request, token string, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error) {
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(*hibernateRequest.AppId)
appIdentifier, err := helper.DecodeExternalArgoAppId(*hibernateRequest.AppId)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -310,7 +317,7 @@ func (handler *HelmAppRestHandlerImpl) handleFluxApplicationUnHibernate(r *http.
return handler.fluxApplication.UnHibernateFluxApplication(r.Context(), appIdentifier, hibernateRequest)
}
func (handler *HelmAppRestHandlerImpl) handleArgoApplicationUnHibernate(r *http.Request, token string, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error) {
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(*hibernateRequest.AppId)
appIdentifier, err := helper.DecodeExternalArgoAppId(*hibernateRequest.AppId)
if err != nil {
return nil, err
}
Expand Down
73 changes: 37 additions & 36 deletions api/k8s/application/k8sApplicationRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import (
client "github.com/devtron-labs/devtron/api/helm-app/service"
"github.com/devtron-labs/devtron/api/restHandler/common"
util2 "github.com/devtron-labs/devtron/internal/util"
"github.com/devtron-labs/devtron/pkg/argoApplication"
"github.com/devtron-labs/devtron/pkg/argoApplication/helper"
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
"github.com/devtron-labs/devtron/pkg/auth/user"
"github.com/devtron-labs/devtron/pkg/cluster"
Expand Down Expand Up @@ -81,39 +82,39 @@ type K8sApplicationRestHandler interface {
}

type K8sApplicationRestHandlerImpl struct {
logger *zap.SugaredLogger
k8sApplicationService application2.K8sApplicationService
pump connector.Pump
terminalSessionHandler terminal.TerminalSessionHandler
enforcer casbin.Enforcer
validator *validator.Validate
enforcerUtil rbac.EnforcerUtil
enforcerUtilHelm rbac.EnforcerUtilHelm
helmAppService client.HelmAppService
userService user.UserService
k8sCommonService k8s.K8sCommonService
terminalEnvVariables *util.TerminalEnvVariables
fluxAppService fluxApplication.FluxApplicationService
argoApplication argoApplication.ArgoApplicationService
logger *zap.SugaredLogger
k8sApplicationService application2.K8sApplicationService
pump connector.Pump
terminalSessionHandler terminal.TerminalSessionHandler
enforcer casbin.Enforcer
validator *validator.Validate
enforcerUtil rbac.EnforcerUtil
enforcerUtilHelm rbac.EnforcerUtilHelm
helmAppService client.HelmAppService
userService user.UserService
k8sCommonService k8s.K8sCommonService
terminalEnvVariables *util.TerminalEnvVariables
fluxAppService fluxApplication.FluxApplicationService
argoApplicationReadService read.ArgoApplicationReadService
}

func NewK8sApplicationRestHandlerImpl(logger *zap.SugaredLogger, k8sApplicationService application2.K8sApplicationService, pump connector.Pump, terminalSessionHandler terminal.TerminalSessionHandler, enforcer casbin.Enforcer, enforcerUtilHelm rbac.EnforcerUtilHelm, enforcerUtil rbac.EnforcerUtil, helmAppService client.HelmAppService, userService user.UserService, k8sCommonService k8s.K8sCommonService, validator *validator.Validate, envVariables *util.EnvironmentVariables, fluxAppService fluxApplication.FluxApplicationService, argoApplication argoApplication.ArgoApplicationService,
func NewK8sApplicationRestHandlerImpl(logger *zap.SugaredLogger, k8sApplicationService application2.K8sApplicationService, pump connector.Pump, terminalSessionHandler terminal.TerminalSessionHandler, enforcer casbin.Enforcer, enforcerUtilHelm rbac.EnforcerUtilHelm, enforcerUtil rbac.EnforcerUtil, helmAppService client.HelmAppService, userService user.UserService, k8sCommonService k8s.K8sCommonService, validator *validator.Validate, envVariables *util.EnvironmentVariables, fluxAppService fluxApplication.FluxApplicationService, argoApplicationReadService read.ArgoApplicationReadService,
) *K8sApplicationRestHandlerImpl {
return &K8sApplicationRestHandlerImpl{
logger: logger,
k8sApplicationService: k8sApplicationService,
pump: pump,
terminalSessionHandler: terminalSessionHandler,
enforcer: enforcer,
validator: validator,
enforcerUtilHelm: enforcerUtilHelm,
enforcerUtil: enforcerUtil,
helmAppService: helmAppService,
userService: userService,
k8sCommonService: k8sCommonService,
terminalEnvVariables: envVariables.TerminalEnvVariables,
fluxAppService: fluxAppService,
argoApplication: argoApplication,
logger: logger,
k8sApplicationService: k8sApplicationService,
pump: pump,
terminalSessionHandler: terminalSessionHandler,
enforcer: enforcer,
validator: validator,
enforcerUtilHelm: enforcerUtilHelm,
enforcerUtil: enforcerUtil,
helmAppService: helmAppService,
userService: userService,
k8sCommonService: k8sCommonService,
terminalEnvVariables: envVariables.TerminalEnvVariables,
fluxAppService: fluxAppService,
argoApplicationReadService: argoApplicationReadService,
}
}

Expand Down Expand Up @@ -289,7 +290,7 @@ func (handler *K8sApplicationRestHandlerImpl) GetHostUrlsByBatch(w http.Response
resourceTreeResponse = appDetail.ResourceTreeResponse

} else if appType == bean2.ArgoAppType {
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(appIdString)
appIdentifier, err := helper.DecodeExternalArgoAppId(appIdString)
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
Expand All @@ -301,7 +302,7 @@ func (handler *K8sApplicationRestHandlerImpl) GetHostUrlsByBatch(w http.Response
}
//RBAC enforcer Ends

appDetail, err := handler.argoApplication.GetAppDetail(appIdentifier.AppName, appIdentifier.Namespace, appIdentifier.ClusterId)
appDetail, err := handler.argoApplicationReadService.GetAppDetail(appIdentifier.AppName, appIdentifier.Namespace, appIdentifier.ClusterId)
if err != nil {
apiError := clientErrors.ConvertToApiError(err)
if apiError != nil {
Expand Down Expand Up @@ -721,12 +722,12 @@ func (handler *K8sApplicationRestHandlerImpl) requestValidationAndRBAC(w http.Re
}
//RBAC enforcer ends here
} else if request.AppType == bean2.ArgoAppType && request.ExternalArgoApplicationName != "" {
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(request.AppId)
appIdentifier, err := helper.DecodeExternalArgoAppId(request.AppId)
if err != nil {
handler.logger.Errorw(bean2.AppIdDecodingError, "err", err, "appIdentifier", request.AppIdentifier)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
}
valid, err := handler.k8sApplicationService.ValidateArgoResourceRequest(r.Context(), appIdentifier, request.K8sRequest)
valid, err := handler.argoApplicationReadService.ValidateArgoResourceRequest(r.Context(), appIdentifier, request.K8sRequest)
if err != nil || !valid {
handler.logger.Errorw("error in validating resource request", "err", err)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
Expand Down Expand Up @@ -1145,14 +1146,14 @@ func (handler *K8sApplicationRestHandlerImpl) verifyRbacForAppRequests(token str
envObject := ""
switch request.AppType {
case bean2.ArgoAppType:
argoAppIdentifier, err := argoApplication.DecodeExternalArgoAppId(request.AppId)
argoAppIdentifier, err := helper.DecodeExternalArgoAppId(request.AppId)
if err != nil {
handler.logger.Errorw("error in decoding appId", "err", err, "appId", request.AppId)
return false, err
}
request.ClusterId = argoAppIdentifier.ClusterId
request.ExternalArgoApplicationName = argoAppIdentifier.AppName
valid, err := handler.k8sApplicationService.ValidateArgoResourceRequest(r.Context(), argoAppIdentifier, request.K8sRequest)
valid, err := handler.argoApplicationReadService.ValidateArgoResourceRequest(r.Context(), argoAppIdentifier, request.K8sRequest)
if err != nil || !valid {
handler.logger.Errorw("error in validating resource request", "err", err)
return false, err
Expand Down
67 changes: 67 additions & 0 deletions api/restHandler/GlobalPluginRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (

type GlobalPluginRestHandler interface {
PatchPlugin(w http.ResponseWriter, r *http.Request)
CreatePlugin(w http.ResponseWriter, r *http.Request)

GetAllGlobalVariables(w http.ResponseWriter, r *http.Request)
ListAllPlugins(w http.ResponseWriter, r *http.Request)
Expand All @@ -46,6 +47,7 @@ type GlobalPluginRestHandler interface {
GetPluginDetailByIds(w http.ResponseWriter, r *http.Request)
GetAllUniqueTags(w http.ResponseWriter, r *http.Request)
MigratePluginData(w http.ResponseWriter, r *http.Request)
GetAllPluginMinData(w http.ResponseWriter, r *http.Request)
}

func NewGlobalPluginRestHandler(logger *zap.SugaredLogger, globalPluginService plugin.GlobalPluginService,
Expand Down Expand Up @@ -420,3 +422,68 @@ func (handler *GlobalPluginRestHandlerImpl) MigratePluginData(w http.ResponseWri
}
common.WriteJsonResp(w, nil, nil, http.StatusOK)
}

func (handler *GlobalPluginRestHandlerImpl) CreatePlugin(w http.ResponseWriter, r *http.Request) {
userId, err := handler.userService.GetLoggedInUser(r)
if userId == 0 || err != nil {
common.WriteJsonResp(w, err, "Unauthorized User", http.StatusUnauthorized)
return
}
token := r.Header.Get("token")
appId, err := common.ExtractIntQueryParam(w, r, "appId", 0)
if err != nil {
return
}
ok, err := handler.IsUserAuthorized(token, appId)
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
if !ok {
common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), "Unauthorized User", http.StatusForbidden)
return
}
decoder := json.NewDecoder(r.Body)
var pluginDataDto bean.PluginParentMetadataDto
err = decoder.Decode(&pluginDataDto)
if err != nil {
handler.logger.Errorw("request err, CreatePlugin", "error", err, "payload", pluginDataDto)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
handler.logger.Infow("request payload received for creating plugins", pluginDataDto, "userId", userId)

pluginVersionId, err := handler.globalPluginService.CreatePluginOrVersions(&pluginDataDto, userId)
if err != nil {
handler.logger.Errorw("service error, error in creating plugin", "pluginCreateRequestDto", pluginDataDto, "err", err)
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
return
}

common.WriteJsonResp(w, nil, bean.NewPluginMinDto().WithPluginVersionId(pluginVersionId), http.StatusOK)
}

func (handler *GlobalPluginRestHandlerImpl) GetAllPluginMinData(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("token")
appId, err := common.ExtractIntQueryParam(w, r, "appId", 0)
if err != nil {
return
}
ok, err := handler.IsUserAuthorized(token, appId)
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
if !ok {
common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), "Unauthorized User", http.StatusForbidden)
return
}

pluginDetail, err := handler.globalPluginService.GetAllPluginMinData()
if err != nil {
handler.logger.Errorw("error in getting all unique tags", "err", err)
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
return
}
common.WriteJsonResp(w, nil, pluginDetail, http.StatusOK)
}
5 changes: 4 additions & 1 deletion api/router/GlobalPluginRouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ type GlobalPluginRouterImpl struct {
func (impl *GlobalPluginRouterImpl) initGlobalPluginRouter(globalPluginRouter *mux.Router) {
globalPluginRouter.Path("/migrate").
HandlerFunc(impl.globalPluginRestHandler.MigratePluginData).Methods("PUT")

globalPluginRouter.Path("/create").
HandlerFunc(impl.globalPluginRestHandler.CreatePlugin).Methods("POST")
// versioning impact handling to be done for below apis,
globalPluginRouter.Path("").
HandlerFunc(impl.globalPluginRestHandler.PatchPlugin).Methods("POST")
Expand All @@ -68,5 +69,7 @@ func (impl *GlobalPluginRouterImpl) initGlobalPluginRouter(globalPluginRouter *m

globalPluginRouter.Path("/list/tags").
HandlerFunc(impl.globalPluginRestHandler.GetAllUniqueTags).Methods("GET")
globalPluginRouter.Path("/list/v2/min").
HandlerFunc(impl.globalPluginRestHandler.GetAllPluginMinData).Methods("GET")

}
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8e78d6e

Please sign in to comment.