Skip to content

[java][js][rb] remove deprecated FTP proxy support - #17846

Merged
titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:remove-ftp-proxy
Jul 30, 2026
Merged

[java][js][rb] remove deprecated FTP proxy support#17846
titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:remove-ftp-proxy

Conversation

@titusfortner

Copy link
Copy Markdown
Member

🔗 Related Issues

Deprecation tracked in #15905. FTP proxy was already removed from .NET (#16411) and Python (#16721).

💥 What does this PR do?

Removes deprecated FTP proxy support from the Java, JavaScript, and Ruby bindings — the last three still carrying it. FTP proxy is no longer part of the WebDriver spec; all bindings were deprecated in June 2025, well past the 2-release policy.

  • Java: Proxy.getFtpProxy() / Proxy.setFtpProxy() are gone.
  • JavaScript: proxy.manual() no longer accepts an ftp option (and no longer emits the runtime console.warn).
  • Ruby: Proxy#ftp / Proxy#ftp= and the ftp: constructor option are gone.
  • No binding emits ftpProxy in the serialized proxy capability anymore.

Inbound compatibility is preserved: an ftpProxy key arriving in a proxy capability from a server is silently ignored rather than erroring.

🔧 Implementation Notes

  • One Ruby spec used Proxy.new(ftp:) only to build a manual proxy with no HTTP URL (to assert the "expected HTTP proxy" error); switched to ssl:, which produces the same condition.

🤖 AI assistance

  • AI assisted (complete below)
    • Tool(s): Claude Code
    • What was generated: the removal across bindings and test updates
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

🔄 Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)

@selenium-ci selenium-ci added C-rb Ruby Bindings C-java Java Bindings C-nodejs JavaScript Bindings labels Jul 29, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Remove deprecated FTP proxy support in Java/JS/Ruby bindings

✨ Enhancement 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Remove deprecated FTP proxy APIs from Java, JavaScript, and Ruby bindings.
• Stop serializing ftpProxy into proxy capabilities; ignore inbound ftpProxy keys.
• Update unit tests and Firefox profile proxy preference wiring to match new behavior.
Diagram

