Repository navigation
Improve error diagnostics when publisher lookup fails - #266
Conversation
Enhanced error message to include: - List of available publishers - List of server IDs with publisher configuration - Hint about checking settings.xml or using -Dpublisher parameter - Added test to verify error message contains helpful information Fixes maveniverse#265
|
Looks ok, but this is why I created |
|
Example of njord:status on unconfigured (not using) njord and on a fully configured project: |
| } | ||
| } | ||
|
|
||
| logger.error("Server IDs with publisher configuration:"); |
There was a problem hiding this comment.
This is confusing, you can configure the publisher also via project properties, not only via settings.xml (https://maveniverse.eu/docs/njord/configuration/).
|
The "superpowers" of Njord comes from:
Users of "fast lane" ( |
|
Warning Review limit reached
More reviews will be available in 46 minutes. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Publisher resolution diagnostics
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The message now looks like this (trying publish with non existed publisher): |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
core/src/main/java/eu/maveniverse/maven/njord/shared/impl/publisher/DefaultArtifactPublisherRedirector.java (1)
252-254:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winInclude CLI/property guidance in the thrown hint.
Line 252-Line 254 still only points users to
settings.xml; this misses the explicit remediation path via publisher property/-Dpublisherthat the issue/PR objective calls out. Please include that in the exception text so users can recover without digging further.Suggested patch
- throw new IllegalArgumentException("Failed to resolve publisher name '" + name - + "'. Check the logs for available publishers and server configurations, " - + "or verify your settings.xml configuration"); + throw new IllegalArgumentException("Failed to resolve publisher name '" + name + + "'. Check the logs for available publishers and server configurations, " + + "and verify your settings.xml or set publisher explicitly via -Dnjord.publisher=<name>");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@core/src/main/java/eu/maveniverse/maven/njord/shared/impl/publisher/DefaultArtifactPublisherRedirector.java` around lines 252 - 254, The exception message thrown in the DefaultArtifactPublisherRedirector class when failing to resolve publisher name only mentions checking settings.xml configuration but does not include the CLI/property remediation path. Update the IllegalArgumentException message to additionally mention that users can specify the publisher directly using the -Dpublisher property or CLI flag, providing a more complete and actionable error message that helps users recover without additional investigation.
🧹 Nitpick comments (1)
core/src/test/java/eu/maveniverse/maven/njord/shared/impl/publisher/DefaultArtifactPublisherRedirectorTest.java (1)
110-117: ⚡ Quick winAssert the explicit publisher override hint to prevent regressions.
To fully protect the diagnostic contract, add an assertion for the property/CLI recovery path (for example
-Dnjord.publisher).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@core/src/test/java/eu/maveniverse/maven/njord/shared/impl/publisher/DefaultArtifactPublisherRedirectorTest.java` around lines 110 - 117, The test assertions in DefaultArtifactPublisherRedirectorTest are missing a check for the explicit publisher override hint that provides users with a recovery path. Add an additional Assertions.assertTrue call after the existing message content checks to verify that the error message contains the publisher override property or CLI option (such as -Dnjord.publisher) to prevent regressions and ensure the diagnostic contract fully includes recovery guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In
`@core/src/main/java/eu/maveniverse/maven/njord/shared/impl/publisher/DefaultArtifactPublisherRedirector.java`:
- Around line 252-254: The exception message thrown in the
DefaultArtifactPublisherRedirector class when failing to resolve publisher name
only mentions checking settings.xml configuration but does not include the
CLI/property remediation path. Update the IllegalArgumentException message to
additionally mention that users can specify the publisher directly using the
-Dpublisher property or CLI flag, providing a more complete and actionable error
message that helps users recover without additional investigation.
---
Nitpick comments:
In
`@core/src/test/java/eu/maveniverse/maven/njord/shared/impl/publisher/DefaultArtifactPublisherRedirectorTest.java`:
- Around line 110-117: The test assertions in
DefaultArtifactPublisherRedirectorTest are missing a check for the explicit
publisher override hint that provides users with a recovery path. Add an
additional Assertions.assertTrue call after the existing message content checks
to verify that the error message contains the publisher override property or CLI
option (such as -Dnjord.publisher) to prevent regressions and ensure the
diagnostic contract fully includes recovery guidance.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 92802521-576b-48da-8b56-8b6c5840b733
📒 Files selected for processing (2)
core/src/main/java/eu/maveniverse/maven/njord/shared/impl/publisher/DefaultArtifactPublisherRedirector.javacore/src/test/java/eu/maveniverse/maven/njord/shared/impl/publisher/DefaultArtifactPublisherRedirectorTest.java
Enhanced error message to include:
Fixes #265
@cstamas what do you think?
Summary by CodeRabbit
Release Notes