Skip to content

KNOX-1608: Remove gateway-adapter module#1263

Merged
smolnar82 merged 3 commits into
apache:masterfrom
arunk-kumar:knox-1608-remove-adapter
Jul 1, 2026
Merged

KNOX-1608: Remove gateway-adapter module#1263
smolnar82 merged 3 commits into
apache:masterfrom
arunk-kumar:knox-1608-remove-adapter

Conversation

@arunk-kumar

Copy link
Copy Markdown
Contributor

Jira Link

KNOX-1608 - Remove gateway-adapter module

What changes were proposed in this pull request?

As outlined in KNOX-1608, the deprecated gateway-adapter module has been completely unhooked from the parent and release build lifecycles, and its directory structure has been completely purged from the codebase.

This module was originally retained as a compatibility bridge for old classpaths (org.apache.hadoop.gateway) during historical package migrations and is no longer required for modern deployment targets.

(Please fill in changes proposed in this fix)

How was this patch tested?

The patch was validated via full workspace compilation from the root directory to confirm that downstream packaging profiles (gateway-release, gateway-docker) compile cleanly without the module:

mvn clean install -DskipTests -Dspotbugs.skip=true

The local build completes successfully with a green BUILD SUCCESS flag.

Additionally, a local unit test suite was executed. Flaky tests and environment-specific constraints were observed (notably JaCoCo bytecode mismatches with local JDK 24 and race conditions on high-speed Apple Silicon CPUs), but all core modules and non-environmental test trees compile and validate cleanly.

Integration Tests

N/A (Codebase technical debt cleanup; no new business logic or operational endpoints introduced).

UI changes

N/A

Please review Knox Contributing Process before opening a pull request.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Test Results

32 tests   32 ✅  3s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit fc6a8fd.

♻️ This comment has been updated with latest results.

@smolnar82 smolnar82 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.

LGTM.

@hanicz - Can you please take a look?

@hanicz hanicz 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.

@arunk-kumar Thank you for picking up this task.

  • Please rebase the changes you are 14 commits behind master.
  • gateway-admin-ui/admin-ui/app/provider-config-wizard/ldap-provider-config.ts still has two org.apache.hadoop references please fix those.

@smolnar82

smolnar82 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@arunk-kumar Thank you for picking up this task.

  • Please rebase the changes you are 14 commits behind master.
  • gateway-admin-ui/admin-ui/app/provider-config-wizard/ldap-provider-config.ts still has two org.apache.hadoop references please fix those.

Nice catch, @hanicz !

I also found a couple more references to the old package name:

$ git status
On branch review-pr-1263
nothing to commit, working tree clean

