Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Conversation

@r-52
Copy link
Contributor

@r-52 r-52 commented Dec 12, 2018

the "old" status page https://status.github.com is no deprecated and GitHub switched to a statuspage.io implementation with https://githubstatus.com. The page mentions the deprecation.

This PR switches the url to the new status page and changes the status API model for the new REST- response.

The new API replaced the good state with the state none. And has more fields, that are probably
not relevant for the App.

Previous response:

{"status":"good","last_updated":"2018-12-06T17:09:57Z"}

New response:

{"page":{"id":"kctbh9vrtdwd","name":"GitHub","url":"https://www.githubstatus.com","time_zone":"Etc/UTC","updated_at":"2018-12-12T05:38:30.535Z"},"status":{"indicator":"none","description":"All Systems Operational"}}

New page in SafariVC:
image

fixes: #2546

@r-52 r-52 force-pushed the r-new-status-page branch from d664732 to 29f2bf9 Compare December 12, 2018 13:12
the "old" status page https://status.github.com is no deprecated and
GitHub switched to a statuspage.io implementation with
https://githubstatus.com. The page mentions the deprecation.

This PR switches the url to the new status page and changes the status
API model for the new REST-response.

The new API replaced the `good` state with the state `none`. And has more
fields, that are probably not relevant for the App.
@r-52 r-52 force-pushed the r-new-status-page branch from 29f2bf9 to 48701b9 Compare December 12, 2018 13:14
switch response.data.status.indicator {
case .none:
text = response.data.status.description
color = Styles.Colors.Green.medium.color
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add a computed property on StatusType called color and this switch could be removed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided not to do this as this would need StatusType to import UIKit, which feels unnecessary, and a weird dependency in the networking layer.

text = NSLocalizedString("Good", comment: "")
switch response.data.status.indicator {
case .none:
text = response.data.status.description
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be able to be pulled out of the switch (DRY).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for this mistake! Will fix it and thank you for the review!

color = Styles.Colors.Red.medium.color
case .critical:
text = response.data.status.description
color = Styles.Colors.Red.medium.color
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we introduce / can we use another color to disambiguate between .major and .critical?

public let indicator: StatusType
public let description: String

public enum StatusType: String,Codable, CodingKey {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nit: no space after String,

public let indicator: StatusType
public let description: String

public enum StatusType: String,Codable, CodingKey {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename the case none to case normal or similar? .none can silently be interpreted as Optional.none when working with an optional enum of this type, which can be hard to debug. Would require manually handling the decoding though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided against changing this for now as it would also "change" the API, which might be confusing, and certainly would be more confusing in most cases.

@BasThomas
Copy link
Collaborator

Nice work @romankl!

@Huddie Huddie changed the title switch from the now deprecated to the new statuspage switch from the now deprecated to the new status page Dec 13, 2018
@Huddie Huddie added the 💤 awaiting review Pull Request is awaiting code reviews label Dec 16, 2018
@Sherlouk Sherlouk mentioned this pull request Dec 17, 2018
Copy link
Member

@rnystrom rnystrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sending back re: comments

@Sherlouk Sherlouk added 😴 awaiting changes Changes requested, waiting on author to update and removed 💤 awaiting review Pull Request is awaiting code reviews labels Jan 2, 2019
@BasThomas
Copy link
Collaborator

Hi @romankl, do you want to take another look at the comments? Can I help out?

@BasThomas
Copy link
Collaborator

From @zhongwuzw:

https://github.com/GitHawkApp/GitHawk/pull/2547/files#diff-9f0bae268086ea5dfc986d1a77f28abaL147, change githubstatus.com to www.githubstatus.com may more better, can reduce HTTP redirect.

@Sherlouk
Copy link
Member

Sherlouk commented Mar 2, 2019

@romankl Any interest in finishing this little bit of work of as per the above remarks?

@rnystrom @BasThomas Just as a reminder, the deadline is moving in quickly (current page shuts down on Monday)

@Huddie
Copy link
Collaborator

Huddie commented Mar 8, 2019

@BasThomas @Sherlouk What’s left on this? Just www?

Sent with GitHawk

@BasThomas
Copy link
Collaborator

That and some more comments. Will work on that this weekend and merge.

Sent with GitHawk

@Huddie
Copy link
Collaborator

Huddie commented Mar 8, 2019

Okay haha, I was gonna offer the same. Just to get it out. Enjoy!

Sent with GitHawk

@BasThomas BasThomas dismissed rnystrom’s stale review March 9, 2019 12:09

Changes addressed :)

@BasThomas
Copy link
Collaborator

Changes addressed, thanks so much for the initial push @romankl!

@BasThomas BasThomas merged commit c527846 into GitHawkApp:master Mar 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

😴 awaiting changes Changes requested, waiting on author to update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecated status page

7 participants