Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: copy container images #4209

Merged
merged 165 commits into from
Nov 21, 2023
Merged

feat: copy container images #4209

merged 165 commits into from
Nov 21, 2023

Conversation

iamayushm
Copy link
Contributor

@iamayushm iamayushm commented Nov 6, 2023

Description

Fixes #4259
#3521

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

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 iamayushm changed the title Custom tag cd v2 feat: copy container images Nov 20, 2023

ciPipeline, err := handler.ciPipelineRepository.GetCiPipelineByArtifactId(artifactId)
var externalCiPipeline *pipelineConfig.ExternalCiPipeline
ciArtifact, err := handler.ciArtifactRepository.Get(artifactId)
Copy link
Contributor

Choose a reason for hiding this comment

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

all this below code can be part of service

handler.Logger.Errorw("Error in fetching ci artifact by ci artifact id", "err", err)
return externalCi, ciPipelineId, appId, err
}
if ciArtifact.DataSource == repository.POST_CI {
Copy link
Contributor

Choose a reason for hiding this comment

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

comment down all the probable DataSource in model

@@ -79,7 +79,8 @@ func (r ApplicationRouterImpl) initApplicationRouter(router *mux.Router) {
router.Path("/{applicationName}/managed-resources").
Methods("GET").
HandlerFunc(r.handler.ManagedResources)
router.Path("/{name}/rollback").
router.Path("/{name}" +
Copy link
Contributor

Choose a reason for hiding this comment

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

applicationName ?

}

commonQuery = fmt.Sprintf(commonQuery, listingFilterOptions.PipelineId, listingFilterOptions.StageType, listingFilterOptions.ParentId, listingFilterOptions.ParentStageType, listingFilterOptions.SearchString)
commonQuery := " from ci_artifact LEFT JOIN cd_workflow ON ci_artifact.id = cd_workflow.ci_artifact_id" +
Copy link
Contributor

Choose a reason for hiding this comment

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

describe in comment what results we expects from this query

" AND ((cd_workflow.pipeline_id= %v and cd_workflow_runner.workflow_type = '%v' ) OR (cd_workflow.pipeline_id = %v AND cd_workflow_runner.workflow_type = '%v' AND cd_workflow_runner.status IN ('Healthy','Succeeded') )))" +
" OR (ci_artifact.component_id = %v and ci_artifact.data_source= '%v' ))" +
" AND (ci_artifact.image LIKE '%v' )"
//commonQuery := " FROM cd_workflow_runner " +
Copy link
Contributor

Choose a reason for hiding this comment

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

remove commented code

@@ -250,7 +250,7 @@ type ConfigMapSecretsResponse struct {
}

func parseMaterialInfo(materialInfo json.RawMessage, source string) (json.RawMessage, error) {
if source != "GOCD" && source != "CI-RUNNER" && source != "EXTERNAL" {
if source != "GOCD" && source != "CI-RUNNER" && source != "EXTERNAL" && source != "pre_cd" && source != "post_cd" && source != "post_ci" {
Copy link
Contributor

Choose a reason for hiding this comment

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

use constants

destinationRegistryRepoDetails := strings.Split(destinationInfo, "\n")
for _, detail := range destinationRegistryRepoDetails {
registryRepoSplit := strings.Split(detail, "|")
registryName := strings.Trim(registryRepoSplit[0], " ")
Copy link
Contributor

Choose a reason for hiding this comment

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

use EmptyString Constaint

@@ -0,0 +1,7 @@
ALTER TABLE custom_tag DROP COLUMN enabled;
ALTER TABLE ci_artifact DROP COLUMN credentials_source_type ;
Copy link
Contributor

Choose a reason for hiding this comment

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

Use single seq file for the release

vikramdevtron
vikramdevtron previously approved these changes Nov 20, 2023
vikramdevtron
vikramdevtron previously approved these changes Nov 21, 2023
vikramdevtron
vikramdevtron previously approved these changes Nov 21, 2023
Copy link

sonarcloud bot commented Nov 21, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

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

No Coverage information No Coverage information
4.2% 4.2% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@iamayushm iamayushm merged commit 12a5f50 into main Nov 21, 2023
4 of 5 checks passed
@iamayushm iamayushm deleted the custom-tag-cd-v2 branch November 21, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: copy container images
6 participants