Skip to content

dbeaver/pro#10480 fixes driver properties form flow - #4652

Open
sergeyteleshev wants to merge 19 commits into
develfrom
10480-implement-prepare-phase-to-the-formpart-3
Open

sergeyteleshev wants to merge 19 commits into
develfrom
10480-implement-prepare-phase-to-the-formpart-3

Conversation

@sergeyteleshev

Copy link
Copy Markdown
Contributor

@sergeyteleshev sergeyteleshev self-assigned this Sep 11, 2026
@codacy-production

codacy-production Bot commented Sep 11, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics -4 complexity

Metric Results
Complexity -4

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copilot AI 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.

🟡 Changes recommended

One or more issues must be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates connection form preparation and formatting so driver, SSL, and SSH properties are normalized before submission.

Changes:

  • Moves driver property configuration into prepare.
  • Trims driver, SSL, and SSH state/configuration values.
File summaries
File Description
webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts Updated as part of this pull request.
webapp/packages/plugin-connection-network-handlers/src/SSL/ConnectionFormSSLPart.ts Updated as part of this pull request.
webapp/packages/plugin-connection-network-handlers/src/SSH/ConnectionFormSSHPart.ts Updated as part of this pull request.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI 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.

🔵 Needs a closer look

One or more issues must be addressed before approval.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts:81

  • This request now runs during the prepare phase, before later format handlers have normalized the connection config and before any later-registered network-handler parts have prepared their configs. In particular, ConnectionFormOptionsPart.format trims url, while its prepare resets networkHandlersConfig and SSL/SSH prepare handlers append to it; because those panels are lazy, opening Driver Properties before SSH/SSL makes this call send an untrimmed URL and incomplete handler config to getConnectionDriverProperties. The previous call in format ran after those steps, so keep this assignment in format (or otherwise order it after the dependent handlers).
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI 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.

🟡 Changes recommended

Unresolved moderate lifecycle, request-duplication, SSL-trimming, and API-compatibility issues remain.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

webapp/packages/core-ui/src/Form/FormPart.ts:49

  • This modified source file still has a 2024 copyright end year. Per the repository source-file convention, update the ending year to 2026 when changing the file.
    this.formState.prepareTask.addHandler(executorHandlerFilter(() => this.isLoaded(), this.prepare.bind(this)));

webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts:79

  • useDriverProperties.load() now executes prepareTask, so this handler calls getPropertiesConfig(), which performs a getConnectionDriverProperties request at line 98; the hook then immediately performs the same request again at line 64. This doubles descriptor traffic on every Driver Properties refresh and adds a remote request to every validation/save while this part is loaded. Reuse the descriptor result or keep the metadata fetch out of prepare().
  protected override async prepare(): Promise<void> {
    this.optionsPart.state.properties = await this.getPropertiesConfig();
  }

webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/useDriverProperties.ts:64

  • Calling prepareTask dispatches every loaded part. Once ConnectionFormDriverPropertiesPart is loaded, its new prepare() calls getPropertiesConfig()/getConnectionDriverProperties, and the next line calls the same resource again with the same config. Reopening or refreshing this tab therefore performs two sequential GraphQL requests; avoid fetching in both paths or reuse the prepared result.
          await this.payload.formState.prepareTask.execute(this.payload.formState);
          this.promise = this.connectionInfoResource.getConnectionDriverProperties(this.payload.formState.state.projectId, this.payload.config);

webapp/packages/plugin-network-handlers/src/SSH/sshHelpers.ts:46

  • This helper is re-exported by plugin-network-handlers/src/index.ts, so deleting the named export is a breaking package API change for downstream plugins even though this checkout has no remaining callers. Please retain a deprecated compatibility wrapper while migrating the internal caller, unless this package is explicitly allowed to remove released APIs.
export function prepareSSHHandlerConfig(

webapp/packages/plugin-network-handlers/src/SSH/sshHelpers.ts:70

  • Please add a regression test for the nested-properties copy. This change is intended to make trimSSHConfig avoid mutating its input, but sshHelpers.test.ts no longer calls trimSSHConfig (the removed getSSHHandlerConfig test was its only indirect coverage), so this behavior is currently unprotected.
  const trimmedInput = {
    ...toJS(input),
    properties: input.properties ? { ...toJS(input.properties) } : input.properties,
  };
  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Lite

contexts: IExecutionContextProvider<IFormState<IConnectionFormState>>,
): void | Promise<void> {
const urlType = this.optionsPart.state.configurationType === DriverConfigurationType.Url;
const requiresCredentials = this.state.enabled && !this.state.savePassword;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please keep existing logic, only move it from format to prepare

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