From 004f33f60c0e57028f0819a96bd79851574210a9 Mon Sep 17 00:00:00 2001 From: quinqu Date: Fri, 27 Mar 2020 09:40:17 -0700 Subject: [PATCH 1/5] answered individual reflection questions --- individual-reflection.md | 46 ++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/individual-reflection.md b/individual-reflection.md index 603cdeb..d85acfa 100644 --- a/individual-reflection.md +++ b/individual-reflection.md @@ -9,48 +9,52 @@ 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: it gets information from my slack workspace server about the contents of it (users, channels, etc.) 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/conversations.list 1. What are the query params (the additional data sent with the request, besides the verb and the path)? - - Answer: + - Answer: token, endpoint 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 - - # Copy and paste your answer above this comment + query = { + token: ENV["SLACK_TOKEN"] + } + response = HTTParty.get(BASE_URL + "conversations.list", query: query) ``` 1. What does the program do if the response comes back with a status code of 200? - - Answer: + - Answer: it give you back the data of what endpoint you were calling 1. What does the program do if the response does not come back with a status code of 200? - - Answer: + - Answer: it does not give back the information you asked for, for various reasons ### `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: post transfers data to wherever you want to end it to 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, text, channel 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 - - # Copy and paste your answer above this comment + query = { + token: ENV["SLACK_TOKEN"], + text: message, + channel: @slack_id + } + response = HTTParty.post(BASE_URL + "chat.postMessage", query: query) ``` 1. What does the program do if the response comes back with a status code of 200? - - Answer: + - Answer: it means it has successfully sent the data 1. What does the program do if the response does not come back with a status code of 200? - - Answer: + - Answer: it does not send the data because there is an error ## Request & Response Cycle @@ -62,11 +66,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: to list the channels of said workspace 1. Who is the client? - - Answer: + - Answer: Grace 1. Who is the server? - - Answer: + - Answer: Slack API ## Part 2: Optional Refactoring From ed6286743c25f8f975b5c02d3bf485700e09bb92 Mon Sep 17 00:00:00 2001 From: quinqu Date: Fri, 27 Mar 2020 09:41:47 -0700 Subject: [PATCH 2/5] fixed ruby code indentation --- individual-reflection.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/individual-reflection.md b/individual-reflection.md index d85acfa..fbb91cd 100644 --- a/individual-reflection.md +++ b/individual-reflection.md @@ -19,10 +19,10 @@ Answer the following comprehension questions **within this file.** Write your an 1. What is the syntax used to make this request? (Copy and paste a code snippet here) - Answer: ```ruby - query = { - token: ENV["SLACK_TOKEN"] - } - response = HTTParty.get(BASE_URL + "conversations.list", query: query) + query = { + token: ENV["SLACK_TOKEN"] + } + response = HTTParty.get(BASE_URL + "conversations.list", query: query) ``` 1. What does the program do if the response comes back with a status code of 200? - Answer: it give you back the data of what endpoint you were calling @@ -44,12 +44,12 @@ If your project does not make a POST request, read through Wave 3 on the origina 1. What is the syntax used to make this request? (Copy and paste a code snippet here) - Answer: ```ruby - query = { - token: ENV["SLACK_TOKEN"], - text: message, - channel: @slack_id - } - response = HTTParty.post(BASE_URL + "chat.postMessage", query: query) + query = { + token: ENV["SLACK_TOKEN"], + text: message, + channel: @slack_id + } + response = HTTParty.post(BASE_URL + "chat.postMessage", query: query) ``` 1. What does the program do if the response comes back with a status code of 200? - Answer: it means it has successfully sent the data From e2be48fd8a68f5b3fc1b8ae116a73a57c2d9ee0e Mon Sep 17 00:00:00 2001 From: quinqu Date: Sun, 29 Mar 2020 12:46:33 -0700 Subject: [PATCH 3/5] explaied which part of my code I refactores --- individual-reflection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/individual-reflection.md b/individual-reflection.md index fbb91cd..2c17778 100644 --- a/individual-reflection.md +++ b/individual-reflection.md @@ -68,7 +68,7 @@ Based on the project requirements, when Grace enters "list channels," 1. What is the request being made in the program? - Answer: to list the channels of said workspace 1. Who is the client? - - Answer: Grace + - Answer: the computer 1. Who is the server? - Answer: Slack API @@ -84,4 +84,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 added the table print functionality. I tried adding "real" error messages for invalid inputs, however I was afraid this would mess up all of my testing and put me over the 3 hour mark From 750e30b880296ffe93e7631a34371513b36b7934 Mon Sep 17 00:00:00 2001 From: Angela Nguyen Date: Sun, 29 Mar 2020 20:54:32 -0700 Subject: [PATCH 4/5] Angela completed code review for Quin --- feedback.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/feedback.md b/feedback.md index f90b999..e0f61a7 100644 --- a/feedback.md +++ b/feedback.md @@ -1,8 +1,8 @@ # Feedback Rubric -- Student Being Reviewed: -- Reviewer: -- Classroom: +- Student Being Reviewed: Quin +- Reviewer: Angela +- 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/no + "test_helper.rb" contains an API token on line 37, where the token is passed as a parameter to ".filter_sensitive_data". This means the token gets outputted inside all the cassettes as well. You can hide the API token by replacing it with a different substitution string when .filter_sensitive_data is called. More details on this syntax here. @@ -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 + All pieces of code that make an API call are covered in the test files, but the classes themselves don't currently check for errors @@ -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 + ✅ Nice job! parent class Recipient is particularly clean. I like that the placeholder methods have a concise #override comment, which made it really clear that they're implemented in children classes @@ -51,7 +51,7 @@ - yes/no + ✅ @@ -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 + ✅ @@ -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 + ✅ @@ -80,7 +80,7 @@ 7. Practices writing tests. (The User, Channel, and Workspace classes have unit tests.) - yes/no + ✅ @@ -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 + ✅ @@ -100,7 +100,7 @@ 9. Practices git with at least 15 small commits and meaningful commit messages - yes/no + ✅ "This branch is 14 commits ahead of Ada-C13:master." - really close, try to commit more! @@ -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 + ✅ @@ -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 + ✅ @@ -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 + ✅ @@ -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 + ✅ From 6133302e62fdd166e5b3aeb002a911cbed5aa108 Mon Sep 17 00:00:00 2001 From: Angela Date: Sun, 29 Mar 2020 20:58:15 -0700 Subject: [PATCH 5/5] fixed my broken hyperlink --- feedback.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feedback.md b/feedback.md index e0f61a7..2f49e78 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.) - "test_helper.rb" contains an API token on line 37, where the token is passed as a parameter to ".filter_sensitive_data". This means the token gets outputted inside all the cassettes as well. You can hide the API token by replacing it with a different substitution string when .filter_sensitive_data is called. More details on this syntax here. + "test_helper.rb" contains an API token on line 37, where the token is passed as a parameter to ".filter_sensitive_data". This means the token gets outputted inside all the cassettes as well. You can hide the API token by replacing it with a different substitution string when .filter_sensitive_data is called. More details on this syntax here.