Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce ERROR notifications for certain "normal" metadata scenarios (i.e. 404) #4471

Open
2 tasks done
valentijnscholten opened this issue Dec 18, 2024 · 0 comments
Open
2 tasks done
Labels
enhancement New feature or request

Comments

@valentijnscholten
Copy link
Contributor

valentijnscholten commented Dec 18, 2024

Current Behavior

I noticed that every non 2xx http response code triggers an ERROR notification to be raised for metadata analysis:

protected void handleUnexpectedHttpResponse(final Logger logger, String url, final int statusCode, final String statusText, final Component component) {
logger.debug("HTTP Status : " + statusCode + " " + statusText);
logger.debug(" - RepositoryType URL : " + url);
logger.debug(" - Package URL : " + component.getPurl().canonicalize());
Notification.dispatch(new Notification()
.scope(NotificationScope.SYSTEM)
.group(NotificationGroup.REPOSITORY)
.title(NotificationConstants.Title.REPO_ERROR)
.content("An error occurred while communicating with an " + supportedRepositoryType().name() + " repository. URL: " + url + " HTTP Status: " + statusCode + ". Check log for details." )
.level(NotificationLevel.ERROR)
);
}

Proposed Behavior

I propose to make this less noisy. The logging is already on DEBUG level, maybe the notification should be on DEBUG as well. At least for 404 which can be quite normal, at least for the Composer Package Repository (#4470)
Maybe other 4xx and 5xx errors could/should trigger WARN or ERROR.

Checklist

@valentijnscholten valentijnscholten added the enhancement New feature or request label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant