gomods/athens

Add logs to warn when not all 3 files (mod, info and zip) are present

オープン

#1,171 opened on 2019/03/30

 (7 件のコメント) (0 件のリアクション) (0 人の担当者)Go (538 件のフォーク)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (4,766 個のスター)
PR merge metrics
 (平均マージ 18d 13h) (30d で 13 merged PRs)

説明

Is your feature request related to a problem? Please describe.

The file system storage currently checks for all three files (.mod, .zip, .info) exist and fails any one endpoint if they don't all exist. This can be problematic if, for some reason, 1/3 or 2/3 of the files exist. In this case, Athens will "fall back" to downloading the module from the VCS and overwriting it in its storage.

That's not an optimal solution, but without a larger refactoring, it's the best we can do

Describe the solution you'd like

We should clearly log when we run into a situation when a module doesn't have all 3 files present. The log should be a "warning" with detailed information on why this happens and what Athens is doing to fix it (i.e. falling back to the VCS), and what that means (the module might get overwritten)

Describe alternatives you've considered

A larger refactor of how files are stored on disk

Additional context

This is a follow-up from https://github.com/gomods/athens/pull/1143#issuecomment-474602212.

コントリビューターガイド