-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: multiple images handling for single workflow for ECR Plugin Pol…
…l Images (#4027) * container registry handling for ci_job ci pipeline * Handling multiple images from Ci Complete event * parent ci workflow id * getting workflows without parent_ci_workflow_id * Setting pod status as successful * getting all workflows * adding new api for getting all artifacts * parent ci workflow fetching null * remving parent_ci_workflow_id from workflow_response * Excluding parent workflow ci artifact * query change * query * self review * self review * self review comments * review comments * IT case for fetching ci artifact for ci job type * handling nil pointer for docker registry id * reverting pipeline builder for now * reverting pipeline builder for now * pushing changes for docker config update * checking len before querying * review comments * script number change * review comments logging errors --------- Co-authored-by: ayushmaheshwari <ayush@devtron.ai>
- Loading branch information
1 parent
fd8d491
commit eac9dc6
Showing
13 changed files
with
218 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package pipeline | ||
|
||
import ( | ||
"github.com/devtron-labs/devtron/internal/sql/repository" | ||
"github.com/devtron-labs/devtron/internal/util" | ||
"github.com/devtron-labs/devtron/pkg/sql" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
"time" | ||
) | ||
|
||
func TestCiHandlerImpl_FetchArtifactsForCiJob(t *testing.T) { | ||
t.SkipNow() | ||
ciHandler := initCiHandler() | ||
|
||
t.Run("Fetch Ci Artifacts For Ci Job type", func(tt *testing.T) { | ||
buildId := 304 // Mocked because child workflows are only created dynamic based on number of images which are available after polling | ||
time.Sleep(5 * time.Second) | ||
_, err := ciHandler.FetchArtifactsForCiJob(buildId) | ||
assert.Nil(t, err) | ||
|
||
}) | ||
} | ||
|
||
func initCiHandler() *CiHandlerImpl { | ||
sugaredLogger, _ := util.InitLogger() | ||
config, _ := sql.GetConfig() | ||
db, _ := sql.NewDbConnection(config, sugaredLogger) | ||
ciArtifactRepositoryImpl := repository.NewCiArtifactRepositoryImpl(db, sugaredLogger) | ||
ciHandlerImpl := NewCiHandlerImpl(sugaredLogger, nil, nil, nil, nil, nil, nil, ciArtifactRepositoryImpl, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) | ||
return ciHandlerImpl | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE ci_workflow DROP COLUMN parent_ci_workflow_id ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE ci_workflow ADD parent_ci_workflow_id integer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters