[REVIEW] NEXUS-5511 Refine reasoning #847

Merged
merged 5 commits into from Apr 30, 2013

Projects

None yet

2 participants

@cstamas

Original fix for NEXUS-5511, but left some loose endings.

Conditions like "request is local-only", "proxy mode is not ALLOW" and "rejected by auto-routing" were all put under same message stating "...remote storage access is prevented...". Clearly, this is no good.

This pull separates now these scenarios, but also improves the messages by aligning how repository is "rendered" (unifying the message).

See issue for "validation scenario" where new (but also old) reasoning messages are represented:
https://issues.sonatype.org/browse/NEXUS-5511

cstamas added some commits Apr 30, 2013
@cstamas cstamas NEXUS-5511: Refine reasoning.
With initial change, while all the requirements were added, still
the report for "auto routing rejected", "proxy mode rejected" or
"request is local only" cases all fell under same generic reason
for INFex: "Path %s not found in local storage and remote storage
access is prevented of %s repository."

This change now refines these cases too, as there is always
proper reason "why not".

Also, simplified code, as shouldProxy boolean actually became

shouldProxy :== noRemoteAccessReason != null

Redundant boolean removed.
7094ee2
@cstamas cstamas NEXUS-5511: Make repo ID be in all messages. 8d79e5a
@cstamas cstamas NEXUS-5511: Unified repository presence in messages.
Removed used of RepositoryStringUtils.getHumanizedNameString
d33e21b
@nabcos nabcos and 1 other commented on an outdated diff Apr 30, 2013
...natype/nexus/proxy/repository/AbstractRepository.java
@@ -1215,8 +1215,7 @@ public void maintainNotFoundCache( ResourceStoreRequest request )
}
throw new ItemNotFoundException( reasonFor( request, this,
- "The path %s is in NFC of repository %s.", request.getRequestPath(),
- RepositoryStringUtils.getHumanizedNameString( this ) ) );
+ "The path %s is in NFC of repository %s.", request.getRequestPath(), this ) );
@nabcos
nabcos Apr 30, 2013

minor: don't use acronym for NFC? e.g. "The path %s is still cached as not found for repository %s."

@cstamas
cstamas Apr 30, 2013

Sounds good.

@nabcos

+1

@cstamas cstamas merged commit 040cc7d into master Apr 30, 2013
@cstamas cstamas deleted the nexus-5511-refine-reasoning branch Apr 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment