From 9ff7993f9c2459f52f2fea4da2989c78d243163e Mon Sep 17 00:00:00 2001 From: Parth Shah Date: Fri, 16 Aug 2019 09:20:47 -0700 Subject: [PATCH 1/6] added validations to every step --- config.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/config.yml b/config.yml index db9b17f..51d4ddc 100644 --- a/config.yml +++ b/config.yml @@ -53,6 +53,17 @@ steps: - type: getPullRequest pullRequest: Changes action_id: metaPR2 + - type: getFileContents + action_id: fileContents + filename: 'src/App.jsx' + - type: gate + left: '/^\s*<\s*h3\s*className\s*=\s*"\s*Box-title\s*d-flex\s*flex-justify-center\s*"\s*>\s*GradeBook\s*<\s*\/\s*h3\s*>/g' + operator: test + right: '%actions.fileContents%' + else: + - type: respond + with: bad-uncomment.md + issue: Changes - type: respond with: 02-props.md issue: Changes @@ -74,6 +85,17 @@ steps: - type: getPullRequest pullRequest: Changes action_id: metaPR2 + - type: getFileContents + action_id: fileContents + filename: 'src/App.jsx' + - type: gate + left: '/^\s*import\s*List\s*from\s*"\s*\.\/List\s*"\s*;\s*/g' + operator: test + right: '%actions.fileContents%' + else: + - type: respond + with: bad-uncomment.md + issue: Changes - type: createPullRequestComment body: uncomment-assignments-activity.md file: src/App.jsx @@ -121,6 +143,17 @@ steps: - type: getPullRequest pullRequest: Changes action_id: metaPR2 + - type: getFileContents + action_id: fileContents + filename: 'src/List.jsx' + - type: gate + left: '/^\s*>\s*{\s*this\.props\.title\s*}\s*<\s*/g' + operator: test + right: '%actions.fileContents%' + else: + - type: respond + with: bad-uncomment.md + issue: Changes - type: respond with: 03-state.md issue: Changes @@ -142,6 +175,17 @@ steps: - type: getPullRequest pullRequest: Changes action_id: metaPR2 + - type: getFileContents + action_id: fileContents + filename: 'src/List.jsx' + - type: gate + left: '/^\s*students\s*:\s*\[\s*\]\s*,\s*/g' + operator: test + right: '%actions.fileContents%' + else: + - type: respond + with: bad-uncomment.md + issue: Changes - type: createPullRequestComment body: explaining-this-state-activity.md file: src/App.jsx @@ -231,6 +275,17 @@ steps: - type: getPullRequest pullRequest: Changes action_id: metaPR2 + - type: getFileContents + action_id: fileContents + filename: 'src/App.jsx' + - type: gate + left: '/^\s*placeholder\s*=\s*"Add\sStudent\.\.\."\s*\n\s*currList\s*=\s*{\s*this\.state\.students\s*}\n\s*addFunction\s*=\s*{\s*this\.addStudent\s*}\s*\n/gm' + operator: test + right: '%actions.fileContents%' + else: + - type: respond + with: bad-uncomment.md + issue: Changes - type: createPullRequestComment body: uncomment-grades-activity.md file: src/App.jsx From a56f6347205a8729b4c2f852afe6419fd779e394 Mon Sep 17 00:00:00 2001 From: Parth Shah Date: Fri, 16 Aug 2019 09:37:51 -0700 Subject: [PATCH 2/6] added multiline --- config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index 51d4ddc..23166e3 100644 --- a/config.yml +++ b/config.yml @@ -57,7 +57,7 @@ steps: action_id: fileContents filename: 'src/App.jsx' - type: gate - left: '/^\s*<\s*h3\s*className\s*=\s*"\s*Box-title\s*d-flex\s*flex-justify-center\s*"\s*>\s*GradeBook\s*<\s*\/\s*h3\s*>/g' + left: '/^\s*<\s*h3\s*className\s*=\s*"\s*Box-title\s*d-flex\s*flex-justify-center\s*"\s*>\s*GradeBook\s*<\s*\/\s*h3\s*>/gm' operator: test right: '%actions.fileContents%' else: @@ -89,7 +89,7 @@ steps: action_id: fileContents filename: 'src/App.jsx' - type: gate - left: '/^\s*import\s*List\s*from\s*"\s*\.\/List\s*"\s*;\s*/g' + left: '/^\s*import\s*List\s*from\s*"\s*\.\/List\s*"\s*;\s*/gm' operator: test right: '%actions.fileContents%' else: @@ -147,7 +147,7 @@ steps: action_id: fileContents filename: 'src/List.jsx' - type: gate - left: '/^\s*>\s*{\s*this\.props\.title\s*}\s*<\s*/g' + left: '/^\s*>\s*{\s*this\.props\.title\s*}\s*<\s*/gm' operator: test right: '%actions.fileContents%' else: @@ -179,7 +179,7 @@ steps: action_id: fileContents filename: 'src/List.jsx' - type: gate - left: '/^\s*students\s*:\s*\[\s*\]\s*,\s*/g' + left: '/^\s*students\s*:\s*\[\s*\]\s*,\s*/gm' operator: test right: '%actions.fileContents%' else: From ec18543ebc700c73fbe1a527967f82aa30bed245 Mon Sep 17 00:00:00 2001 From: Parth Shah Date: Fri, 16 Aug 2019 09:54:16 -0700 Subject: [PATCH 3/6] fixed prop validation --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 23166e3..d831aa7 100644 --- a/config.yml +++ b/config.yml @@ -147,7 +147,7 @@ steps: action_id: fileContents filename: 'src/List.jsx' - type: gate - left: '/^\s*>\s*{\s*this\.props\.title\s*}\s*<\s*/gm' + left: '/>\s*{\s*this\.props\.title\s*}\s*<\s*/gm' operator: test right: '%actions.fileContents%' else: From 478c3105aa4314db82596af568cc47b0980a993e Mon Sep 17 00:00:00 2001 From: Parth Shah Date: Fri, 16 Aug 2019 10:23:37 -0700 Subject: [PATCH 4/6] add validations --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index d831aa7..ce87aeb 100644 --- a/config.yml +++ b/config.yml @@ -179,7 +179,7 @@ steps: action_id: fileContents filename: 'src/List.jsx' - type: gate - left: '/^\s*students\s*:\s*\[\s*\]\s*,\s*/gm' + left: '/\s*students\s*:\s*\[\s*\]\s*,\s*/gm' operator: test right: '%actions.fileContents%' else: @@ -279,7 +279,7 @@ steps: action_id: fileContents filename: 'src/App.jsx' - type: gate - left: '/^\s*placeholder\s*=\s*"Add\sStudent\.\.\."\s*\n\s*currList\s*=\s*{\s*this\.state\.students\s*}\n\s*addFunction\s*=\s*{\s*this\.addStudent\s*}\s*\n/gm' + left: '/\s*placeholder\s*=\s*"Add\sStudent\.\.\."\s*\n\s*currList\s*=\s*{\s*this\.state\.students\s*}\n\s*addFunction\s*=\s*{\s*this\.addStudent\s*}\s*\n/gm' operator: test right: '%actions.fileContents%' else: From 06496546104fba9228309fa53f9dfa1e1fb86cce Mon Sep 17 00:00:00 2001 From: Parth Shah Date: Fri, 16 Aug 2019 11:23:05 -0700 Subject: [PATCH 5/6] added correct responses for validations --- config.yml | 10 +++++----- responses/bad-header.md | 3 +++ responses/bad-import.md | 3 +++ responses/bad-prop.md | 3 +++ responses/bad-replace.md | 3 +++ responses/bad-state.md | 3 +++ 6 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 responses/bad-header.md create mode 100644 responses/bad-import.md create mode 100644 responses/bad-prop.md create mode 100644 responses/bad-replace.md create mode 100644 responses/bad-state.md diff --git a/config.yml b/config.yml index ce87aeb..13c0c06 100644 --- a/config.yml +++ b/config.yml @@ -62,7 +62,7 @@ steps: right: '%actions.fileContents%' else: - type: respond - with: bad-uncomment.md + with: bad-header.md issue: Changes - type: respond with: 02-props.md @@ -94,7 +94,7 @@ steps: right: '%actions.fileContents%' else: - type: respond - with: bad-uncomment.md + with: bad-import.md issue: Changes - type: createPullRequestComment body: uncomment-assignments-activity.md @@ -152,7 +152,7 @@ steps: right: '%actions.fileContents%' else: - type: respond - with: bad-uncomment.md + with: bad-prop.md issue: Changes - type: respond with: 03-state.md @@ -184,7 +184,7 @@ steps: right: '%actions.fileContents%' else: - type: respond - with: bad-uncomment.md + with: bad-state.md issue: Changes - type: createPullRequestComment body: explaining-this-state-activity.md @@ -284,7 +284,7 @@ steps: right: '%actions.fileContents%' else: - type: respond - with: bad-uncomment.md + with: bad-replace.md issue: Changes - type: createPullRequestComment body: uncomment-grades-activity.md diff --git a/responses/bad-header.md b/responses/bad-header.md new file mode 100644 index 0000000..b422fd5 --- /dev/null +++ b/responses/bad-header.md @@ -0,0 +1,3 @@ +Looks you did not correctly add an `h3` component in the right place in `src/App.jsx`. + +Try again! \ No newline at end of file diff --git a/responses/bad-import.md b/responses/bad-import.md new file mode 100644 index 0000000..c53666e --- /dev/null +++ b/responses/bad-import.md @@ -0,0 +1,3 @@ +Looks you did not import the `List` component into `App`. + +Try again! \ No newline at end of file diff --git a/responses/bad-prop.md b/responses/bad-prop.md new file mode 100644 index 0000000..6f3b708 --- /dev/null +++ b/responses/bad-prop.md @@ -0,0 +1,3 @@ +Looks you did not replace the title with a prop in the correct place in `src/List.jsx` + +Try again! \ No newline at end of file diff --git a/responses/bad-replace.md b/responses/bad-replace.md new file mode 100644 index 0000000..8a65098 --- /dev/null +++ b/responses/bad-replace.md @@ -0,0 +1,3 @@ +Looks you did not replace the props for student rendering. + +Try again! \ No newline at end of file diff --git a/responses/bad-state.md b/responses/bad-state.md new file mode 100644 index 0000000..a558fb5 --- /dev/null +++ b/responses/bad-state.md @@ -0,0 +1,3 @@ +Looks you did not add a `students` state variable. + +Try again! \ No newline at end of file From 5745f1d40fabeb41b7bf64170175219f800dce7f Mon Sep 17 00:00:00 2001 From: Parth Shah Date: Fri, 16 Aug 2019 11:39:04 -0700 Subject: [PATCH 6/6] minor fixes --- config.yml | 2 +- responses/bad-function.md | 2 +- responses/bad-header.md | 2 +- responses/bad-import.md | 2 +- responses/bad-prop.md | 2 +- responses/bad-replace.md | 2 +- responses/bad-state.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.yml b/config.yml index 13c0c06..a67524b 100644 --- a/config.yml +++ b/config.yml @@ -177,7 +177,7 @@ steps: action_id: metaPR2 - type: getFileContents action_id: fileContents - filename: 'src/List.jsx' + filename: 'src/App.jsx' - type: gate left: '/\s*students\s*:\s*\[\s*\]\s*,\s*/gm' operator: test diff --git a/responses/bad-function.md b/responses/bad-function.md index b0cc95c..439bce5 100644 --- a/responses/bad-function.md +++ b/responses/bad-function.md @@ -1,3 +1,3 @@ -Looks you did not create an `addStudent` function with the parameter: `studentName`. +Looks like you did not create an `addStudent` function with the parameter: `studentName`. Try again! \ No newline at end of file diff --git a/responses/bad-header.md b/responses/bad-header.md index b422fd5..fbfc680 100644 --- a/responses/bad-header.md +++ b/responses/bad-header.md @@ -1,3 +1,3 @@ -Looks you did not correctly add an `h3` component in the right place in `src/App.jsx`. +Looks like you did not correctly add an `h3` component in the right place in `src/App.jsx`. Try again! \ No newline at end of file diff --git a/responses/bad-import.md b/responses/bad-import.md index c53666e..5619803 100644 --- a/responses/bad-import.md +++ b/responses/bad-import.md @@ -1,3 +1,3 @@ -Looks you did not import the `List` component into `App`. +Looks like you did not import the `List` component into `App`. Try again! \ No newline at end of file diff --git a/responses/bad-prop.md b/responses/bad-prop.md index 6f3b708..c3ef899 100644 --- a/responses/bad-prop.md +++ b/responses/bad-prop.md @@ -1,3 +1,3 @@ -Looks you did not replace the title with a prop in the correct place in `src/List.jsx` +Looks like you did not replace the title with a prop in the correct place in `src/List.jsx` Try again! \ No newline at end of file diff --git a/responses/bad-replace.md b/responses/bad-replace.md index 8a65098..f2a141f 100644 --- a/responses/bad-replace.md +++ b/responses/bad-replace.md @@ -1,3 +1,3 @@ -Looks you did not replace the props for student rendering. +Looks like you did not replace the props for student rendering. Try again! \ No newline at end of file diff --git a/responses/bad-state.md b/responses/bad-state.md index a558fb5..cf2422d 100644 --- a/responses/bad-state.md +++ b/responses/bad-state.md @@ -1,3 +1,3 @@ -Looks you did not add a `students` state variable. +Looks like you did not add a `students` state variable. Try again! \ No newline at end of file