graph TD
  A["Java Proxy"] --> D["Proxy capability JSON"] --> E["WebDriver Server"] --> F["Proxy capability parse"] --> G{ "ftpProxy present?" }
  B["JS proxy.manual"] --> D
  C["Ruby Proxy"] --> D
  G -->|"yes"| H["Ignore ftpProxy"]
  G -->|"no"| I["Apply supported keys"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Explicitly accept-and-drop ftpProxy during parsing
  • ➕ Makes the inbound-compatibility intent obvious in code (vs relying on 'unknown key is ignored')
  • ➕ Allows adding targeted tests asserting ftpProxy is ignored without reintroducing full support
  • ➖ Slightly more code surface for a removed feature
  • ➖ Risk of accidentally reintroducing serialization or API surface if not carefully isolated
2. Keep deprecated API stubs that throw a clear error
  • ➕ Provides a clearer failure mode for consumers still calling FTP proxy APIs
  • ➕ May reduce support burden by pointing users to replacement fields
  • ➖ Still keeps FTP proxy in the public API surface, conflicting with removal goal
  • ➖ Adds runtime behavior differences across bindings if not matched everywhere

Recommendation: Current approach is appropriate: remove the deprecated API surface and capability emission, while remaining tolerant of inbound ftpProxy keys by ignoring unknown capability fields. Consider adding an explicit parse-time ignore branch only if reviewers want the behavior to be self-documenting and directly testable without relying on generic 'unknown key' handling.

Files changed (11) +6 / -93

Refactor (6) +3 / -66
Proxy.javaRemove ftpProxy constant/field, JSON emission, and accessors +0/-35

Remove ftpProxy constant/field, JSON emission, and accessors

• Deletes the deprecated 'ftpProxy' capability key and associated state. Removes 'getFtpProxy'/'setFtpProxy' and stops including 'ftpProxy' in 'toJson()', 'toString()', 'equals()', and 'hashCode()'. Inbound 'ftpProxy' from a raw map is now ignored because it is no longer a recognized setter key.

java/src/org/openqa/selenium/Proxy.java

proxy.jsDrop ftp option from manual proxy config and stop warning +3/-16

Drop ftp option from manual proxy config and stop warning

• Removes 'ManualConfig.prototype.ftpProxy' and eliminates the 'ftp' option from 'proxy.manual()'. Stops emitting the runtime deprecation 'console.warn' and no longer outputs 'ftpProxy' in the returned config object.

javascript/selenium-webdriver/lib/proxy.js

proxy.rbRemove ftp option and serialization from Ruby Proxy +0/-8

Remove ftp option and serialization from Ruby Proxy

• Removes 'ftp' from the set of allowed proxy options and deletes the 'ftp=' setter (including its deprecation logging). Stops emitting 'ftpProxy' in 'as_json', which also means 'Proxy.json_create' will ignore inbound 'ftpProxy' keys.

rb/lib/selenium/webdriver/common/proxy.rb

profile.rbStop writing Firefox FTP proxy preferences +0/-1

Stop writing Firefox FTP proxy preferences

• Removes configuration of 'network.proxy.ftp' and 'network.proxy.ftp_port' from manual proxy profile wiring; only http/ssl/socks remain for manual proxy setup.

rb/lib/selenium/webdriver/firefox/profile.rb

proxy.rbsRemove ftp from Proxy interface signature +0/-2

Remove ftp from Proxy interface signature

• Deletes the 'ftp' method from the '_Proxy' interface type definition to match the removed API.

rb/sig/interfaces/proxy.rbs

proxy.rbsRemove ftp ivar and setter from Ruby Proxy RBS +0/-4

Remove ftp ivar and setter from Ruby Proxy RBS

• Removes the '@ftp' instance variable and the 'ftp=' method signature from the Ruby Proxy type definitions.

rb/sig/lib/selenium/webdriver/common/proxy.rbs

Tests (5) +3 / -27
ProxyTest.javaUpdate Java Proxy tests to remove ftpProxy expectations +1/-19

Update Java Proxy tests to remove ftpProxy expectations

• Removes all test coverage for 'getFtpProxy'/'setFtpProxy' and 'ftpProxy' JSON/map handling. Updates the expected JSON size to reflect the removed key and removes null-key tests for 'ftpProxy'.

java/test/org/openqa/selenium/ProxyTest.java

proxy_test.jsAdjust JS proxy tests/comments to remove FTP mention +1/-1

Adjust JS proxy tests/comments to remove FTP mention

• Updates the TODO comment to no longer reference FTP proxy testing, reflecting removed support.

javascript/selenium-webdriver/test/proxy_test.js

profile_spec.rbUpdate Firefox profile manual proxy spec to exclude FTP prefs +0/-3

Update Firefox profile manual proxy spec to exclude FTP prefs

• Stops constructing manual proxy configs with 'ftp:' and removes expectations that FTP prefs are written into 'user.js'. Keeps assertions for HTTP/SSL/no_proxy behavior.

rb/spec/unit/selenium/webdriver/firefox/profile_spec.rb

proxy_spec.rbRemove Ruby Proxy ftp option coverage from unit specs +0/-3

Remove Ruby Proxy ftp option coverage from unit specs

• Removes 'ftp:' from manual proxy settings used in tests and deletes assertions that 'ftpProxy' is present in JSON output.

rb/spec/unit/selenium/webdriver/proxy_spec.rb

default_spec.rbSwitch proxy type in HTTP client spec to keep same error condition +1/-1

Switch proxy type in HTTP client spec to keep same error condition

• Replaces 'Proxy.new(ftp: ...)' with 'Proxy.new(ssl: ...)' in the test that asserts an error when the proxy is not an HTTP proxy, preserving the test’s intent without relying on the removed option.

rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. getFtpProxy/setFtpProxy removed 📘 Rule violation ⚙ Maintainability
Description
FTP proxy support was removed across Java (Proxy.getFtpProxy()/Proxy.setFtpProxy()), Ruby
(Proxy#ftp/Proxy#ftp= and ftp: constructor option), and JavaScript (proxy.manual({ftp: ...})
and ftpProxy emission), creating both compile-time and runtime breaking changes for downstream
users upgrading. This violates the requirement to maintain public API/ABI compatibility by removing
previously supported public interfaces and behaviors without compatibility measures.
Code

java/src/org/openqa/selenium/Proxy.java[L221-245]

-  /**
-   * Gets the FTP proxy.
-   *
-   * @return the FTP proxy hostname if present, or null if not set
-   * @deprecated getFtpProxy is deprecated and will be removed in a future release.
-   */
-  @Deprecated
-  public @Nullable String getFtpProxy() {
-    return ftpProxy;
-  }
-
-  /**
-   * Specify which proxy to use for FTP connections.
-   *
-   * @param ftpProxy the proxy host, expected format is <code>hostname.com:1234</code>
-   * @return reference to self
-   * @deprecated setFtpProxy is deprecated and will be removed in a future release.
-   */
-  @Deprecated
-  public Proxy setFtpProxy(String ftpProxy) {
-    verifyProxyTypeCompatibility(ProxyType.MANUAL);
-    this.proxyType = ProxyType.MANUAL;
-    this.ftpProxy = ftpProxy;
-    return this;
-  }
Evidence
PR Compliance ID 1 prohibits removing or breaking public interfaces without compatibility measures,
and the cited changes show FTP handling has been eliminated in each binding: the Java Proxy
implementation no longer contains FTP proxy parsing/serialization via an ftpProxy key, aligning
with the removal of the public getFtpProxy/setFtpProxy methods; in Ruby, ftp is no longer
included in ALLOWED, making ftp: an unknown option that raises ArgumentError, and the public
RBS signatures no longer declare ftp; and in JavaScript, the manual factory now only
destructures { http, https, bypass } and returns an object without ftpProxy, so prior calls like
proxy.manual({ftp: ...}) no longer have any effect.

AGENTS.md: Maintain API/ABI Compatibility for Public Interfaces
java/src/org/openqa/selenium/Proxy.java[66-160]
rb/lib/selenium/webdriver/common/proxy.rb[31-71]
rb/sig/interfaces/proxy.rbs[19-39]
rb/sig/lib/selenium/webdriver/common/proxy.rbs[19-79]
javascript/selenium-webdriver/lib/proxy.js[130-156]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
FTP proxy support was removed from public APIs/behaviors across Java, Ruby, and JavaScript (Java `Proxy.getFtpProxy()`/`Proxy.setFtpProxy()`, Ruby `Proxy#ftp`/`Proxy#ftp=` and `ftp:` constructor option, and JavaScript `proxy.manual({ftp: ...})` / `ftpProxy` output), causing downstream compile-time failures (Java) and runtime breakages (Ruby/JS) for previously valid configurations.

## Issue Context
PR Compliance ID 1 requires maintaining public API/ABI compatibility and avoiding breaking public interface changes without compatibility measures; even if functionality was previously discouraged or deprecated, outright removal of accepted options/methods and emitted fields breaks consumers on upgrade.

## Fix Focus Areas
- java/src/org/openqa/selenium/Proxy.java[66-124]
- java/src/org/openqa/selenium/Proxy.java[215-245]
- rb/lib/selenium/webdriver/common/proxy.rb[31-71]
- rb/sig/interfaces/proxy.rbs[19-39]
- rb/sig/lib/selenium/webdriver/common/proxy.rbs[19-79]
- javascript/selenium-webdriver/lib/proxy.js[130-156]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread java/src/org/openqa/selenium/Proxy.java
@titusfortner
titusfortner merged commit 8daa0d1 into SeleniumHQ:trunk Jul 30, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-java Java Bindings C-nodejs JavaScript Bindings C-rb Ruby Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants