Skip to content

MCP-603 Clarify missing Server CAG entitlement endpoints - #725

Merged
nquinquenel merged 3 commits into
masterfrom
fix/nquinquenel/MCP-603-serverCagDiagnostic
Nov 11, 2026
Merged

nquinquenel merged 3 commits into
masterfrom
fix/nquinquenel/MCP-603-serverCagDiagnostic

Conversation

@nquinquenel

@nquinquenel nquinquenel commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

MCP-603 https://sonarsource.atlassian.net/browse/MCP-603

When the CAG entitlement endpoint returns 404 on SonarQube Server, the debug diagnostic now explains that the endpoint was not found and asks users to check whether their Server version and edition support Vortex. This distinguishes an absent endpoint from a valid response that denies entitlement.

Server routing and entitlement gating already landed in PR #543. The nil-UUID route, Cloud warnings, combined CAG/A3S entitlement checks, and entitlement discovery during over-consumption remain unchanged.

The CAG regression test reuses LogCapture, extracted from OAuthTestSupport into the shared test log package. Existing OAuth callers use the same helper, preserving strict single-event assertions, thread filtering, and automatic restoration of logging settings. An immutable event-list snapshot supports filtered CAG assertions.

Validation

  • 446 affected tests passed across authentication, CAG API, log capture, and logger suites.
  • ./gradlew spotlessCheck passed.
  • DEEP Vortex analysis of all nine files changed by the helper extraction found no changed-line issues. It retained an existing finding at OAuthHttpTransportTest.java:572, java:S5961: “Refactor this method to reduce the number of assertions from 27 to less than 25.”
  • The diagnostic's earlier DEEP analysis retained an existing finding at CagApi.java:27, java:S1075: “Refactor your code to get this URI from a customizable parameter.”

Docker integration tests and a real licensed Server were not exercised for this change. WireMock tests do not establish remote endpoint availability.


🤖 Co-authored by Fabrik

Co-Authored-By: Fabrik <fabrik@sonar.ai>
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

MCP-603

@nquinquenel
nquinquenel marked this pull request as ready for review November 11, 2026 13:45
@nquinquenel
nquinquenel requested a review from a team as a code owner November 11, 2026 13:45
@nquinquenel
nquinquenel requested review from Krosovok and removed request for Krosovok November 11, 2026 13:45
@nquinquenel nquinquenel changed the title MCP-603 Explain unsupported Server CAG entitlement endpoints MCP-603 Clarify missing Server CAG entitlement endpoints Nov 11, 2026
@nquinquenel
nquinquenel requested a review from Krosovok November 11, 2026 14:23

@Krosovok Krosovok left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is already a util to handle log capturing: OAuthTestSupport.LogCaptur. It is just hidden in the OAuthTestSupport even though it is not auth-specifc. I'd better to move it out to somewhere where it can be used by all tests and reuse it in the new test.

@nquinquenel

Copy link
Copy Markdown
Member Author

The requested shared LogCapture extraction is prepared locally. Authentication tests and the CAG test now reuse the helper; the affected test suites and Spotless passed. Vortex found no changed-line issues.

Publication is pending a commit-history decision. The existing Fabrik implementation commit is followed by the human wording commit, which I must preserve. I have asked the requester whether to publish the extraction as a separate commit instead of rewriting that history.

Generated by Fabrik

@gitar-bot

gitar-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟢 Low risk

The Server 404 change only replaces debug-log wording with version and edition guidance; entitlement handling remains unchanged, limiting runtime impact.

Adds a static debug diagnostic for Server CAG entitlement 404 responses, explaining the endpoint was not found and asking users to verify Server version and edition support for Vortex, while keeping Cloud warnings unchanged and adding regression tests for the Server and Cloud 404 paths. No issues found.

Verification Rules 2/2 met

Functional validation No results

Rules 2 passed 2 not applicable

✅ Internal artifact registries
✅ Repository license compliance

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@nquinquenel

Copy link
Copy Markdown
Member Author

I think there is already a util to handle log capturing: OAuthTestSupport.LogCaptur. It is just hidden in the OAuthTestSupport even though it is not auth-specifc. I'd better to move it out to somewhere where it can be used by all tests and reuse it in the new test.

Thanks for the suggestion, I implemented it 👍🏻

@nquinquenel

Copy link
Copy Markdown
Member Author

The published helper extraction at dbcb0ae satisfies the review request and supersedes my earlier pending-publication note. I preserved the human commits and validated the authentication, logging, CAG, entitlement and Server Vortex suites plus Spotless locally; all passed. Vortex found no changed-line issues. CI for this head is still running.

Generated by Fabrik

@sonarqubecloud

Copy link
Copy Markdown

@nquinquenel
nquinquenel merged commit 5a4f9d6 into master Nov 11, 2026
13 checks passed
@nquinquenel
nquinquenel deleted the fix/nquinquenel/MCP-603-serverCagDiagnostic branch November 11, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants