Skip to content

[BACKLOG-48508] - add projectDir to CRUD APIs#1344

Closed
abryant-hv wants to merge 2 commits intomasterfrom
abryant/BACKLOG-48508
Closed

[BACKLOG-48508] - add projectDir to CRUD APIs#1344
abryant-hv wants to merge 2 commits intomasterfrom
abryant/BACKLOG-48508

Conversation

@abryant-hv
Copy link
Copy Markdown
Contributor

No description provided.

@abryant-hv abryant-hv requested a review from a team as a code owner March 4, 2026 19:26
Copilot AI review requested due to automatic review settings March 4, 2026 19:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the Data Access Connection REST API to accept an optional projectDir query parameter on connection CRUD operations, enabling callers (and potential subclasses) to run operations in a project-scoped context.

Changes:

  • Added optional projectDir query parameter to relevant CRUD endpoints in connection-api.yaml.
  • Updated ConnectionService CRUD method signatures to include projectDir, and added overloads for backward compatibility.
  • Centralized ConnectionServiceExceptionWebApplicationException mapping via a helper method and adjusted some member visibility for subclassing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
core/src/main/resources/connection-api.yaml Adds projectDir query parameter to CRUD endpoints and tweaks response descriptions.
core/src/main/java/org/pentaho/platform/dataaccess/datasource/wizard/service/impl/ConnectionService.java Updates CRUD API method signatures to accept projectDir, adds backward-compatible overloads, and refactors exception handling.
Comments suppressed due to low confidence (3)

core/src/main/resources/connection-api.yaml:94

  • The 200 response description says the body will be empty, but the response schema is IDatabaseConnection (i.e., a non-empty JSON body is documented). Please align the description and the documented response content (either remove the response body schema or update the description to indicate an IDatabaseConnection is returned).
        '200':
          description: Successfully created database connection. The body will be empty. 
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IDatabaseConnection'

core/src/main/resources/connection-api.yaml:224

  • This 200 response is documented with text/plain string content, but the description says the body will be empty. If the endpoint returns an empty string (as a body) then document that explicitly; otherwise remove the response body content to match an empty-body 200 response.
        '200':
          description: Successfully deleted connection. The body will be empty.
          content:
            text/plain:
              schema:
                type: string
        '304':

core/src/main/resources/connection-api.yaml:260

  • This endpoint’s 200 response includes text/plain string content, but the description says the body will be empty. Please reconcile the OpenAPI contract (either document that the body is an empty string or remove the response body content if it’s truly empty).
        '200':
          description: Successfully added connection. The body will be empty. 
          content:
            text/plain:
              schema:
                type: string

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread core/src/main/resources/connection-api.yaml
@buildguy

This comment has been minimized.

@abryant-hv abryant-hv force-pushed the abryant/BACKLOG-48508 branch from 28c9a45 to 52e6164 Compare March 4, 2026 20:32
@buildguy

This comment has been minimized.

Numerous updates, mostly to error handling, so return codes, messages,
and content types match the 11.0 API.

Note that quite a few of these error handling cases are *not* following
best practices, but they are this way to be compatible with the old API.

For example, in some cases we return a 500 instead of a 403. We also
have inconsistent error response content, sometimes with a default message
and sometimes with a meaningful string. All this is to match the existing
API.
@abryant-hv abryant-hv force-pushed the abryant/BACKLOG-48508 branch from 52e6164 to 10dde5c Compare March 12, 2026 11:41
@hitachivantarasonarqube
Copy link
Copy Markdown

@buildguy
Copy link
Copy Markdown
Collaborator

👍 Frogbot scanned this pull request and did not find any new security issues.

Note:

Frogbot also supports Contextual Analysis, Secret Detection, IaC and SAST Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.


@buildguy
Copy link
Copy Markdown
Collaborator

✅ Build finished in 20m 48s

Build command:

mvn clean verify -B -e -Daudit -Djs.no.sandbox -pl core

👌 All tests passed!

Tests run: 419, Failures: 0, Skipped: 1    Test Results


ℹ️ This is an automatic message

@abryant-hv
Copy link
Copy Markdown
Contributor Author

Superseded by #1346

@abryant-hv abryant-hv closed this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants