-
Notifications
You must be signed in to change notification settings - Fork 0
Individual Contribution Report 2 | Omer Talip Akalin
Name: Omer Talip Akalin
- We were storing passwords without hash :) #179
- Implementing the task (with unit tests, in a single issue) #195
For this practice app, I've used the Instatus API.
Instatus a service for companies to announce the status of their systems in real time. I've utilized the API to fetch the status of incidents and to update the status of incidents based on a mock company I formed, namely Tcorp
. For this specific purpose, I prepared a template incident and used it only. You can check it here.
The routes used are https://api.instatus.com/v1/{PAGE_ID}/incidents
for fetching incidents and https://api.instatus.com/v2/{PAGE_ID}/incidents/{curr_inc_id}/incident-updates/{template_id}
for updating incidents, where one template is for resolving an incident and the other one is for investigating an incident.
I've configured API functions for a GET
request and a POST
request.
POST
- change_status
: This function is accessed via the route /change_status/<new_status>
and is used to change the status of incident of the application, by setting <new_status> to resolved
or investigating
. Otherwise, it returns an error.
GET
- get_current_status
: This function is accessed via the route /get_current_status
and is used to fetch the current status of incident / page.
To fetch the page, I also added the route of get_status_page
:
get_status_page
: This function is accessed via the route /status_page
and is used to render the status page of our application.
In the unit tests, I've tried to validate my API endpoints. To do so, I used pytest
and unittest
libraries, which are quite handy to use.
I added tests to the endpoint with mocks to:
- Test the status page & title
@patch("app.views.get_current_status")
def test_get_status_page(mock_get_current_status, client):
mock_get_current_status.return_value = MagicMock(
response=[json.dumps({"status": 200, "message": "RESOLVED"})]
)
response = client.get("/status_page")
assert response.status_code == 200
assert b"Current Status: STABLE" in response.data
- Test invalid post request
def test_change_status_invalid(client):
response = client.post("/change_status/invalid")
assert response.json == {"status": 404, "message": "Page not found"}
- Test the investigating case
@patch("app.views.get_all_incidents")
@patch("requests.post")
def test_change_status_investigating(mock_post, mock_get_all_incidents, client):
mock_get_all_incidents.return_value = [{"id": "1", "status": "RESOLVED"}]
mock_post.return_value.status_code = 200
response = client.post("/change_status/investigating")
assert response.json == {
"status": 200,
"message": "Status changed - investigating",
} or response.json == {
"message": "Status INVESTIGATING already",
"status": 200,
}
- Test the resolved case
- Test whether fetching the current status works correctly
TODO
I've handled many pull requests as a reviewer, and I also tried my best to solve problems regarding Git. In these pull requests, I requested many reasonable changes, which's been liked by my teammates.
Here are some of the pull requests that I reviewed:
I also proposed the idea of using Flask as it's easy to onboard. I also showed a couple of tricks for development.
I have joined the implementation & discussion phases two weeks late (due to some personal problems). But I truly believe that I contributed to the team, especially in terms of organization, effectively.
As a person who uses Docker daily, I never knew it was that challenging to build Postgresql to use in the container localhost. We (me and @erkamkavak) have encountered so many interesting bugs that at some point I was proposing to change it to Postgresql.
Other than that, this task made me remember how much I prefer not to write Javascript.
- Ahmet Kudu
- Beyzanur Bektan
- Emre Sin
- Emre Türker
- Erkam Kavak
- Halis Ayberk Erdem
- Hüseyin Çivi
- Ömer Bahadıroğlu
- Ömer Talip Akalın
- Sena Özpınar
- Süleyman Melih Portakal
- Umut Demir
- Muhammet Mustafa Küçük
- Scenarios
- Mockups
- Meeting #1 - 03.03.2023
- Meeting #2 - 10.03.2023
- Meeting #3 - 12.03.2023
- Meeting #4 - 13.03.2023
- Meeting #5 - 19.03.2023
- Meeting #6 - 24.03.2023
- Meeting #7 - 26.03.2023
- Meeting #8 - 30.03.2023
- Meeting #9 - 02.04.2023
- Meeting #10 - 04.04.2023
- Meeting #11 - 05.04.2023
- Meeting #12 - 06.04.2023
- Meeting #13 - 07.04.2023
- Meeting #14 - 08.04.2023
- Meeting #15 - 09.04.2023
- Meeting #16 - 27.04.2023
- Meeting #17 - 30.04.2023
- Meeting #18 - 04.05.2023
- Meeting #19 - 07.05.2023
- Meeting #20 - 11.05.2023
- Meeting #21 - 05.10.2023
- Meeting #22 - 11.10.2023
- Meeting #23 - 16.10.2023
- Meeting #1 - 21.10.2023 (Backend)
- Meeting #1 - 22.10.2023 (Frontend)