openupm-cli icon indicating copy to clipboard operation
openupm-cli copied to clipboard

Discussion: Error logging during packument resolving.

Open ComradeVanti opened this issue 5 months ago • 3 comments

While working on more complex packument resolving logic, I came upon an open question, that I would like to open to discussion. That is concerning, which errors/infos should be printed to the user while resolving packuments.

Here are a few examples that I would like to get others opinions on. I provide the scenarios for the primary and upstream registry, but please imagine it for n registries, in the case that #49 is implemented.

Example 1

Scenario:

  1. The primary registry is searched, but the packument is not found
  2. The upstream registry is searched and the packument is found

Question:

Should the "Packument not found" error for the primary registry be logged? In my opinion, no, because it is overruled by the packument being found in the upstream registry.

Example 2

Scenario:

  1. The primary registry is searched. The packument is found, but the requested version is missing.
  2. The upstream registry is searched. The packument is found.

Question:

Should the user be informed that the packument was found in the primary registry?

Example 3

Scenario:

  1. The primary registry is searched. The packument and version is found but incompatible for the current editor version.
  2. The upstream registry is searched. The packument is not found.

Question:

Should the user be informed that the packument was found in the primary registry, or should it count as a "packument not found", since it was not found in the "last" registry.


The above examples can be generalized to: If I search n registries and the different registries match the query differently well (some don't contain the packument, some have it, but not the version, some are incompatible, etc.) how should this information be presented to the user? Should all issues be logged? Only the "most fixable"? Only the last?

I'm curious to hear your opinions :)

ComradeVanti avatar Feb 10 '24 10:02 ComradeVanti