$ grep -R "org.apache.hadoop.gateway" ./*
./CHANGES:    * [KNOX-1553] - Update documentation to reference org.apache.knox instead of org.apache.hadoop.gateway
./build-tools/src/main/resources/build-tools/spotbugs-filter.xml:    <Class name="~org.apache.hadoop.gateway..*" />
./gateway-admin-ui/admin-ui/app/provider-config-wizard/ldap-provider-config.ts:            'org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm');
./gateway-admin-ui/admin-ui/app/provider-config-wizard/ldap-provider-config.ts:            'org.apache.hadoop.gateway.shirorealm.KnoxLdapContextFactory');
./gateway-server/src/test/resources/org/apache/knox/gateway/topology/xml/TopologyRulesModuleTest/topology-with-dispatch-parameters.xml:            <classname>org.apache.hadoop.gateway.hbase.HBaseDispatch</classname>
./gateway-server/src/test/resources/org/apache/knox/gateway/topology/xml/TopologyRulesModuleTest/topology-with-dispatch.xml:            <classname>org.apache.hadoop.gateway.hbase.HBaseDispatch</classname>
./gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/ProviderConfigurationParserTest.java:    "        \"main.ldapContextFactory\":\"org.apache.hadoop.gateway.shirorealm.KnoxLdapContextFactory\",\n" +
./gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/ProviderConfigurationParserTest.java:    "        \"main.ldapRealm\":\"org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm\",\n" +
./gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/ProviderConfigurationParserTest.java:        "      main.ldapRealm: org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm\n" +
./gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/ProviderConfigurationParserTest.java:        "      main.ldapContextFactory: org.apache.hadoop.gateway.shirorealm.KnoxLdapContextFactory\n" +
./gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/ProviderConfigurationParserTest.java:        assertEquals(params.get("main.ldapRealm"), "org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm");
./gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/ProviderConfigurationParserTest.java:        assertEquals(params.get("main.ldapContextFactory"), "org.apache.hadoop.gateway.shirorealm.KnoxLdapContextFactory");
./gateway-server/src/test/java/org/apache/knox/gateway/topology/xml/TopologyRulesModuleTest.java:    assertThat( dispatch.getClassName(), is("org.apache.hadoop.gateway.hbase.HBaseDispatch") );
./gateway-server/src/test/java/org/apache/knox/gateway/topology/xml/TopologyRulesModuleTest.java:    assertThat( dispatch.getClassName(), is("org.apache.hadoop.gateway.hbase.HBaseDispatch") );
./gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/changes.txt: 62. HADOOP-1504.  Fix terminate-org.apache.hadoop-gateway script in contrib/ec2
./gateway-test/src/test/resources/org/apache/knox/gateway/GatewayBasicFuncTest/changes.txt:132. HADOOP-1635.  Remove hardcoded keypair name and fix launch-org.apache.hadoop-gateway
./gateway-topology-hadoop-xml/src/test/resources/testDescriptor.xml:          authentication.param.main.ldapRealm=org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm#
./gateway-topology-hadoop-xml/src/test/resources/testDelete.xml:            authentication.param.main.ldapRealm=org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm#
./gateway-topology-hadoop-xml/src/test/java/org/apache/knox/gateway/topology/hadoop/xml/HadoopXmlResourceParserTest.java:    assertEquals("org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm", authenticationProvider.getParams().get("main.ldapRealm"));

The only one should remain is in CHANGES.

@moresandeep

Copy link
Copy Markdown
Contributor

Thanks @arunk-kumar! can I ask you the motivation behind this change? I would also recommend sending an email on the Knox dev mailing list discussing the change before we make this change (discuss thread). It is unlikely that someone might be using these packages but it is a breaking change and we should let people know before we make these changes.

@smolnar82

Copy link
Copy Markdown
Contributor

Thanks @arunk-kumar! can I ask you the motivation behind this change? I would also recommend sending an email on the Knox dev mailing list discussing the change before we make this change (discuss thread). It is unlikely that someone might be using these packages but it is a breaking change and we should let people know before we make these changes.

@arunk-kumar contacted me before he submitted his change and I assured this is ok as we planned to remove this module even earlier, but 3.0.0 will be a breaking change anyway due to the JDK 17 support.

Thanks, @moresandeep, for bringing this up, this was a 100% valid point!

After removing the gateway-adapter module, two runtime references to the deleted org.apache.hadoop.gateway.* classes remained and would fail with ClassNotFoundException at topology deployment:

  - .github/workflows/build/conf/topologies/knoxldap.xml: main.ldapRealm pointed at org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm. This caused the Apache Knox Docker Compose Tests CI to fail.
  - gateway-service-definitions/.../elasticsearch/1.0.0/service.xml: the <dispatch> classname pointed at the adapter PassAllHeadersDispatch.

Both adapter classes were pure delegating subclasses of their org.apache.knox.gateway.* counterparts (every method body was just super.<same>(args)) so swapping the FQCN is behavior-preserving.
Addresses review feedback on PR apache#1263:
  - gateway-admin-ui/.../ldap-provider-config.ts: LDAP wizard now
    generates topologies referencing org.apache.knox.gateway.shirorealm.*
    instead of the removed adapter package.
  - Test fixtures and assertions in gateway-server and
    gateway-topology-hadoop-xml migrated to org.apache.knox.gateway.*
    (topology-with-dispatch{,-parameters}.xml, TopologyRulesModuleTest,
    ProviderConfigurationParserTest, testDescriptor.xml, testDelete.xml,
    HadoopXmlResourceParserTest).
  - build-tools/.../spotbugs-filter.xml: removed the now-dead
    ~org.apache.hadoop.gateway..* exclusion.

The only remaining occurrence is the historical KNOX-1553 entry in the
CHANGES file, which is a release-notes reference and should not be
rewritten.
@arunk-kumar
arunk-kumar force-pushed the knox-1608-remove-adapter branch from 93c366e to fc6a8fd Compare July 1, 2026 08:56
@arunk-kumar

arunk-kumar commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @hanicz, @smolnar82 — rebased on master and cleaned up all remaining org.apache.hadoop.gateway references:

gateway-admin-ui/.../ldap-provider-config.ts — LDAP wizard now emits org.apache.knox.gateway.shirorealm.*
Test fixtures and assertions in gateway-server and gateway-topology-hadoop-xml (topology-with-dispatch{,-parameters}.xml, TopologyRulesModuleTest, ProviderConfigurationParserTest, testDescriptor.xml, testDelete.xml, HadoopXmlResourceParserTest)
Removed the now-dead ~org.apache.hadoop.gateway..* exclusion from spotbugs-filter.xml
Only the KNOX-1553 entry in CHANGES still references the old package, which is a historical release-notes line and shouldn't be rewritten.

@moresandeep — Thanks for the guidance! I completely agree. I am starting a [DISCUSS] thread on the dev mailing list right now to outline the motivation and give the community a heads-up regarding the breaking change for 3.0.0.

@arunk-kumar

arunk-kumar commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @smolnar82 @hanicz. As per @moresandeep, I've sent a heads-up to dev@knox.apache.org announcing this breaking change for 3.0.0.

discuss thread : https://lists.apache.org/thread/3b52m4186286rf24m9f8j98b9lpscpvv

@moresandeep moresandeep 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.

Awesome, thank you so much! the changes look good.

@smolnar82
smolnar82 merged commit 67fb077 into apache:master Jul 1, 2026
3 checks passed
smolnar82 pushed a commit that referenced this pull request Jul 4, 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.

4 participants