profile
viewpoint
Mrinal Das mik-dass Red Hat Bengaluru

mik-dass/MyDiary 5

An Android Diary app created using shared preferences,viewpager and other android classes for my university project.Happy sharing and Enjoy...:smile:.

concaf/odo 0

OpenShift Command line for Developers Goal

fabric8-hypothesis/supervisor 0

HDD supervisor will perform configured experiments on data ingested by hdd scouts and enable users verify(or disprove) their hypothesis.

kadel/odo 0

OpenShift Command line for Developers

mik-dass/almighty-jobs 0

Jenkins job description files

mik-dass/bootstrap-supervisored-s2i 0

Quickstart for creating a pseudo VPS for developing on OpenShift.

mik-dass/BottomBar 0

A custom view component that mimics the new Material Design Bottom Navigation pattern.

mik-dass/data-api 0

Micro-service for retirieval of Hypothesis engine computed data

mik-dass/data-api-image 0

Instantiation of data-api along with its respective build and deploy scripts reside here

PR opened openshift/odo

Fixes unit tests

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Fixes uni tests got parser v2

+389 -457

0 comment

12 changed files

pr created time in 3 days

create barnchmik-dass/odo

branch : unit_fix_v2

created branch time in 3 days

Pull request review commentopenshift/odo

Extend download source to support revisions

 func TestIsValidProjectDir(t *testing.T) { 	} } -/* func TestGetGitHubZipURL(t *testing.T) {+	commitid := "39b5ec7833a65278012eab13a895471bba2cd03d"+	tag := "1.0.0" 	tests := []struct {-		name          string-		zipURL        string-		expectedError string+		name           string+		project        common.DevfileProject+		expectedErrors []string 	}{ 		{-			name:          "Case 1: Invalid http request",-			zipURL:        "http://github.com/che-samples/web-nodejs-sample/archive/master",-			expectedError: "Invalid GitHub URL. Please use https://",-		},-		{-			name:          "Case 2: Invalid owner",-			zipURL:        "https://github.com//web-nodejs-sample/archive/master",-			expectedError: "Invalid GitHub URL: owner cannot be empty. Expecting 'https://github.com/<owner>/<repo>'",+			name: "Case 1: Invalid http request",+			project: common.DevfileProject{+				Source: common.DevfileProjectSource{+					Location: "http://github.com/che-samples/web-nodejs-sample/archive/master",+				},+			},+			expectedErrors: []string{"Invalid GitHub URL. Please use https://"}, 		}, 		{-			name:          "Case 3: Invalid repo",-			zipURL:        "https://github.com/che-samples//archive/master",-			expectedError: "Invalid GitHub URL: repo cannot be empty. Expecting 'https://github.com/<owner>/<repo>'",+			name: "Case 2: Invalid owner",+			project: common.DevfileProject{+				Source: common.DevfileProjectSource{+					Location: "https://github.com//web-nodejs-sample/archive/master",+				},+			},+			expectedErrors: []string{"Invalid GitHub URL: owner cannot be empty. Expecting 'https://github.com/<owner>/<repo>'"}, 		}, 		{-			name:          "Case 4: Non-existent URL",-			zipURL:        "https://github.com/this/does/not/exist",-			expectedError: "Error getting zip url. Response: 404 Not Found.",+			name: "Case 3: Invalid repo",+			project: common.DevfileProject{+				Source: common.DevfileProjectSource{+					Location: "https://github.com/che-samples//archive/master",+				},+			},+			expectedErrors: []string{"Invalid GitHub URL: repo cannot be empty. Expecting 'https://github.com/<owner>/<repo>'"}, 		}, 		{-			name:          "Case 5: Valid SSH Github URL",-			zipURL:        "git@github.com:che-samples/web-nodejs-sample.git",-			expectedError: "",+			name: "Case 4: Invalid HTTPS Github URL with tag and commit",

Agreed. I think we need to find a way to mock the library. Maybe this discussion might help https://github.com/google/go-github/issues/113

EnriqueL8

comment created time in 4 days

Pull request review commentopenshift/odo

Update testing utils

 import ( 	"github.com/openshift/odo/pkg/testingutil" ) +var buildGroup = common.BuildCommandGroupType+var runGroup = common.RunCommandGroupType+var initGroup = common.InitCommandGroupType+ func TestGetCommand(t *testing.T) {  	commands := [...]string{"ls -la", "pwd"} 	components := [...]string{"alias1", "alias2"} 	invalidComponent := "garbagealias" 	workDir := [...]string{"/", "/root"}-	validCommandType := common.DevfileCommandTypeExec-	invalidCommandType := common.DevfileCommandType("garbage")+ 	emptyString := ""  	tests := []struct {-		name              string-		requestedCommands []string-		commandActions    []common.DevfileCommandAction-		isCommandRequired []bool-		wantErr           bool+		name          string+		requestedType []common.DevfileCommandGroupType+		execCommands  []common.Exec+		groupType     []common.DevfileCommandGroupType+		wantErr       bool 	}{ 		{-			name:              "Case 1: Valid devfile",-			requestedCommands: []string{"devbuild", "devrun"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 2: Valid devfile with devinit and devbuild",-			requestedCommands: []string{"devinit", "devbuild", "devrun"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 3: Valid devfile with devinit and devrun",-			requestedCommands: []string{"devinit", "devrun"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 4: Wrong command requested",-			requestedCommands: []string{"garbage1"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{true},-			wantErr:           true,-		},-		{-			name:              "Case 5: Invalid devfile with wrong devinit command type",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &invalidCommandType,-				},+			name: "Case 1: Valid devfile",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", buildGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{buildGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 6: Invalid devfile with empty devinit component",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &emptyString,-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},+			name: "Case 2: Valid devfile with devinit and devbuild",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", buildGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup, buildGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 7: Invalid devfile with empty devinit command",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &emptyString,-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},+			name: "Case 3: Valid devfile with devinit and devrun",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", initGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 8: Invalid devfile with wrong devbuild command type",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 4: Invalid devfile with empty component",+			execCommands: []versionsCommon.Exec{ 				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &invalidCommandType,+					CommandLine: commands[0],+					Component:   emptyString,+					WorkingDir:  workDir[0],+					Group:       &versionsCommon.Group{Kind: initGroup}, 				}, 			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup},+			wantErr:       true, 		}, 		{-			name:              "Case 9: Invalid devfile with empty devbuild component",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 5: Invalid devfile with empty devinit command",+			execCommands: []versionsCommon.Exec{ 				{-					Command:   &commands[0],-					Component: &emptyString,-					Workdir:   &workDir[0],-					Type:      &validCommandType,+					CommandLine: emptyString,+					Component:   components[0],+					WorkingDir:  workDir[0],+					Group:       &versionsCommon.Group{Kind: initGroup}, 				}, 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup},+			wantErr:       true, 		}, 		{-			name:              "Case 10: Invalid devfile with empty devbuild command",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 6: Valid devfile with empty workdir",+			execCommands: []common.Exec{ 				{-					Command:   &emptyString,-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,+					CommandLine: commands[0],+					Component:   components[0],+					Group:       &versionsCommon.Group{Kind: runGroup}, 				}, 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 11: Valid devfile with empty workdir",-			requestedCommands: []string{"devrun"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 7: Invalid command referencing an absent component",+			execCommands: []common.Exec{ 				{-					Command:   &commands[0],-					Component: &components[0],-					Type:      &validCommandType,+					CommandLine: commands[0],+					Component:   invalidComponent,+					Group:       &versionsCommon.Group{Kind: runGroup}, 				}, 			},-			isCommandRequired: []bool{true},-			wantErr:           false,-		},-		{-			name:              "Case 12: Invalid command referencing an absent component",-			requestedCommands: []string{"devrun"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &invalidComponent,-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{runGroup},+			wantErr:       true, 		}, 	} 	for _, tt := range tests { 		t.Run(tt.name, func(t *testing.T) {+			components := []common.DevfileComponent{testingutil.GetFakeComponent(tt.execCommands[0].Component)}+			if tt.execCommands[0].Component == invalidComponent {+				components = []common.DevfileComponent{testingutil.GetFakeComponent("randomComponent")}+			} 			devObj := devfileParser.DevfileObj{ 				Data: testingutil.TestDevfileData{-					CommandActions: tt.commandActions,-					ComponentType:  common.DevfileComponentTypeDockerimage,+					ExecCommands: tt.execCommands,+					Components:   components, 				}, 			} -			for i, commandName := range tt.requestedCommands {-				command, err := getCommand(devObj.Data, commandName, tt.isCommandRequired[i])+			for _, gtype := range tt.requestedType {+				_, err := getCommand(devObj.Data, "", gtype)

OK

adisky

comment created time in 4 days

Pull request review commentopenshift/odo

Update testing utils

 import ( 	"github.com/openshift/odo/pkg/testingutil" ) +var buildGroup = common.BuildCommandGroupType+var runGroup = common.RunCommandGroupType+var initGroup = common.InitCommandGroupType+ func TestGetCommand(t *testing.T) {  	commands := [...]string{"ls -la", "pwd"} 	components := [...]string{"alias1", "alias2"} 	invalidComponent := "garbagealias" 	workDir := [...]string{"/", "/root"}-	validCommandType := common.DevfileCommandTypeExec-	invalidCommandType := common.DevfileCommandType("garbage")+ 	emptyString := ""  	tests := []struct {-		name              string-		requestedCommands []string-		commandActions    []common.DevfileCommandAction-		isCommandRequired []bool-		wantErr           bool+		name          string+		requestedType []common.DevfileCommandGroupType+		execCommands  []common.Exec+		groupType     []common.DevfileCommandGroupType+		wantErr       bool 	}{ 		{-			name:              "Case 1: Valid devfile",-			requestedCommands: []string{"devbuild", "devrun"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 2: Valid devfile with devinit and devbuild",-			requestedCommands: []string{"devinit", "devbuild", "devrun"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 3: Valid devfile with devinit and devrun",-			requestedCommands: []string{"devinit", "devrun"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 4: Wrong command requested",-			requestedCommands: []string{"garbage1"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{true},-			wantErr:           true,-		},-		{-			name:              "Case 5: Invalid devfile with wrong devinit command type",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &invalidCommandType,-				},+			name: "Case 1: Valid devfile",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", buildGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{buildGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 6: Invalid devfile with empty devinit component",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &emptyString,-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},+			name: "Case 2: Valid devfile with devinit and devbuild",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", buildGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup, buildGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 7: Invalid devfile with empty devinit command",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &emptyString,-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},+			name: "Case 3: Valid devfile with devinit and devrun",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", initGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 8: Invalid devfile with wrong devbuild command type",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 4: Invalid devfile with empty component",+			execCommands: []versionsCommon.Exec{ 				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &invalidCommandType,+					CommandLine: commands[0],+					Component:   emptyString,+					WorkingDir:  workDir[0],+					Group:       &versionsCommon.Group{Kind: initGroup}, 				}, 			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup},+			wantErr:       true, 		}, 		{-			name:              "Case 9: Invalid devfile with empty devbuild component",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 5: Invalid devfile with empty devinit command",+			execCommands: []versionsCommon.Exec{ 				{-					Command:   &commands[0],-					Component: &emptyString,-					Workdir:   &workDir[0],-					Type:      &validCommandType,+					CommandLine: emptyString,+					Component:   components[0],+					WorkingDir:  workDir[0],+					Group:       &versionsCommon.Group{Kind: initGroup}, 				}, 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup},+			wantErr:       true, 		}, 		{-			name:              "Case 10: Invalid devfile with empty devbuild command",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 6: Valid devfile with empty workdir",+			execCommands: []common.Exec{ 				{-					Command:   &emptyString,-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,+					CommandLine: commands[0],+					Component:   components[0],+					Group:       &versionsCommon.Group{Kind: runGroup}, 				}, 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 11: Valid devfile with empty workdir",-			requestedCommands: []string{"devrun"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 7: Invalid command referencing an absent component",+			execCommands: []common.Exec{ 				{-					Command:   &commands[0],-					Component: &components[0],-					Type:      &validCommandType,+					CommandLine: commands[0],

a test case where multiple commands of a type exist but the default is returned

adisky

comment created time in 4 days

Pull request review commentopenshift/odo

Update testing utils

 import ( 	"github.com/openshift/odo/pkg/testingutil" ) +var buildGroup = common.BuildCommandGroupType+var runGroup = common.RunCommandGroupType+var initGroup = common.InitCommandGroupType+ func TestGetCommand(t *testing.T) {  	commands := [...]string{"ls -la", "pwd"} 	components := [...]string{"alias1", "alias2"} 	invalidComponent := "garbagealias" 	workDir := [...]string{"/", "/root"}-	validCommandType := common.DevfileCommandTypeExec-	invalidCommandType := common.DevfileCommandType("garbage")+ 	emptyString := ""  	tests := []struct {-		name              string-		requestedCommands []string-		commandActions    []common.DevfileCommandAction-		isCommandRequired []bool-		wantErr           bool+		name          string+		requestedType []common.DevfileCommandGroupType+		execCommands  []common.Exec+		groupType     []common.DevfileCommandGroupType+		wantErr       bool 	}{ 		{-			name:              "Case 1: Valid devfile",-			requestedCommands: []string{"devbuild", "devrun"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 2: Valid devfile with devinit and devbuild",-			requestedCommands: []string{"devinit", "devbuild", "devrun"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 3: Valid devfile with devinit and devrun",-			requestedCommands: []string{"devinit", "devrun"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 4: Wrong command requested",-			requestedCommands: []string{"garbage1"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{true},-			wantErr:           true,-		},-		{-			name:              "Case 5: Invalid devfile with wrong devinit command type",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &invalidCommandType,-				},+			name: "Case 1: Valid devfile",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", buildGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{buildGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 6: Invalid devfile with empty devinit component",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &emptyString,-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},+			name: "Case 2: Valid devfile with devinit and devbuild",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", buildGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup, buildGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 7: Invalid devfile with empty devinit command",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &emptyString,-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},+			name: "Case 3: Valid devfile with devinit and devrun",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", initGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 8: Invalid devfile with wrong devbuild command type",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 4: Invalid devfile with empty component",+			execCommands: []versionsCommon.Exec{ 				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &invalidCommandType,+					CommandLine: commands[0],+					Component:   emptyString,+					WorkingDir:  workDir[0],+					Group:       &versionsCommon.Group{Kind: initGroup}, 				}, 			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup},+			wantErr:       true, 		}, 		{-			name:              "Case 9: Invalid devfile with empty devbuild component",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 5: Invalid devfile with empty devinit command",+			execCommands: []versionsCommon.Exec{ 				{-					Command:   &commands[0],-					Component: &emptyString,-					Workdir:   &workDir[0],-					Type:      &validCommandType,+					CommandLine: emptyString,+					Component:   components[0],+					WorkingDir:  workDir[0],+					Group:       &versionsCommon.Group{Kind: initGroup}, 				}, 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup},+			wantErr:       true, 		}, 		{-			name:              "Case 10: Invalid devfile with empty devbuild command",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 6: Valid devfile with empty workdir",+			execCommands: []common.Exec{ 				{-					Command:   &emptyString,-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,+					CommandLine: commands[0],+					Component:   components[0],+					Group:       &versionsCommon.Group{Kind: runGroup}, 				}, 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 11: Valid devfile with empty workdir",-			requestedCommands: []string{"devrun"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 7: Invalid command referencing an absent component",+			execCommands: []common.Exec{ 				{-					Command:   &commands[0],-					Component: &components[0],-					Type:      &validCommandType,+					CommandLine: commands[0],+					Component:   invalidComponent,+					Group:       &versionsCommon.Group{Kind: runGroup}, 				}, 			},-			isCommandRequired: []bool{true},-			wantErr:           false,-		},-		{-			name:              "Case 12: Invalid command referencing an absent component",-			requestedCommands: []string{"devrun"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &invalidComponent,-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{runGroup},+			wantErr:       true, 		}, 	} 	for _, tt := range tests { 		t.Run(tt.name, func(t *testing.T) {+			components := []common.DevfileComponent{testingutil.GetFakeComponent(tt.execCommands[0].Component)}+			if tt.execCommands[0].Component == invalidComponent {+				components = []common.DevfileComponent{testingutil.GetFakeComponent("randomComponent")}+			} 			devObj := devfileParser.DevfileObj{ 				Data: testingutil.TestDevfileData{-					CommandActions: tt.commandActions,-					ComponentType:  common.DevfileComponentTypeDockerimage,+					ExecCommands: tt.execCommands,+					Components:   components, 				}, 			} -			for i, commandName := range tt.requestedCommands {-				command, err := getCommand(devObj.Data, commandName, tt.isCommandRequired[i])+			for _, gtype := range tt.requestedType {+				_, err := getCommand(devObj.Data, "", gtype)

the command name shouldn't be empty

adisky

comment created time in 4 days

Pull request review commentopenshift/odo

Update testing utils

 import ( 	"github.com/openshift/odo/pkg/testingutil" ) +var buildGroup = common.BuildCommandGroupType+var runGroup = common.RunCommandGroupType+var initGroup = common.InitCommandGroupType+ func TestGetCommand(t *testing.T) {  	commands := [...]string{"ls -la", "pwd"} 	components := [...]string{"alias1", "alias2"} 	invalidComponent := "garbagealias" 	workDir := [...]string{"/", "/root"}-	validCommandType := common.DevfileCommandTypeExec-	invalidCommandType := common.DevfileCommandType("garbage")+ 	emptyString := ""  	tests := []struct {-		name              string-		requestedCommands []string-		commandActions    []common.DevfileCommandAction-		isCommandRequired []bool-		wantErr           bool+		name          string+		requestedType []common.DevfileCommandGroupType+		execCommands  []common.Exec+		groupType     []common.DevfileCommandGroupType+		wantErr       bool 	}{ 		{-			name:              "Case 1: Valid devfile",-			requestedCommands: []string{"devbuild", "devrun"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 2: Valid devfile with devinit and devbuild",-			requestedCommands: []string{"devinit", "devbuild", "devrun"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 3: Valid devfile with devinit and devrun",-			requestedCommands: []string{"devinit", "devrun"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{false, false, true},-			wantErr:           false,-		},-		{-			name:              "Case 4: Wrong command requested",-			requestedCommands: []string{"garbage1"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{true},-			wantErr:           true,-		},-		{-			name:              "Case 5: Invalid devfile with wrong devinit command type",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &invalidCommandType,-				},+			name: "Case 1: Valid devfile",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", buildGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{buildGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 6: Invalid devfile with empty devinit component",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &emptyString,-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},+			name: "Case 2: Valid devfile with devinit and devbuild",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", buildGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup, buildGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 7: Invalid devfile with empty devinit command",-			requestedCommands: []string{"devinit"},-			commandActions: []versionsCommon.DevfileCommandAction{-				{-					Command:   &emptyString,-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,-				},+			name: "Case 3: Valid devfile with devinit and devrun",+			execCommands: []versionsCommon.Exec{+				getExecCommand("", initGroup),+				getExecCommand("", runGroup), 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup, runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 8: Invalid devfile with wrong devbuild command type",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 4: Invalid devfile with empty component",+			execCommands: []versionsCommon.Exec{ 				{-					Command:   &commands[0],-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &invalidCommandType,+					CommandLine: commands[0],+					Component:   emptyString,+					WorkingDir:  workDir[0],+					Group:       &versionsCommon.Group{Kind: initGroup}, 				}, 			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup},+			wantErr:       true, 		}, 		{-			name:              "Case 9: Invalid devfile with empty devbuild component",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 5: Invalid devfile with empty devinit command",+			execCommands: []versionsCommon.Exec{ 				{-					Command:   &commands[0],-					Component: &emptyString,-					Workdir:   &workDir[0],-					Type:      &validCommandType,+					CommandLine: emptyString,+					Component:   components[0],+					WorkingDir:  workDir[0],+					Group:       &versionsCommon.Group{Kind: initGroup}, 				}, 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{initGroup},+			wantErr:       true, 		}, 		{-			name:              "Case 10: Invalid devfile with empty devbuild command",-			requestedCommands: []string{"devbuild"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 6: Valid devfile with empty workdir",+			execCommands: []common.Exec{ 				{-					Command:   &emptyString,-					Component: &components[0],-					Workdir:   &workDir[0],-					Type:      &validCommandType,+					CommandLine: commands[0],+					Component:   components[0],+					Group:       &versionsCommon.Group{Kind: runGroup}, 				}, 			},-			isCommandRequired: []bool{false},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{runGroup},+			wantErr:       false, 		}, 		{-			name:              "Case 11: Valid devfile with empty workdir",-			requestedCommands: []string{"devrun"},-			commandActions: []common.DevfileCommandAction{+			name: "Case 7: Invalid command referencing an absent component",+			execCommands: []common.Exec{ 				{-					Command:   &commands[0],-					Component: &components[0],-					Type:      &validCommandType,+					CommandLine: commands[0],+					Component:   invalidComponent,+					Group:       &versionsCommon.Group{Kind: runGroup}, 				}, 			},-			isCommandRequired: []bool{true},-			wantErr:           false,-		},-		{-			name:              "Case 12: Invalid command referencing an absent component",-			requestedCommands: []string{"devrun"},-			commandActions: []common.DevfileCommandAction{-				{-					Command:   &commands[0],-					Component: &invalidComponent,-					Type:      &validCommandType,-				},-			},-			isCommandRequired: []bool{true},-			wantErr:           true,+			requestedType: []common.DevfileCommandGroupType{runGroup},

a case for group mismatch too

adisky

comment created time in 4 days

delete branch mik-dass/odo

delete branch : type_fix_v1

delete time in 4 days

push eventopenshift/odo

Mrinal Das

commit sha 618c1291c5dfcc81a1f2d0c8a7e8db683f467ebb

Fixes type of project and components for devfile v1 (#3228)

view details

push time in 4 days

PR merged openshift/odo

Reviewers
Fixes type of project and components for devfile v1 kind/code-refactoring lgtm

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Fixes type of project and components for v1

+13 -13

2 comments

4 changed files

mik-dass

pr closed time in 4 days

issue commentopenshift/odo

odo delete --all fails to delete devfile component

@prietyc123 You need to push the component first and thus the error message cause: the component nodejs doesn't exist on the cluster as the component isn't pushed yet.

prietyc123

comment created time in 5 days

push eventmik-dass/odo

mik-dass

commit sha 9b294aa80354046c598f028d2d68346f3913ae0f

Fixes type of project and components for devfile v1

view details

push time in 5 days

PR opened openshift/odo

Fixes type of project and components for devfile v1

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Fixes type of project and components for v1

+9 -7

0 comment

2 changed files

pr created time in 5 days

create barnchmik-dass/odo

branch : type_fix_v1

created branch time in 5 days

Pull request review commentopenshift/odo

Extend download source to support revisions

 func TestIsValidProjectDir(t *testing.T) { 	} } -/* func TestGetGitHubZipURL(t *testing.T) {+	commitid := "39b5ec7833a65278012eab13a895471bba2cd03d"+	tag := "1.0.0" 	tests := []struct {-		name          string-		zipURL        string-		expectedError string+		name           string+		project        common.DevfileProject+		expectedErrors []string 	}{ 		{-			name:          "Case 1: Invalid http request",-			zipURL:        "http://github.com/che-samples/web-nodejs-sample/archive/master",-			expectedError: "Invalid GitHub URL. Please use https://",-		},-		{-			name:          "Case 2: Invalid owner",-			zipURL:        "https://github.com//web-nodejs-sample/archive/master",-			expectedError: "Invalid GitHub URL: owner cannot be empty. Expecting 'https://github.com/<owner>/<repo>'",+			name: "Case 1: Invalid http request",+			project: common.DevfileProject{+				Source: common.DevfileProjectSource{+					Location: "http://github.com/che-samples/web-nodejs-sample/archive/master",+				},+			},+			expectedErrors: []string{"Invalid GitHub URL. Please use https://"}, 		}, 		{-			name:          "Case 3: Invalid repo",-			zipURL:        "https://github.com/che-samples//archive/master",-			expectedError: "Invalid GitHub URL: repo cannot be empty. Expecting 'https://github.com/<owner>/<repo>'",+			name: "Case 2: Invalid owner",+			project: common.DevfileProject{+				Source: common.DevfileProjectSource{+					Location: "https://github.com//web-nodejs-sample/archive/master",+				},+			},+			expectedErrors: []string{"Invalid GitHub URL: owner cannot be empty. Expecting 'https://github.com/<owner>/<repo>'"}, 		}, 		{-			name:          "Case 4: Non-existent URL",-			zipURL:        "https://github.com/this/does/not/exist",-			expectedError: "Error getting zip url. Response: 404 Not Found.",+			name: "Case 3: Invalid repo",+			project: common.DevfileProject{+				Source: common.DevfileProjectSource{+					Location: "https://github.com/che-samples//archive/master",+				},+			},+			expectedErrors: []string{"Invalid GitHub URL: repo cannot be empty. Expecting 'https://github.com/<owner>/<repo>'"}, 		}, 		{-			name:          "Case 5: Valid SSH Github URL",-			zipURL:        "git@github.com:che-samples/web-nodejs-sample.git",-			expectedError: "",+			name: "Case 4: Invalid HTTPS Github URL with tag and commit",

I think we can mock the APIs using httptest package. Here's how they did the mocking upstream https://github.com/google/go-github/blob/master/github/repos_contents_test.go#L372 and here's how they setup up the test server https://github.com/google/go-github/blob/master/scrape/scrape_test.go#L14.

EnriqueL8

comment created time in 5 days

pull request commentopenshift/odo

Fix odo describe not listing all the ports after first url is created

/ok-to-test

dgolovin

comment created time in 5 days

issue commentopenshift/odo

[FLAKE]make test fails on osx and windows in travis CI

Ok let me check locally on a windows machine

I have tested the latest master watch test code 100+ times on a windows machine but couldn't reproduce the issue a single time. Also I think we should close this issue and create a new one as it has nothing to do with the issue reported.

prietyc123

comment created time in 5 days

Pull request review commentopenshift/odo

Run test locally against 4.* Cluster

 There are some test environment variable that helps to get more control over the  *Running integration tests:* -By default, tests are run against the `odo` binary placed in the PATH which is created by command `make`. Integration tests can be run in two (parallel and sequential) ways. To control the parallel run use environment variable `TEST_EXEC_NODES`. For example component test can be run+Login to the cluster using cluster credentials for running tests on 3.11 cluster. For example `odo login -u <user_name> -p <password> <server_URL>`. However `make configure-installer-tests-cluster` does login for running the tests on 4.* cluster. By default, tests are run against the `odo` binary placed in the PATH which is created by command `make`. Integration tests can be run in two (parallel and sequential) ways. To control the parallel run use environment variable `TEST_EXEC_NODES`. For example component test can be run
For running tests on a 3.11 cluster, login to the cluster using the required credentials. For example `odo login -u <user_name> -p <password> <server_URL>`. However `make configure-installer-tests-cluster` performs the login operation required to run the tests on a 4.* cluster. By default, tests are run against the `odo` binary placed in the PATH which is created by the command `make`. Integration tests can be run in two (parallel and sequential) ways. To control the parallel run use the environment variable `TEST_EXEC_NODES`. For example the component test can be run
amitkrout

comment created time in 5 days

Pull request review commentopenshift/odo

Run test locally against 4.* Cluster

 NOTE: Refer https://github.com/golang/go/wiki/LearnTesting for Go best practices  *Prerequisites:* -* A `minishift` or OpenShift environment with Service Catalog enabled:+* A `minishift` or OpenShift 3.11 environment with Service Catalog enabled: + ---- $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--enable=*,service-catalog,automation-service-broker,template-service-broker" ----+OR+* A `crc` environment for 4.* local cluster:+++For `crc` installation please refer https://github.com/code-ready/crc#documentation+++OR+* A 4.* cluster hosted remotely -* `odo` and `oc` binaries in `$PATH`.+NOTE: Make sure that `odo` and `oc` binaries are in `$PATH`. Use the clone odo directory to launch test on 3.11 and 4.* cluster. No cluster configuration is needed to run test on 3.11 cluster spin up by `Minishift` or `oc cluster up` locally, however a 4.* cluster needs to be configured before launching the test against it. The files `kubeadmin-password` and `kubeconfig` which contains cluster login details should be present in the auth directory and it should reside parallel to the `Makefile`. If it is not present in the auth directory, please create it. Then run `make configure-installer-tests-cluster` to configure the 4.* cluster.

tests /hold

amitkrout

comment created time in 5 days

issue commentopenshift/odo

[FLAKE]make test fails on osx and windows in travis CI

yes, just for your reference i am attaching a screen shoot. Logs collected from the travis CI

Ok let me check locally on a windows machine

prietyc123

comment created time in 5 days

issue commentopenshift/odo

[FLAKE]make test fails on osx and windows in travis CI

@mik-dass Skip is not a good idea as you mentioned. This issue has been hit twice, and i am sure more will come in recent future.

Yeah more will come and I am sure about that too.

AFAIK travis does not do image update, then how come suddenly our test fails?

Are you sure about that?

prietyc123

comment created time in 5 days

Pull request review commentopenshift/odo

Run test locally against 4.* Cluster

 NOTE: Refer https://github.com/golang/go/wiki/LearnTesting for Go best practices  *Prerequisites:* -* A `minishift` or OpenShift environment with Service Catalog enabled:+* A `minishift` or OpenShift 3.11 environment with Service Catalog enabled: + ---- $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--enable=*,service-catalog,automation-service-broker,template-service-broker" ----+OR+* A `crc` environment for 4.* local cluster:+++For `crc` installation please refer https://github.com/code-ready/crc#documentation+++OR+* A 4.* cluster hosted remotely -* `odo` and `oc` binaries in `$PATH`.+NOTE: Make sure that `odo` and `oc` binaries are in `$PATH`. Use the clone odo directory to launch test on 3.11 and 4.* cluster. To run test 3.11 cluster locally no cluster configuration is needed, however a 4.* cluster needs to be configured before launching the test against it. The files `kubeadmin-password` and `kubeconfig` which contains cluster login details should be present in the auth directory and it should reside parallel to the `Makefile`. If it is not present in the auth directory, please create it. Then run `make configure-installer-tests-cluster` to configure the 4.* cluster.
NOTE: Make sure that `odo` and `oc` binaries are in `$PATH`. Use the clone odo directory to launch the tests on 3.11 and 4.* clusters. To run the tests on a 3.11 cluster locally 
amitkrout

comment created time in 5 days

pull request commentopenshift/odo

Adds debug command for devfiles

 error: build error: After retrying 2 times, Pull image still failed due to error: while pulling "docker://image-registry.openshift-image-registry.svc:5000/openshift/ruby@sha256:a16542b25b4b9e

/retest

mik-dass

comment created time in 5 days

Pull request review commentopenshift/odo

Update testing utils

 func TestWriteJsonDevfile(t *testing.T) { 		devfileObj := DevfileObj{ 			Ctx: devfileCtx.NewDevfileCtx(devfileTempPath), 			Data: &v100.Devfile100{-				ApiVersion: common.ApiVersion(apiVersion),-				Metadata: common.DevfileMetadata{-					Name: &testName,+				ApiVersion: v100.ApiVersion(apiVersion),

do we need a test for v2

adisky

comment created time in 5 days

Pull request review commentopenshift/odo

Update testing utils

 import ( // TestDevfileData is a convenience data type used to mock up a devfile configuration type TestDevfileData struct { 	ComponentType       versionsCommon.DevfileComponentType-	CommandActions      []versionsCommon.DevfileCommandAction+	CommandActions      []versionsCommon.Exec

let's rename this

adisky

comment created time in 5 days

issue commentopenshift/odo

[FLAKE]make test fails on osx and windows in travis CI

Ok, then we should add patch in the upstream or let’s create an issue there to keep a track of that. Or is there any possibility to fix it from our end ?

The error is already handled upstream by throwing an error from their side. To fix this, we probably will need to change windows code.

prietyc123

comment created time in 5 days

issue commentopenshift/odo

[FLAKE]make test fails on osx and windows in travis CI

@mik-dass We are hitting the same issue on windows https://travis-ci.com/github/openshift/odo/jobs/337120311#L233

I haven't seen any such failures on windows recently on any other PR jobs. We will need to investigate.

prietyc123

comment created time in 5 days

delete branch mik-dass/odo

delete branch : fix_case_command

delete time in 5 days

push eventopenshift/odo

Mrinal Das

commit sha d4b996b454d527dff23f593a81991abc2619e34e

Fixes lower and upper case for commands (#3219)

view details

push time in 5 days

PR merged openshift/odo

Reviewers
Fixes lower and upper case for commands kind/code-refactoring lgtm

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Fixes upper and lower case for devfile commands.

+13 -14

2 comments

1 changed file

mik-dass

pr closed time in 5 days

Pull request review commentopenshift/odo

Run test locally against 4.* Cluster

 NOTE: Refer https://github.com/golang/go/wiki/LearnTesting for Go best practices  *Prerequisites:* -* A `minishift` or OpenShift environment with Service Catalog enabled:+* A `minishift` or OpenShift 3.11 environment with Service Catalog enabled: + ---- $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--enable=*,service-catalog,automation-service-broker,template-service-broker" ----+OR+* A `crc` environment for 4.* local cluster:+++For `crc` installation please refer https://github.com/code-ready/crc#documentation+++OR+* 4.* cluster hosted remotely

a 4.* cluster

amitkrout

comment created time in 6 days

Pull request review commentopenshift/odo

Run test locally against 4.* Cluster

 NOTE: Refer https://github.com/golang/go/wiki/LearnTesting for Go best practices  *Prerequisites:* -* A `minishift` or OpenShift environment with Service Catalog enabled:+* A `minishift` or OpenShift 3.11 environment with Service Catalog enabled: + ---- $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--enable=*,service-catalog,automation-service-broker,template-service-broker" ----+OR+* A `crc` environment for 4.* local cluster:+++For `crc` installation please refer https://github.com/code-ready/crc#documentation+++OR+* 4.* cluster hosted remotely -* `odo` and `oc` binaries in `$PATH`.+NOTE: Make sure that `odo` and `oc` binaries are in `$PATH`. Use the clone odo directory to launch test on 3.11 and 4.* cluster. To run test 3.11 cluster locally no cluster configuration is needed, however 4.* cluster need to be configure before launching the test against it. Make sure file `kubeadmin-password` and `kubeconfig` should be present in auth directory (create it) which resides parallel to Makefile. Then run `make configure-installer-tests-cluster` to configure the 4.* cluster.
however a 4.* cluster needs to be configured before launching the test against it. The files `kubeadmin-password` and `kubeconfig` should be present in the auth directory and it should reside parallel to the Makefile. If it is not present in the auth directory, please create it. Then run `make configure-installer-tests-cluster` to configure the 4.* cluster.
amitkrout

comment created time in 6 days

pull request commentopenshift/odo

Adds debug command for devfiles

 should list the services if they exist [It]
    /go/src/github.com/openshift/odo/tests/integration/operatorhub/cmd_service_test.go:170
    Failed after 0.460s.
      
    Running odo with args [odo service list -o json]
    Expected
        <int>: 0
    not to match exit code:
        <int>: 0

/retest

mik-dass

comment created time in 6 days

PR opened openshift/odo

Fixes lower and upper case for commands

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Fixes upper and lower case for devfile commands.

+13 -14

0 comment

1 changed file

pr created time in 6 days

create barnchmik-dass/odo

branch : fix_case_command

created branch time in 6 days

issue closedopenshift/odo

Autoselect local port for debug port forwarding

/kind bug

What versions of software are you using?

Operating System: Windows 10 Pro

Output of odo version: 1.0.1

How did you run odo exactly?

Run odo debug port-forward for one component,

C:\Temp\nodejs-ex>c:\Users\dgolo\.vs-openshift\odo debug port-forward
Started port forwarding at ports - 5858:5858

then cd to different context folder and run odo debug port-forward again

Actual behavior

C:\Temp\nodejs-ex1>c:\Users\dgolo\.vs-openshift\odo debug port-forward
Started port forwarding at ports - 5858:5858
 X  Unable to listen on any of the requested ports: [{5858 5858}]

Expected behavior

Two port forwarding works at the same time

Any logs, error output, etc?

closed time in 6 days

dgolovin

pull request commentopenshift/odo

Adds debug command for devfiles

[odo] Error: Failed to create the component: unable to create or update component: unable to create Deployment ypftej: deployments.apps "ypftej" is forbidden: unable to create new content in namespace xeeuyhrwsa because it is being terminated
Deleting project: gjnoorwegq

/retest

mik-dass

comment created time in 6 days

push eventmik-dass/odo

Dharmit Shah

commit sha 1e24b536eabf9b773e129755ac270b63b3bf06da

JSON output for service list in experimental mode (#3186) * JSON output for service list in experimental mode * Changes to tests as per PR feedback https://github.com/openshift/odo/pull/3186#pullrequestreview-412446173

view details

Mrinal Das

commit sha 4f994bea153b1683bd84fe54b4c2577acccdaad8

Adds a document for debugging applications using devfiles (#3187) * Adds a document for debugging applications using devfiles * Updated syntax and improving the wording Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 6 days

Pull request review commentopenshift/odo

Update Docker and Kubernetes adapter to use groups

 func validateCommand(data data.DevfileData, command common.DevfileCommand) (err  	isActionValid := false 	for _, component := range components {-		if command.Exec.Component == component.Container.Name && isComponentSupported(component) {+		if command.Exec.Component == component.Container.Name {

don't we need the isComponentSupported check? It seems to be modified below

adisky

comment created time in 7 days

Pull request review commentopenshift/odo

Update Docker and Kubernetes adapter to use groups

 type ComponentInfo struct { 	PodName       string 	ContainerName string }++// PushCommandsMap stores the commands to be executed as per there types.

their types

adisky

comment created time in 7 days

Pull request review commentopenshift/odo

Update Docker and Kubernetes adapter to use groups

 func getPortMap(context string, endpoints []*versionsCommon.Endpoint, show bool)  // Executes all the commands from the devfile in order: init and build - which are both optional, and a compulsary run. // Init only runs once when the component is created.-func (a Adapter) execDevfile(pushDevfileCommands []versionsCommon.DevfileCommand, componentExists, show bool, containers []types.Container) (err error) {+func (a Adapter) execDevfile(commandsMap common.CommandsMap, componentExists, show bool, containers []types.Container) (err error) { 	// If nothing has been passed, then the devfile is missing the required run command-	if len(pushDevfileCommands) == 0 {+	if len(commandsMap) == 0 { 		return errors.New(fmt.Sprint("error executing devfile commands - there should be at least 1 command")) 	} -	commandOrder := []common.CommandNames{}- 	// Only add runinit to the expected commands if the component doesn't already exist 	// This would be the case when first running the container 	if !componentExists {-		commandOrder = append(commandOrder, common.CommandNames{DefaultName: string(common.DefaultDevfileInitCommand), AdapterName: a.devfileInitCmd})+		// Get Init Command+		command, ok := commandsMap[versionsCommon.InitCommandGroupType]+		if ok {++			containerID := utils.GetContainerIDForAlias(containers, command.Exec.Component)

OK

adisky

comment created time in 7 days

Pull request review commentopenshift/odo

Update Docker and Kubernetes adapter to use groups

 type ComponentInfo struct { 	PodName       string 	ContainerName string }++type CommandsMap map[common.DevfileCommandGroupType]common.DevfileCommand

Some comments regarding the variable

adisky

comment created time in 7 days

Pull request review commentopenshift/odo

Update Docker and Kubernetes adapter to use groups

 func getPortMap(context string, endpoints []*versionsCommon.Endpoint, show bool)  // Executes all the commands from the devfile in order: init and build - which are both optional, and a compulsary run. // Init only runs once when the component is created.-func (a Adapter) execDevfile(pushDevfileCommands []versionsCommon.DevfileCommand, componentExists, show bool, containers []types.Container) (err error) {+func (a Adapter) execDevfile(commandsMap common.CommandsMap, componentExists, show bool, containers []types.Container) (err error) { 	// If nothing has been passed, then the devfile is missing the required run command-	if len(pushDevfileCommands) == 0 {+	if len(commandsMap) == 0 { 		return errors.New(fmt.Sprint("error executing devfile commands - there should be at least 1 command")) 	} -	commandOrder := []common.CommandNames{}- 	// Only add runinit to the expected commands if the component doesn't already exist 	// This would be the case when first running the container 	if !componentExists {-		commandOrder = append(commandOrder, common.CommandNames{DefaultName: string(common.DefaultDevfileInitCommand), AdapterName: a.devfileInitCmd})+		// Get Init Command+		command, ok := commandsMap[versionsCommon.InitCommandGroupType]+		if ok {++			containerID := utils.GetContainerIDForAlias(containers, command.Exec.Component)

Should we rename this function? Because Alias is not there in v2 and this seems confusing to me.

adisky

comment created time in 7 days

Pull request review commentopenshift/odo

Update Docker and Kubernetes adapter to use groups

 func (a Adapter) waitAndGetComponentPod(hideSpinner bool) (*corev1.Pod, error) {  // Executes all the commands from the devfile in order: init and build - which are both optional, and a compulsary run. // Init only runs once when the component is created.-func (a Adapter) execDevfile(pushDevfileCommands []versionsCommon.DevfileCommand, componentExists, show bool, podName string, containers []corev1.Container) (err error) {+func (a Adapter) execDevfile(commandsMap common.CommandsMap, componentExists, show bool, podName string, containers []corev1.Container) (err error) { 	// If nothing has been passed, then the devfile is missing the required run command-	if len(pushDevfileCommands) == 0 {+	if len(commandsMap) == 0 { 		return errors.New(fmt.Sprint("error executing devfile commands - there should be at least 1 command")) 	} -	commandOrder := []common.CommandNames{}+	compInfo := common.ComponentInfo{+		PodName: podName,+	}  	// Only add runinit to the expected commands if the component doesn't already exist 	// This would be the case when first running the container 	if !componentExists {-		commandOrder = append(commandOrder, common.CommandNames{DefaultName: string(common.DefaultDevfileInitCommand), AdapterName: a.devfileInitCmd})+		// Get Init Command+		command, ok := commandsMap[versionsCommon.InitCommandGroupType]+		if ok {+			compInfo.ContainerName = command.Exec.Component+			err = exec.ExecuteDevfileBuildAction(&a.Client, *command.Exec, command.Exec.Id, compInfo, show)+			if err != nil {+				return err+			}++		}+ 	}-	commandOrder = append(-		commandOrder,-		common.CommandNames{DefaultName: string(common.DefaultDevfileBuildCommand), AdapterName: a.devfileBuildCmd},-		common.CommandNames{DefaultName: string(common.DefaultDevfileRunCommand), AdapterName: a.devfileRunCmd},-	)--	// Loop through each of the expected commands in the devfile-	for i, currentCommand := range commandOrder {-		// Loop through each of the command given from the devfile-		for _, command := range pushDevfileCommands {-			// If the current command from the devfile is the currently expected command from the devfile-			if command.Exec.Id == currentCommand.DefaultName || command.Exec.Id == currentCommand.AdapterName {-				// If the current command is not the last command in the slice-				// it is not expected to be the run command-				if i < len(commandOrder)-1 {-					// Any exec command such as "Init" and "Build"--					compInfo := common.ComponentInfo{-						ContainerName: command.Exec.Component,-						PodName:       podName,-					}--					err = exec.ExecuteDevfileBuildAction(&a.Client, *command.Exec, command.Exec.Id, compInfo, show)-					if err != nil {-						return err-					}--					// If the current command is the last command in the slice-					// it is expected to be the run command-				} else {-					// Last command is "Run"-					klog.V(4).Infof("Executing devfile command %v", command.Exec.Id)--					// Check if the devfile run component containers have supervisord as the entrypoint.-					// Start the supervisord if the odo component does not exist-					if !componentExists {-						err = a.InitRunContainerSupervisord(command.Exec.Component, podName, containers)-						if err != nil {-							return-						}-					}--					compInfo := common.ComponentInfo{-						ContainerName: command.Exec.Component,-						PodName:       podName,-					}--					if componentExists && !common.IsRestartRequired(command) {-						klog.V(4).Infof("restart:false, Not restarting DevRun Command")-						err = exec.ExecuteDevfileRunActionWithoutRestart(&a.Client, *command.Exec, command.Exec.Id, compInfo, show)-						return-					}--					err = exec.ExecuteDevfileRunAction(&a.Client, *command.Exec, command.Exec.Id, compInfo, show)++	// Get Build Command+	command, ok := commandsMap[versionsCommon.BuildCommandGroupType]+	if ok {+		compInfo.ContainerName = command.Exec.Component+		err = exec.ExecuteDevfileBuildAction(&a.Client, *command.Exec, command.Exec.Id, compInfo, show)+		if err != nil {+			return err+		}++		command, ok := commandsMap[versionsCommon.RunCommandGroupType]

why is the run command run only if a build command is present?

adisky

comment created time in 7 days

delete branch mik-dass/odo

delete branch : fix_v2_adapter_docker

delete time in 7 days

push eventmik-dass/odo

mik-dass

commit sha 2833b52d46a01a849f112c781711097e941933e3

Fixes utils of docker docker adapter Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 7 days

Pull request review commentopenshift/odo

Fixes utils of docker adapter

 func containerHasPort(devfilePort nat.Port, exposedPorts nat.PortSet) bool { func UpdateComponentWithSupervisord(comp *common.DevfileComponent, runCommand common.DevfileCommand, supervisordVolumeName string, hostConfig *container.HostConfig) {  	// Mount the supervisord volume for the run command container-	for _, action := range runCommand.Actions {-		if *action.Component == *comp.Alias {-			AddVolumeToContainer(supervisordVolumeName, adaptersCommon.SupervisordMountPath, hostConfig)--			if len(comp.Command) == 0 && len(comp.Args) == 0 {

Commented out the code

mik-dass

comment created time in 7 days

push eventmik-dass/odo

Mrinal Das

commit sha d054e0ce2a28bb17d83cc33f05ec4edfdd818865

Updates create logic to v2 (#3200)

view details

mik-dass

commit sha 2cc49cb346888053b3a98709aa47567dc592fb0b

Fixes utils of docker docker adapter Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 7 days

delete branch mik-dass/odo

delete branch : debug_dev_doc

delete time in 7 days

Pull request review commentopenshift/odo

Fixes utils of docker adapter

 func containerHasPort(devfilePort nat.Port, exposedPorts nat.PortSet) bool { func UpdateComponentWithSupervisord(comp *common.DevfileComponent, runCommand common.DevfileCommand, supervisordVolumeName string, hostConfig *container.HostConfig) {  	// Mount the supervisord volume for the run command container-	for _, action := range runCommand.Actions {-		if *action.Component == *comp.Alias {-			AddVolumeToContainer(supervisordVolumeName, adaptersCommon.SupervisordMountPath, hostConfig)--			if len(comp.Command) == 0 && len(comp.Args) == 0 {

@maysunfaisal @johnmcollier Can you please validate this?

mik-dass

comment created time in 7 days

push eventopenshift/odo

Mrinal Das

commit sha d054e0ce2a28bb17d83cc33f05ec4edfdd818865

Updates create logic to v2 (#3200)

view details

push time in 7 days

delete branch mik-dass/odo

delete branch : v2_cli_fix

delete time in 7 days

PR merged openshift/odo

Reviewers
Updates create logic to v2 kind/code-refactoring

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Updates the create logic to use v2 based common

+10 -10

1 comment

1 changed file

mik-dass

pr closed time in 7 days

Pull request review commentopenshift/odo

Fixes utils of docker adapter

 func containerHasPort(devfilePort nat.Port, exposedPorts nat.PortSet) bool { func UpdateComponentWithSupervisord(comp *common.DevfileComponent, runCommand common.DevfileCommand, supervisordVolumeName string, hostConfig *container.HostConfig) {  	// Mount the supervisord volume for the run command container-	for _, action := range runCommand.Actions {-		if *action.Component == *comp.Alias {-			AddVolumeToContainer(supervisordVolumeName, adaptersCommon.SupervisordMountPath, hostConfig)--			if len(comp.Command) == 0 && len(comp.Args) == 0 {

I am not sure about this. We need to ask someone who has worked on this file previously.

mik-dass

comment created time in 7 days

PR opened openshift/odo

Reviewers
Updates create logic to v2

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Updates the create logic to use v2 based common

+10 -10

0 comment

1 changed file

pr created time in 7 days

create barnchmik-dass/odo

branch : v2_cli_fix

created branch time in 7 days

push eventmik-dass/odo

mik-dass

commit sha 1535979b13298c6bc5af5b6287b8e2c2cc7cb96a

Fixes utils of docker docker adapter Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 7 days

PR opened openshift/odo

Reviewers
Fix v2 adapter docker

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Fixes utils of docker adapter

+2470 -543

0 comment

22 changed files

pr created time in 7 days

create barnchmik-dass/odo

branch : fix_v2_adapter_docker

created branch time in 7 days

delete branch mik-dass/odo

delete branch : fix_v2_kadapter_utils

delete time in 7 days

push eventopenshift/odo

Mrinal Das

commit sha 5f5c89088466dfd0e250d08a1e65a67fc6863802

Fixes utils of k8s adapter (#3195)

view details

push time in 7 days

PR merged openshift/odo

Reviewers
Fixes utils of k8s adapter kind/code-refactoring

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Fixes utils of k8s adapter for v2 devfile

+54 -58

1 comment

3 changed files

mik-dass

pr closed time in 7 days

Pull request review commentopenshift/odo

Update Command Logic to use groups

 import ( )  // GetCommand iterates through the devfile commands and returns the associated devfile command-func getCommand(data data.DevfileData, commandName string, required bool) (supportedCommand common.DevfileCommand, err error) {+func getCommand(data data.DevfileData, commandName string, groupType common.DevfileCommandGroupType, required bool) (supportedCommand common.DevfileCommand, err error) {++	var found = false+ 	for _, command := range data.GetCommands() {-		if command.Exec.Id == commandName {+		// validate command+		err = validateCommand(data, command)++		if err != nil {+			return common.DevfileCommand{}, err+		}++		// if command is specified via flags, it has the highest priority+		if commandName != "" && command.Exec.Id == commandName && command.Exec.Group.Kind == groupType {+			found = true+			supportedCommand = command+			break+		} -			// Get the supported actions-			err = validateCommand(data, command)+		// if not command specified via flag, default command has the highest priority+		if command.Exec.Group.Kind == groupType && command.Exec.Group.IsDefault {+			supportedCommand = command+			break+		}++		// return the first command found for the matching type.+		if command.Exec.Group.Kind == groupType {+			supportedCommand = command -			if err != nil {-				return common.DevfileCommand{}, err-			}-			// The command is supported, use it-			supportedCommand.Exec = command.Exec-			return supportedCommand, nil 		}+ 	} -	// The command was not found-	msg := fmt.Sprintf("The command \"%v\" was not found in the devfile", commandName)-	if required {-		// Not found and required, return an error-		err = fmt.Errorf(msg)-	} else {-		// Not found and optional, so just log it-		klog.V(3).Info(msg)+	if commandName != "" && !found {

do we need this check? please add a comment here

adisky

comment created time in 7 days

Pull request review commentopenshift/odo

Update Command Logic to use groups

 import ( )  // GetCommand iterates through the devfile commands and returns the associated devfile command-func getCommand(data data.DevfileData, commandName string, required bool) (supportedCommand common.DevfileCommand, err error) {+func getCommand(data data.DevfileData, commandName string, groupType common.DevfileCommandGroupType, required bool) (supportedCommand common.DevfileCommand, err error) {++	var found = false+ 	for _, command := range data.GetCommands() {-		if command.Exec.Id == commandName {+		// validate command+		err = validateCommand(data, command)++		if err != nil {+			return common.DevfileCommand{}, err+		}++		// if command is specified via flags, it has the highest priority+		if commandName != "" && command.Exec.Id == commandName && command.Exec.Group.Kind == groupType {+			found = true+			supportedCommand = command+			break+		} -			// Get the supported actions-			err = validateCommand(data, command)+		// if not command specified via flag, default command has the highest priority+		if command.Exec.Group.Kind == groupType && command.Exec.Group.IsDefault {+			supportedCommand = command+			break+		}++		// return the first command found for the matching type.+		if command.Exec.Group.Kind == groupType {+			supportedCommand = command

should we return after this?

adisky

comment created time in 7 days

pull request commentopenshift/odo

Adds a document for debugging applications using devfiles

Can you please address this or may be you are missing the proper skip command for travis CI?

I didn't include it in the commit message because it doesn't work for openshift CI anyways.

mik-dass

comment created time in 7 days

PR opened openshift/odo

Fixes utils of k8s adapter

What type of PR is this?

/kind code-refactoring

What does does this PR do / why we need it:

Fixes utils of k8s adapter for v2 devfile

+54 -58

0 comment

3 changed files

pr created time in 7 days

push eventmik-dass/odo

mik-dass

commit sha 3f3dc1a7f99d89a325d14ce5eb2b1a878a398509

Fixes utils of k8s adapter

view details

push time in 7 days

create barnchmik-dass/odo

branch : fix_v2_kadapter_utils

created branch time in 7 days

push eventmik-dass/odo

Tomas Kral

commit sha 4cd78ce01b006e19b6ddeaf1d54014d5f5af5faf

add mik-dass and dharmit as top level approvers (#3189)

view details

Charlie Drage

commit sha 1297144a4ec2fbbcc96e9dbecd79d2d8fb86b962

Add .gitignore files for jekyll / site (#3171) **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply become: `/kind bug` /kind code-refactoring **What does does this PR do / why we need it**: Updates the `.gitignore` for html and jekyll information. As I kept having to `git clean` the dir. **Which issue(s) this PR fixes**: N/A **How to test changes / Special notes to the reviewer**: N/A Signed-off-by: Charlie Drage <charlie@charliedrage.com>

view details

Chris Laprun

commit sha 898cd396f5f2fc97af139fb1a730858c3379a6b3

Performance improvement for odo catalog list components when using devfiles (#3112) * feat: parallel fetching of component types to improve performance Fix #3105 as we now also fetch devfiles for completion, which was previously prohibitively slow. * fix: add missing mutex, rename existing one for clarity * refactor: simplify getDevfileWith by computing link within function * docs: add documentation, update existing one * refactor: rename wg to devfileWG for clarity * fix: improper test setup * fix: only filter components if there's no error * fix: re-implement using channels, handle error and timeout better * fix: no need to pass error * fix: populate base in GetDevfileIndex, use registry URL, hiding path * fix: properly retrieve all devfiles Performance is not that great so investigating better options. * fix: use new ConcurrentTasks support, allowing proper error reporting * fix: adapt to dynamic registries * feat: simplify ConcurrentTask by hiding WaitGroup It was too easy to forget calling Done in ToRun leading to deadlocks. * fix: broken tests * fix: wording [skip ci] * fix: remove unused function, added doc [skip ci] * fix: remove unused ErrorWrapper [skip ci] * fix: rename package import [skip ci] * fix: test getDevfileIndexEntries directly, remove now unused function

view details

push time in 7 days

delete branch mik-dass/odo

delete branch : v2_command

delete time in 7 days

push eventopenshift/odo

Mrinal Das

commit sha 5c4b1d444af6928ad10b700ea5191ecb66d5a924

Fixes command.go and kubernetes adapter (#3194) Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 7 days

PR merged openshift/odo

Reviewers
V2 command kind/code-refactoring

What type of PR is this? /kind code-refactoring

What does does this PR do / why we need it:

Fixes command.go for parser v2

Note: for branch parser-v2

+62 -210

1 comment

6 changed files

mik-dass

pr closed time in 7 days

pull request commentopenshift/odo

Adds a document for debugging applications using devfiles

Have you verified the steps manually (You - OP or Approver or lgtmer)

yes

Are these steps have been implemented in our test suite

you can check the PR directly for that https://github.com/openshift/odo/pull/3059

mik-dass

comment created time in 7 days

push eventmik-dass/odo

Tomas Kral

commit sha 4cd78ce01b006e19b6ddeaf1d54014d5f5af5faf

add mik-dass and dharmit as top level approvers (#3189)

view details

Charlie Drage

commit sha 1297144a4ec2fbbcc96e9dbecd79d2d8fb86b962

Add .gitignore files for jekyll / site (#3171) **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply become: `/kind bug` /kind code-refactoring **What does does this PR do / why we need it**: Updates the `.gitignore` for html and jekyll information. As I kept having to `git clean` the dir. **Which issue(s) this PR fixes**: N/A **How to test changes / Special notes to the reviewer**: N/A Signed-off-by: Charlie Drage <charlie@charliedrage.com>

view details

Chris Laprun

commit sha 898cd396f5f2fc97af139fb1a730858c3379a6b3

Performance improvement for odo catalog list components when using devfiles (#3112) * feat: parallel fetching of component types to improve performance Fix #3105 as we now also fetch devfiles for completion, which was previously prohibitively slow. * fix: add missing mutex, rename existing one for clarity * refactor: simplify getDevfileWith by computing link within function * docs: add documentation, update existing one * refactor: rename wg to devfileWG for clarity * fix: improper test setup * fix: only filter components if there's no error * fix: re-implement using channels, handle error and timeout better * fix: no need to pass error * fix: populate base in GetDevfileIndex, use registry URL, hiding path * fix: properly retrieve all devfiles Performance is not that great so investigating better options. * fix: use new ConcurrentTasks support, allowing proper error reporting * fix: adapt to dynamic registries * feat: simplify ConcurrentTask by hiding WaitGroup It was too easy to forget calling Done in ToRun leading to deadlocks. * fix: broken tests * fix: wording [skip ci] * fix: remove unused function, added doc [skip ci] * fix: remove unused ErrorWrapper [skip ci] * fix: rename package import [skip ci] * fix: test getDevfileIndexEntries directly, remove now unused function

view details

Aditi Sharma

commit sha 8223b62cb80fb46582d54acf3af8bf437f9ac5b2

Add Devfile Parser V2, Update Common Structs (#3188) * Add Devfile Parser for Version 2.0.0 Added Devfile V2 Go Structures Added converter for v2 ro common types Signed-off-by: adisky <adsharma@redhat.com> * Add example V2 devfile added example nodejs V2 devfile * Add Common Types as V2 Add common types as v2 Add Converter from common to v1 * Updated example devfile with group

view details

mik-dass

commit sha 479cc4310832c575c8d84a58565db2845650da9d

Fixes command.go and kubernetes adapter Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 7 days

Pull request review commentopenshift/odo

Adds a document for debugging applications using devfiles

+# Debugging components using devfiles++`odo` uses devfiles to build and deploy components. More information on devifles : https://redhat-developer.github.io/devfile/[Introduction to devfile]++To enable debugging mode for the component using devfiles, we need to enable the experimental mode for odo. This can be done by: `odo preference set experimental true`. We also need a devfile with `debugrun` step. Example of a nodejs devfile with a debugrun step:++```yaml+apiVersion: 1.0.0+metadata:+  name: test-devfile+projects:+  -+    name: nodejs-web-app+    source:+      type: git+      location: "https://github.com/che-samples/web-nodejs-sample.git"+components:+  - type: dockerimage+    image: quay.io/eclipse/che-nodejs10-ubi:nightly+    endpoints:+      - name: "3000/tcp"+        port: 3000+    alias: runtime+    env:+      - name: FOO+        value: "bar"+    memoryLimit: 1024Mi+    mountSources: true+commands:+  - name: devbuild+    actions:+      - type: exec+        component: runtime+        command: "npm install"+        workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app+  - name: devrun+    actions:+      - type: exec+        component: runtime+        command: "nodemon app.js"+        workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app+  - name: debugrun+    actions:+      - type: exec+        component: runtime+        command: "nodemon --inspect=${DEBUG_PORT}"+        workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/+```++- Now we need to create the component using `odo create nodejs`+- Next we enable remote debugging for the component using `odo push --debug`. We can also use a custom step as the debugrun step using `odo push --debug --debug-command="custom-step"`+- Next we port forward a local port for debugging using `odo debug port-forward`. The default local port used for debugging is 5858. If 5858 is occupied, odo will automatically pick up a local port. We can also specify the local port using, `odo debug port-forward --local-port 5858`+- Next we need to attach the debugger to the local port. Here's a guide to do it for VS Code : [Remote Debugging](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_remote-debugging)

fixed

mik-dass

comment created time in 8 days

push eventmik-dass/odo

Tomas Kral

commit sha 4cd78ce01b006e19b6ddeaf1d54014d5f5af5faf

add mik-dass and dharmit as top level approvers (#3189)

view details

Charlie Drage

commit sha 1297144a4ec2fbbcc96e9dbecd79d2d8fb86b962

Add .gitignore files for jekyll / site (#3171) **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply become: `/kind bug` /kind code-refactoring **What does does this PR do / why we need it**: Updates the `.gitignore` for html and jekyll information. As I kept having to `git clean` the dir. **Which issue(s) this PR fixes**: N/A **How to test changes / Special notes to the reviewer**: N/A Signed-off-by: Charlie Drage <charlie@charliedrage.com>

view details

Chris Laprun

commit sha 898cd396f5f2fc97af139fb1a730858c3379a6b3

Performance improvement for odo catalog list components when using devfiles (#3112) * feat: parallel fetching of component types to improve performance Fix #3105 as we now also fetch devfiles for completion, which was previously prohibitively slow. * fix: add missing mutex, rename existing one for clarity * refactor: simplify getDevfileWith by computing link within function * docs: add documentation, update existing one * refactor: rename wg to devfileWG for clarity * fix: improper test setup * fix: only filter components if there's no error * fix: re-implement using channels, handle error and timeout better * fix: no need to pass error * fix: populate base in GetDevfileIndex, use registry URL, hiding path * fix: properly retrieve all devfiles Performance is not that great so investigating better options. * fix: use new ConcurrentTasks support, allowing proper error reporting * fix: adapt to dynamic registries * feat: simplify ConcurrentTask by hiding WaitGroup It was too easy to forget calling Done in ToRun leading to deadlocks. * fix: broken tests * fix: wording [skip ci] * fix: remove unused function, added doc [skip ci] * fix: remove unused ErrorWrapper [skip ci] * fix: rename package import [skip ci] * fix: test getDevfileIndexEntries directly, remove now unused function

view details

mik-dass

commit sha 89c60436f42ce45f7fc2759dfb8f2f7ce7ebe8ba

Adds a document for debugging applications using devfiles

view details

mik-dass

commit sha 49ef3f6178797dc966d91d7417caa948e78bba7c

Updated syntax and improving the wording Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 8 days

PR opened openshift/odo

Reviewers
V2 command

What type of PR is this? /kind code-refactoring

What does does this PR do / why we need it:

Fixes command.go for parser v2

+285 -268

0 comment

13 changed files

pr created time in 8 days

create barnchmik-dass/odo

branch : v2_command

created branch time in 8 days

pull request commentopenshift/odo

Performance improvement for odo catalog list components when using devfiles

I guess my question is why wasn't this PR merged as soon as it was approved. What's the point of waiting some more?

TBH I don't know. Merging is up to the CI. I only re triggered it because of https://github.com/openshift/odo/pull/3112#issuecomment-629273115.

metacosm

comment created time in 10 days

pull request commentopenshift/odo

Performance improvement for odo catalog list components when using devfiles

No, my question was why do the tests need to be re-triggered when the PR passed all of them already? Why run them all over again?

Because tide was reporting resting ci/prow/unit ci/prow/v4.2-inte... for more than half an hour but all the CI tests were already green. So I felt it was stuck. So in order to get things moving forward, I restarted them manually.

metacosm

comment created time in 10 days

pull request commentopenshift/odo

Performance improvement for odo catalog list components when using devfiles

I don't get it? Why is this needed?

@metacosm The CI seemed stuck. Tide was stuck at retesting all the tests for like half an hour but it didn't triggered any CI jobs and they were all in finished state. So I restarted them manually.

metacosm

comment created time in 10 days

pull request commentopenshift/odo

Adds debug command for devfiles

level=fatal msg="failed to fetch Common Manifests: failed to fetch dependency of \"Common Manifests\": failed to generate asset \"DNS Config\": getting public zone for \"origin-ci-int-aws.dev.rhcloud.com\": listing hosted zones: Throttling: Rate exceeded\n\tstatus code: 400, request id: 63350bed-0a62-41b7-ae90-3d8f727119c1"

/retest

mik-dass

comment created time in 10 days

pull request commentopenshift/odo

Performance improvement for odo catalog list components when using devfiles

/test ci/prow/v4.2-integration-e2e

metacosm

comment created time in 10 days

pull request commentopenshift/odo

Adds a document for debugging applications using devfiles

@dharmit Fixed

mik-dass

comment created time in 10 days

push eventmik-dass/odo

mik-dass

commit sha be7401aca1fcdffaf1e90406b78f72dd9c438a9f

Updated syntax and improving the wording Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 10 days

push eventmik-dass/odo

mik-dass

commit sha 95ec7d26995ed01afcf545fd6d9877829504b0ba

Updated syntax and improving the wording Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 10 days

push eventmik-dass/odo

mik-dass

commit sha 18d792a45fb7ae1c2bb8985ab63a4114bf6c64a7

Updated syntax and improving the wording Signed-off-by: mik-dass <mrinald7@gmail.com>

view details

push time in 10 days

push eventmik-dass/odo

Charlie Drage

commit sha 99f1a2f84fef58c2aafbce9a9bc44e47f7e63fe8

Add operator hub documentation (#3158) **What type of PR is this?** /kind documentation [skip ci] **What does does this PR do / why we need it**: Modifies the current operator hub documentation in the format as some of the other tutorial documentation **Which issue(s) this PR fixes**: N/A **How to test changes / Special notes to the reviewer**: N/A

view details

Charlie Drage

commit sha b7b7c2fac2290dd40496a1c08aba2ae543c751d4

Release 1.2.1 of odo (#3181) **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply become: `/kind bug` /kind feature **What does does this PR do / why we need it**: Releases 1.2.1 of odo **Which issue(s) this PR fixes**: N/A **How to test changes / Special notes to the reviewer**: N/A Signed-off-by: Charlie Drage <charlie@charliedrage.com>

view details

Aditi Sharma

commit sha 46361ff49857910fa3e4f41404a17e661f961761

Fix odo fake component create on kubernetes cluster (#3124) * Fix odo component create on k8s cluster Do not execute S2i related code on kubernetes cluster. Signed-off-by: adisky <adsharma@redhat.com> * Add IsImageStreamSupported to check for cluster type. * Refactor to a common function

view details

push time in 10 days

push eventmik-dass/odo

mik-dass

commit sha 56d37245a56c01f66238a4869efe8f5bfbf12d24

Adds a document for debugging applications using devfiles

view details

push time in 11 days

push eventmik-dass/odo

mik-dass

commit sha 6cc48b5390bc8d3933b26896544e83903ee141f6

Adds a document for debugging applications using devfiles

view details

push time in 11 days

push eventmik-dass/odo

mik-dass

commit sha ed2b1cf6453e8a217656f6e01041f152a29dc0fb

Fixes comments and variable names

view details

push time in 11 days

pull request commentopenshift/odo

Adds debug command for devfiles

@kadel @dharmit I have added the documentation here #3187

mik-dass

comment created time in 11 days

PR opened openshift/odo

Adds a document for debugging applications using devfiles

What type of PR is this?

/kind documentation [skip ci]

What does does this PR do / why we need it:

This adds a document for debugging applications using devfiles.

Which issue(s) this PR fixes:

Fixes NA

+56 -0

0 comment

1 changed file

pr created time in 11 days

create barnchmik-dass/odo

branch : debug_dev_doc

created branch time in 11 days

Pull request review commentopenshift/odo

add state to ingress list and describe

 type URLList struct { 	Items           []URL `json:"items"` } +type IngressURLList struct {

same as https://github.com/openshift/odo/pull/3160#discussion_r425576551

yangcao77

comment created time in 11 days

Pull request review commentopenshift/odo

add state to ingress list and describe

 type URL struct { 	Status            URLStatus `json:"status,omitempty"` } +// IngressURL contains Ingress Object and the URL status+type IngressURL struct {

No because the URL json output needs to be of the type defined by ODO not kubernetes or routes. Using the same struct everywhere will simplify the process later on for json output. Also the ingress/route definition can be converted into the common URL definition used by ODO. You may check the Push() code for some reference.

yangcao77

comment created time in 11 days

issue commentopenshift/odo

Autoselect local port for debug port forwarding

@kadel I think we can close because of https://github.com/openshift/odo/pull/2648

dgolovin

comment created time in 11 days

push eventmik-dass/odo

Stephanie Cao

commit sha 6ed4650137bf9908c55b04283b6b590d607c794a

url list and describe for docker (#3086) * url list and describe Signed-off-by: Stephanie <stephanie.cao@ibm.com> * fix unit test failure, fix locally deleted url cannot get reflected on container * add unit test and integration tests Signed-off-by: Stephanie <stephanie.cao@ibm.com> * add comments Signed-off-by: Stephanie <stephanie.cao@ibm.com> * fix unit test failure Signed-off-by: Stephanie <stephanie.cao@ibm.com> * fix unittest failure Signed-off-by: Stephanie <stephanie.cao@ibm.com> * use log.info instead of fprintf Signed-off-by: Stephanie <stephanie.cao@ibm.com> * fix unittest Signed-off-by: Stephanie <stephanie.cao@ibm.com> * fix test failure due to change of intergration test * fix unit test failure due to api version change

view details

Dharmit Shah

commit sha 6161eaba3e8ec97f0a9dc05dd636a1c8a18e67c3

List services started from operators (#3069) * List services started from operators * Changes as per PR feedback and do not ignore service catalog in experimental mode * Throw error if fail to split CR name into exactly two * Changes related component directory and service catalog This commit ensures that listing services works if tried from outside old component directory. Also removed support for listing service catalog services when experimental mode is enabled. This is not ideal but listing is borked and will be worked upon in separate issues. * Delete vendor files added automatically during rebase * Truncate the time to seconds instead of minutes This minor change had to be done because `odo service list` would show "AGE" of the service as "0s" even though doing `oc get EtcdCluster` would show a few seconds already.

view details

Kamran Shamsi

commit sha 19ed979963e2240ef175e308f82fe5d879e48f9a

Allow a project to be specified in --downloadSource (#3044) * Allow a project to be specified in --downloadSource * Added test for devfile with no projects * Remove interactive mode feature. * Added project name to warning, altered default name * Address comments

view details

John Collier

commit sha d86ef19be180f3a2bd9ff2338ac65600b9d5e7d0

Fix URL create on Docker with no Kube config (#3116) * Fix URL create on Docker with no Kube config Signed-off-by: John Collier <John.J.Collier@ibm.com> * Remove redundant line Signed-off-by: John Collier <John.J.Collier@ibm.com>

view details

push time in 11 days

Pull request review commentopenshift/odo

add state to ingress list and describe

 var _ = Describe("odo devfile url command tests", func() {  			helper.CmdShouldPass("odo", "url", "create", url1, "--port", "3000", "--host", host, "--ingress") -			stdout = helper.CmdShouldFail("odo", "url", "describe", url1)-			helper.MatchAllInOutput(stdout, []string{url1, "exists in local", "odo push"})+			stdout = helper.CmdShouldPass("odo", "url", "describe", url1)+			helper.MatchAllInOutput(stdout, []string{url1 + "." + host, "Not Pushed", "odo push"})  			helper.CmdShouldPass("odo", "push", "--devfile", "devfile.yaml", "--project", namespace)-			helper.WaitForCmdOut("odo", []string{"url", "describe", url1}, 1, false, func(output string) bool {-				if strings.Contains(output, url1) {-					Expect(output).Should(ContainSubstring(url1 + "." + host))-					return true-				}-				return false-			})+			// helper.WaitForCmdOut("odo", []string{"url", "describe", url1}, 1, false, func(output string) bool {+			// 	if strings.Contains(output, url1) {+			// 		Expect(output).Should(ContainSubstring(url1 + "." + host))+			// 		return true+			// 	}+			// 	return false+			// })

comments found

yangcao77

comment created time in 12 days

more