daneden / Zeitgeist

👁 An iOS app for keeping an eye on your Vercel deployments
http://zeitgeist.daneden.me
Apache License 2.0
196 stars 8 forks source link

iOS crash due to invalid Gitlab commit structure #25

Closed wzulfikar closed 3 years ago

wzulfikar commented 3 years ago

If one of the deployment is from Gitlab, the app will crash because it could not find the deployment url due to invalid structure.

https://github.com/daneden/zeitgeist/blob/3d2a78db50b92b1f43838e0ead7ae387f0348630/Shared/Models/GitCommit.swift#L68-L71

Based on above code (L70-71), if my Gitlab repo is:

The resulting url will be https://gitlab.com/Acme App/wzulfikar/-/commit/[some commit hash]. This results to 404 and make the app crash.

To fix this, the correct commit for Gitlab repo should be https://gitlab.com/wzulfikar/acme-app/-/commit/[some commit hash]:

  1. Swap the value of self.repoKey and self.namespaceKey:
    • L70: self.repoKey should be ProjectName
    • L71: self.namespaceKey should be ProjectNamespace
  2. Use the correct project namespace (from Acme App to acme-app):
    • Instead of https://gitlab.com/wzulfikar/Acme App/..., it should be https://gitlab.com/wzulfikar/acme-app/...

To add more context, here's some screenshots:

P.S:

Hope it helps!

daneden commented 3 years ago

Amazing work! Thanks for digging into this, @wzulfikar—I’ll work on a fix right away.

daneden commented 3 years ago

Fixed in c196701!

daneden commented 3 years ago

The macOS build will be uploaded in a second, and the iOS build will hopefully be available in the next ~48hrs!