dwyl / gogs

βš™οΈ Interface with a Gogs (Git Server) from any Elixir App
GNU General Public License v2.0
10 stars 0 forks source link

Inconsistency: Some Functions don't Require `org_name` ... πŸ€¦β€β™‚οΈ #24

Closed nelsonic closed 2 years ago

nelsonic commented 2 years ago

while writing usage example docs, I noticed that Gogs.push/1 does not require the org name as an argument. While this currently works, because of the "flat" cloning ... and would probably work fine for the project we're using this package in - because we are actually going to abstract the concept of "orgs" away in practice ... the issue is we don't want a published module/package to have an inconsistent API. πŸ€¦β€β™‚οΈ (my bad!)

Todo βœ…

@SimonLab, I know you're working in Elm Land right now ... 🌳 so there is a context-switch involved in me dragging you into looking at this. πŸ™ But this really needs a fresh pair of eyes on it. Mine eyes have stared at it too long. πŸ™„ I think once this is done and we've published a new version, we can ship it in the "consuming" app. πŸ•

nelsonic commented 2 years ago

Looks like commit/2: https://hexdocs.pm/gogs/Gogs.html#commit/2 is another problem child. πŸ™„ @SimonLab thanks for taking a look at this. Really appreciate your feedback. πŸ™

I'm going to write a few more tests. Are you creating a branch for this work or am I? πŸ’­

SimonLab commented 2 years ago

@nelsonic I can create a new branch, I need to go over the repo again to make sure I don't misunderstand the issue. So let me know if you ahead of me and have created the branch

nelsonic commented 2 years ago

I've got a branch. Pushing up now. Then we can discuss on our 09:30 standup after you've had another 6 mins to get your coffee. β˜• 😜

nelsonic commented 2 years ago

Busy working on this in https://github.com/dwyl/gogs/pull/25/files πŸ‘¨β€πŸ’» ⏳ Going to need an espresso for this one ... β˜•

nelsonic commented 2 years ago

OK. got espresso + green tea (and caught up with my notification/emails) so now I have a block of focus time for this! πŸ…

Going to:

  1. make sure that the local_branch_create/1 function tests are passing before I "break" anything else ...
  2. add more tests so that mock: false gets 100% coverage. i.e. real world end-to-end tests. Currently:
    Randomized with seed 358681
    ----------------
    COV    FILE                                        LINES RELEVANT   MISSED
    100.0% lib/git_mock.ex                                54        7        0
    100.0% lib/gogs.ex                                   177       36        0
    100.0% lib/helpers.ex                                105       13        0
    100.0% lib/http.ex                                   101       16        0
    31.3% lib/httpoison_mock.ex                         103       16       11
    [TOTAL]  87.5%
    ----------------

    So pretty close.

  3. start refactoring the GogsHelpers.local_git_repo/1 function to require org_name that will break a bunch of tests because it's one of the core helpers. But once everything is fixed we should be on-track. 🀞

@SimonLab LMK if you want to remote-pair on any of this. I will be on our Zoom call. Just join if you're free. πŸ‘

nelsonic commented 2 years ago

New version published to Hex.pm now requires org_name. e.g: https://hexdocs.pm/gogs/0.9.0/GogsHelpers.html#local_repo_path/2

nelsonic commented 2 years ago

@SimonLab PR #25 assigned to you for final review/merge. πŸ™