devtron icon indicating copy to clipboard operation
devtron copied to clipboard

chore: chart service crud and configProperties

Open iamayushm opened this issue 5 months ago • 1 comments

Description

Fixes https://github.com/devtron-labs/sprint-tasks/issues/2107

Adding tx in chart service and propertiesService

Checklist:

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

Does this PR introduce a user-facing change?


iamayushm avatar Jun 03 '25 14:06 iamayushm

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
2763127 Triggered Generic High Entropy Secret 3c0f6c8ff161125af2d6b17e3615d4e2de3d26f6 scripts/devtron-reference-helm-charts/cronjob-chart_1-6-0/secrets-test-values.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

gitguardian[bot] avatar Jun 19 '25 08:06 gitguardian[bot]

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Transaction Management Refactor

ChartService.go - Refactored chart service methods to integrate explicit transaction handling and enhance error logging.

ChartsRepository.go - Updated repository methods to accept transaction parameters, ensuring consistent database operations.

DevtronAppGitOpsConfigService.go - Modified configuration retrieval to use nil transaction where applicable for improved flexibility.

ChartReadService.go - Revised deployment config retrieval to optionally pass a transaction, aligning with overall refactoring.

deploymentConfigService.go - Enhanced deployment configuration services by adding tx parameters for better transaction management.

AppListingRestHandler.go - Updated deployment config function calls to pass nil transaction for improved flexibility.

EnvConfigOverrideRepository.go - Refactored method signatures to include tx parameters and use ORM connections for consistent database operations.

repository.go - Modified query logic to adopt transaction-based connection handling in deployment configuration retrieval.

AppListingService.go - Altered service calls to obtain the latest chart by passing nil for the transaction, ensuring uniform behavior.

AppService.go - Revised deployment config calls to include nil in place of direct transaction parameters for standardized handling.

PipelineStatusTimelineService.go - Updated function calls to use a nil tx parameter, aligning error handling across deployment config retrieval.

AppWorkflowService.go - Changed environment override service calls to pass nil transaction for consistent transaction management.

deploymentConfigReadService.go - Updated various deployment config methods to include a tx parameter for more robust and consistent database operations.

ManifestCreationService.go - Added transaction parameter to chart repository calls to facilitate robust chart retrieval and error handling.

DeploymentTemplateService.go - Modified chart update operations to utilize transaction parameters for reliable database updates.

chartEnvConfigOverride.go - Enhanced chart environment override methods to accept tx parameters, ensuring proper transaction propagation.

deployStageHandlerCode.go - Standardized deployment config retrieval by incorporating nil or explicit tx parameters for consistency.

postStageHandlerCode.go - Injected tx parameter in deployment config retrieval functions to improve consistency in error handling.

preStageHandlerCode.go - Refactored methods to pass transaction parameters when fetching deployment config data.

WorkflowEventProcessorService.go - Updated deployment config retrieval to use a nil transaction, promoting a uniform database access pattern.

AppDeploymentTypeChangeManager.go - Refactored multiple pipeline configuration methods to include transaction parameters for consistent operation.

CdHandler.go - Revised deployment config calls to include nil transaction, improving error handling and consistency.

CiCdPipelineOrchestrator.go - Adjusted deployment config retrieval during pipeline orchestration to properly use transaction parameters.

DeploymentConfigService.go - Updated chart repository calls to incorporate a nil transaction, standardizing method usage.

DeploymentPipelineConfigService.go - Implemented changes across deployment config retrieval and update functions to accept transaction parameters, ensuring consistency.

DevtronAppStrategyService.go - Updated chart repository query to pass a nil transaction for standardized behavior.

PropertiesConfig.go - Enhanced transaction handling with explicit tx initiation, commit, and error recovery in properties configuration.

CdWorkflowCommonService.go - Standardized deployment config retrieval by incorporating explicit nil transaction parameter.

WorkflowDagExecutor.go - Modified deployment config fetch calls to integrate transaction management for improved error handling.

WorkflowStatusService.go - Refactored workflow status methods to use transaction parameters consistently.

Other Improvements - Code Generation Command Update

wire_gen.go - Modified the go generate command to include the '-mod=mod' flag, ensuring proper module resolution during code generation.

bito-code-review[bot] avatar Jul 16 '25 06:07 bito-code-review[bot]

Code Review Agent Run #3529a2

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 9a0d46d..40b7a83
    • internal/sql/repository/deploymentConfig/repository.go
    • pkg/chart/ChartService.go
    • pkg/pipeline/CiCdPipelineOrchestrator.go
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

bito-code-review[bot] avatar Jul 16 '25 10:07 bito-code-review[bot]

Bito Review Skipped - No Changes Detected

Bito didn't review this pull request because we did not detect any changes in the pull request to review.

bito-code-review[bot] avatar Jul 17 '25 07:07 bito-code-review[bot]