From d638303704e9b3ba8726da8a6c2dfd7e601b49e8 Mon Sep 17 00:00:00 2001 From: Angela Nguyen Date: Wed, 25 Mar 2020 00:15:49 -0700 Subject: [PATCH 1/4] responded to individual portion --- individual-reflection.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/individual-reflection.md b/individual-reflection.md index 603cdeb..8a30b7a 100644 --- a/individual-reflection.md +++ b/individual-reflection.md @@ -9,48 +9,48 @@ Answer the following comprehension questions **within this file.** Write your an ### `GET` Request Review 1. Describe a GET request that your project makes, and the high-level description of what it does - - Answer: + - Answer: the `User.rb` class has a method `.get_all` that makes a GET request to the Slack API with the endpoint `users.list?`. This request returns a response that contains a list of users in a Slack workspace. 1. What is the verb of this request? - - Answer: + - Answer: GET 1. What is the path (or the URL, or endpoint) of this request? - - Answer: + - Answer: https://slack.com/api/users.list 1. What are the query params (the additional data sent with the request, besides the verb and the path)? - - Answer: + - Answer: `token` 1. What is the syntax used to make this request? (Copy and paste a code snippet here) - Answer: ```ruby # Copy and paste your answer below this comment - + HTTParty.get("https://slack.com/api/users.list?", query: { token: SLACK_TOKEN, }) # Copy and paste your answer above this comment ``` 1. What does the program do if the response comes back with a status code of 200? - - Answer: + - Answer: The program doesn't check for a status code right now, it just checks if the response is ok 1. What does the program do if the response does not come back with a status code of 200? - - Answer: + - Answer: The program doesn't check for a status code right now, it just checks if the response is ok ### `POST` Request Review If your project does not make a POST request, read through Wave 3 on the original Slack CLI, and research and answer questions 1, 2, 3, 4, 6, and 7. 1. Describe a POST request that your project makes, and the high-level description of what it does - - Answer: + - Answer: the `Conversations.rb` class has a method `post.message` that makes a POST request to the Slack API with the endpoint `chat.postMessage`. This request posts a message to the designated Slack conversation. 1. What is the verb of this request? - - Answer: + - Answer: POST 1. What is the path (or the URL, or endpoint) of this request? - - Answer: + - Answer: https://slack.com/api/chat.postMessage 1. What are the query params (the additional data sent with the request, besides the verb and the path)? - - Answer: + - Answer: token, channel, text 1. What is the syntax used to make this request? (Copy and paste a code snippet here) - Answer: ```ruby # Copy and paste your answer below this comment - + HTTParty.post("https://slack.com/api/chat.postMessage", query: { token: SLACK_TOKEN, channel: id, text: message}) # Copy and paste your answer above this comment ``` 1. What does the program do if the response comes back with a status code of 200? - - Answer: + - Answer: The program doesn't check for a status code right now, it just checks if the response is ok 1. What does the program do if the response does not come back with a status code of 200? - - Answer: + - Answer: The program doesn't check for a status code right now, it just checks if the response is ok ## Request & Response Cycle @@ -62,11 +62,11 @@ There are two actors: Based on the project requirements, when Grace enters "list channels," 1. What is the request being made in the program? - - Answer: + - Answer: the request being made is a GET request to the Slack API 1. Who is the client? - - Answer: + - Answer: the computer that runs slack.rb 1. Who is the server? - - Answer: + - Answer: Slack API ## Part 2: Optional Refactoring @@ -80,4 +80,4 @@ If your reflection inspired you to make minimal changes to your Slack CLI implem ### Describe your optional Slack CLI changes here -Answer: +Answer: I did not refactor after completing my reflection From 1f3de550d39eae0cde2983d895eb4b7f57b2803b Mon Sep 17 00:00:00 2001 From: quinqu Date: Sun, 29 Mar 2020 12:01:20 -0700 Subject: [PATCH 2/4] finished peer review --- feedback.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/feedback.md b/feedback.md index f90b999..99861b8 100644 --- a/feedback.md +++ b/feedback.md @@ -17,7 +17,7 @@ 1. Practices best practices working with APIs. (The .env is not checked into git, and no API token was directly used in the Ruby code without ENV.) - yes/no + yes @@ -26,7 +26,7 @@ 2. Practices error handling with APIs. (For all pieces of code that make an API call, it handles API requests that come back with errors/error status codes appropriately.) - yes/no + yes @@ -35,7 +35,7 @@ 3. Implements inheritance and inheritance idioms. There is a Recipient class. User and Channel inherit from Recipient. In Recipient, there are appropriate methods defined that are used in both User and Channel. Some may be implemented. Some may be template methods. - yes/no + yes @@ -51,7 +51,7 @@ - yes/no + yes @@ -60,7 +60,7 @@ 5. Practices instance methods vs. class methods appropriately. (The methods to list all Channels or Users is a class method within those respective classes.) - yes/no + yes @@ -70,7 +70,7 @@ 6. Practices best practices for testing. (The project has and uses VCR mocking when running tests, and can run offline.) - yes/no + yes @@ -80,7 +80,7 @@ 7. Practices writing tests. (The User, Channel, and Workspace classes have unit tests.) - yes/no + yes @@ -90,7 +90,7 @@ 8. There are also tests for sending messages (the location of these tests may differ, but is likely in Recipient) - yes/no + yes @@ -100,7 +100,7 @@ 9. Practices git with at least 15 small commits and meaningful commit messages - yes/no + yes @@ -118,7 +118,7 @@ 1. As a user of the CLI program, I can list users and channels with the commands list users and list channels - yes/no + yes @@ -126,7 +126,7 @@ 2. As a user of the CLI program, I can select users and channels with the commands select user and select channel - yes/no + yes @@ -134,7 +134,7 @@ 3. As a user of the CLI program, I can show the details of a selected user or channel with the command details - yes/no + yes @@ -142,7 +142,7 @@ 4. As a user of the CLI program, when I input something inappropriately, the program runs without crashing. Example commands to try are do_something, or select user followed by Mr. Fakename - yes/no + yes From af7bd156877ac53b65c385ed9c4066a42525d9d9 Mon Sep 17 00:00:00 2001 From: Angela Nguyen Date: Sun, 29 Mar 2020 21:20:28 -0700 Subject: [PATCH 3/4] added to-do items in my reflection --- individual-reflection.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/individual-reflection.md b/individual-reflection.md index 8a30b7a..b4ad954 100644 --- a/individual-reflection.md +++ b/individual-reflection.md @@ -80,4 +80,10 @@ If your reflection inspired you to make minimal changes to your Slack CLI implem ### Describe your optional Slack CLI changes here -Answer: I did not refactor after completing my reflection +Answer: I did not refactor after completing my reflection. Future to-do items I'd consider: +1. add additional testing (coverage is currently 80%): + * posting messages + * testing for failure cases when endpoints respond with NOT OK +2. refactor my parent Conversations class so that it implements self.list_all, because currently it's implemented similarly inside both of its children classes +3. change the user attribute on Direct Message conversations to store User objects instead of id strings. This was my original motivation for separating Users from Direct Messages but I didn't have time to complete this implementation +4. refactor slack.rb and workspace.rb so that workspace does the majority of the user input validation. Currently all validation is done from the CLI driver, mainly because the driver is doing some flamboyant code gymnastics to number each User/Channel item as they're printed (which wasn't in Workspace.rb's job description, as per my initial design). However, I could separate the check for existance of an ID out of the driver code and make it a function in Workspace.rb From 7e9b8ca1d04369d9bcc5c6b1306c8926805901ef Mon Sep 17 00:00:00 2001 From: quinqu Date: Sun, 29 Mar 2020 21:42:50 -0700 Subject: [PATCH 4/4] added more comments --- feedback.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/feedback.md b/feedback.md index 99861b8..d6e6911 100644 --- a/feedback.md +++ b/feedback.md @@ -1,8 +1,8 @@ # Feedback Rubric -- Student Being Reviewed: -- Reviewer: -- Classroom: +- Student Being Reviewed: Angela +- Reviewer: Quin +- Classroom: Time ## Manual App Testing @@ -17,7 +17,7 @@ 1. Practices best practices working with APIs. (The .env is not checked into git, and no API token was directly used in the Ruby code without ENV.) - yes + Yes, you have your .env in your project root folder and .env in your .gitignore. Well done! @@ -26,7 +26,7 @@ 2. Practices error handling with APIs. (For all pieces of code that make an API call, it handles API requests that come back with errors/error status codes appropriately.) - yes + Yes, you did especially well on this! Nice work on making the custom error class! @@ -35,7 +35,7 @@ 3. Implements inheritance and inheritance idioms. There is a Recipient class. User and Channel inherit from Recipient. In Recipient, there are appropriate methods defined that are used in both User and Channel. Some may be implemented. Some may be template methods. - yes + Yes, not exactly this type of inheritence, however your program works and the classes flow well together. @@ -51,7 +51,7 @@ - yes + Yes, all your methods are short and sweet. @@ -60,7 +60,7 @@ 5. Practices instance methods vs. class methods appropriately. (The methods to list all Channels or Users is a class method within those respective classes.) - yes + Yes, I believe you used them all correctly! I see you have a .list_all and .get_all, I am a little confused as to why there are 2 similar class methods, but nicely written and concise! @@ -80,7 +80,7 @@ 7. Practices writing tests. (The User, Channel, and Workspace classes have unit tests.) - yes + Yes @@ -100,7 +100,7 @@ 9. Practices git with at least 15 small commits and meaningful commit messages - yes + Yes, great git hygiene! :)