Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions feedback.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Feedback Rubric

- Student Being Reviewed:
- Reviewer:
- Classroom:
- Student Being Reviewed: Leah
- Reviewer: Diana
- Classroom: Space

## Manual App Testing

Expand All @@ -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.)
</td>
<td>
yes/no
yes
</td>
</tr>

Expand All @@ -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.)
</td>
<td>
yes/no
yes
</td>
</tr>

Expand All @@ -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.
</td>
<td>
yes/no
yes
</td>
</tr>

Expand All @@ -51,7 +51,7 @@
</ul>
</td>
<td>
yes/no
yes
</td>
</tr>

Expand All @@ -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.)
</td>
<td>
yes/no
yes
</td>
</tr>

Expand All @@ -70,7 +70,7 @@
6. Practices best practices for testing. (The project has and uses VCR mocking when running tests, and can run offline.)
</td>
<td>
yes/no
yes
</td>
</tr>

Expand All @@ -80,7 +80,7 @@
7. Practices writing tests. (The User, Channel, and Workspace classes have unit tests.)
</td>
<td>
yes/no
yes, clear, easy to read, and covers all edge and nominal cases
</td>
</tr>

Expand All @@ -90,7 +90,7 @@
8. There are also tests for sending messages (the location of these tests may differ, but is likely in Recipient)
</td>
<td>
yes/no
yes, very thorough testing, great work!
</td>
</tr>

Expand All @@ -100,7 +100,7 @@
9. Practices git with at least 15 small commits and meaningful commit messages
</td>
<td>
yes/no
no, 14 commits (very close!), commit messages are granular and clear
</td>
</tr>
</table>
Expand All @@ -118,31 +118,31 @@
<td>1. As a user of the CLI program, I can <strong>list</strong> users and channels with the commands <code>list users</code> and <code>list channels</code>
</td>
<td>
yes/no
yes
</td>

</tr>
<tr>
<td>2. As a user of the CLI program, I can <strong>select</strong> users and channels with the commands <code>select user</code> and <code>select channel</code>
</td>
<td>
yes/no
yes
</td>
</tr>

<tr>
<td>3. As a user of the CLI program, I can show the details of a selected user or channel with the command <code>details</code>
</td>
<td>
yes/no
yes
</td>
</tr>

<tr>
<td>4. As a user of the CLI program, when I input something inappropriately, the program runs without crashing. Example commands to try are <code>do_something</code>, or <code>select user</code> followed by <code>Mr. Fakename</code>
</td>
<td>
yes/no
yes
</td>
</tr>
</table>
Expand Down
59 changes: 41 additions & 18 deletions individual-reflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,71 @@ 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: My recipient class contains a method with a GET request - this method is invoked in channel and user methods to list all channels or all users. On a high level, this method constructs the HTTParty GET Request using the query parameters outlined by the API to list the users or channels of a particular workspace; so when channel makes the request, it uses the sub-URL specific to the channel request, and when user makes the request, it uses the sub-URL specific to the user request.

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: In Channel: https://slack.com/api/channels.list" ; in User: 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: The parameters are the sub_url (channels.list or users.list) and Slack 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

def self.get_api_data(sub_url)
url = "https://slack.com/api/#{sub_url}?token=#{SLACK_TOKEN}"

response = HTTParty.get(url)

if response["ok"] != true || response.code != 200
raise SlackAPIError.new("There was an error retrieving information from the Slack API: #{response["error"]}")
end

return response
end

# 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: If the code is 200 AND the "ok" message is true, then it returns the response
1. What does the program do if the response does not come back with a status code of 200?
- Answer:
- Answer: If the code is NOT 200 or the "ok" message is false, then it throws a Slack API Error

### `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: In recipient, the method send_message makes a POST request to the Slack API server. This method constructs the URL required by the API to post a message to a channel or a user.
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: slack token, channel, and text/message
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

def send_message(message)
url = "https://slack.com/api/chat.postMessage?token=#{SLACK_TOKEN}&channel=#{@slack_id}&text=#{message}"

response = HTTParty.post(url)

if response["ok"] != true || response.code != 200
raise SlackAPIError.new(("There was an error posting this message: #{response["error"]}"))
else puts "Your message was sent successfully!"
end

return response
end
# 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: If the response code is 200 AND the "ok" message is true, the method indicates the message was successfully posted and returns the response
1. What does the program do if the response does not come back with a status code of 200?
- Answer:
- Answer: If the response code is 200 AND the "ok" message is false OR if the response code is NOT 200, the program throws a Slack API Error

## Request & Response Cycle

Expand All @@ -62,11 +85,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 is a GET request
1. Who is the client?
- Answer:
- Answer: The client is Grace's computer
1. Who is the server?
- Answer:
- Answer: The server is the Slack API server

## Part 2: Optional Refactoring

Expand All @@ -80,4 +103,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 make changes.