Skip to content

Remove plugin-config command (not exposed by API7 EE)#34

Merged
shreemaan-abhishek merged 1 commit into
masterfrom
remove-plugin-config-command
May 18, 2026
Merged

Remove plugin-config command (not exposed by API7 EE)#34
shreemaan-abhishek merged 1 commit into
masterfrom
remove-plugin-config-command

Conversation

@shreemaan-abhishek
Copy link
Copy Markdown
Contributor

@shreemaan-abhishek shreemaan-abhishek commented May 18, 2026

Summary

The API7 EE control-plane does not expose /apisix/admin/plugin_configs as a management resource. Verified against api7ee-3-control-plane: no routes, no handlers, not in the generated OpenAPI spec; same signature as the already-removed consumer_group. The a7 plugin-config command was therefore non-functional against API7 EE and is removed.

Mirrors #21 (which removed upstream / consumer-group / service-template).

Changes

Code

  • Delete pkg/cmd/plugin-config/ (parent + all subcommand dirs) and pkg/api/types_plugin_config.go.
  • Unregister from pkg/cmd/root/root.go.
  • Drop plugin_configs from config dump/diff/sync paths in configutil and sync.go.
  • Add plugin_configs to declarative-config validation rejection alongside upstreams / consumer_groups / service_templates.
  • Re-type ConfigFile.PluginConfigs to []interface{} (rejection-only, same pattern as ServiceTemplates).

Tests

  • Delete test/e2e/plugin_config_test.go (the old "compatibility error" tests). The standard TestUnsupportedResourceCommandsAreRemoved + TestHelp in completion_version_test.go now cover plugin-config removal.
  • Extend TestConfigValidate_EmptyUnsupportedSections with the plugin_configs case (all 4 subtests pass).
  • Remove the /apisix/admin/plugin_configs stub from diff_test.go / dump_test.go / sync_test.go.

Docs

Caveat

The CP still accepts plugin_configs inside batch config-validation payloads. The rejection applies only to a7's standalone command and the top-level declarative section, not that internal validation path.

Test plan

  • go build, go vet, full go test ./... all pass locally.
  • ./bin/a7 plugin-config --helpError: unknown command "plugin-config" for "a7".
  • ./bin/a7 --help shows only plugin and plugin-metadata, no plugin-config.

Closes #24. Part of #22.

Summary by CodeRabbit

Release Notes

  • Chores

    • Removed the unsupported a7 plugin-config command and all related subcommands from the CLI.
    • Updated configuration validation to explicitly reject plugin configuration sections in declarative config files.
  • Documentation

    • Clarified that plugin configuration is not supported.

Review Change Stack

The API7 EE control-plane does not expose /apisix/admin/plugin_configs
as a management resource (verified against api7ee-3-control-plane: no
routes, no handlers, not in the generated OpenAPI spec).

Mirrors PR #21 (upstream/consumer-group/service-template):
- delete pkg/cmd/plugin-config/ and pkg/api/types_plugin_config.go
- unregister from pkg/cmd/root/root.go
- drop plugin_configs from config dump/diff/sync paths
- add plugin_configs to declarative-config validation rejection
  alongside upstreams/consumer_groups/service_templates
- replace the old 'compatibility error' e2e file with the standard
  TestUnsupportedResourceCommandsAreRemoved + TestHelp assertions
- extend TestConfigValidate_EmptyUnsupportedSections with plugin_configs
- PRD: align the Plugin Config note with the consumer-groups treatment

The CP still accepts plugin_configs *inside* batch config-validation
payloads, so the rejection only applies to a7's standalone command and
the top-level declarative section.

Closes #24.
Copilot AI review requested due to automatic review settings May 18, 2026 08:08
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 43f20240-c242-4db7-97c4-0f0aa8b55e04

📥 Commits

Reviewing files that changed from the base of the PR and between a3e5222 and 698795d.

📒 Files selected for processing (27)
  • PRD.md
  • docs/ga-test-plan.md
  • pkg/api/types_config.go
  • pkg/api/types_plugin_config.go
  • pkg/cmd/config/configutil/configutil.go
  • pkg/cmd/config/diff/diff_test.go
  • pkg/cmd/config/dump/dump_test.go
  • pkg/cmd/config/sync/sync.go
  • pkg/cmd/config/sync/sync_test.go
  • pkg/cmd/config/validate/validate.go
  • pkg/cmd/config/validate/validate_test.go
  • pkg/cmd/plugin-config/create/create.go
  • pkg/cmd/plugin-config/create/create_test.go
  • pkg/cmd/plugin-config/delete/delete.go
  • pkg/cmd/plugin-config/delete/delete_test.go
  • pkg/cmd/plugin-config/export/export.go
  • pkg/cmd/plugin-config/export/export_test.go
  • pkg/cmd/plugin-config/get/get.go
  • pkg/cmd/plugin-config/get/get_test.go
  • pkg/cmd/plugin-config/list/list.go
  • pkg/cmd/plugin-config/list/list_test.go
  • pkg/cmd/plugin-config/plugin_config.go
  • pkg/cmd/plugin-config/update/update.go
  • pkg/cmd/plugin-config/update/update_test.go
  • pkg/cmd/root/root.go
  • test/e2e/completion_version_test.go
  • test/e2e/plugin_config_test.go
💤 Files with no reviewable changes (20)
  • pkg/cmd/config/diff/diff_test.go
  • pkg/api/types_plugin_config.go
  • pkg/cmd/plugin-config/plugin_config.go
  • pkg/cmd/plugin-config/export/export_test.go
  • pkg/cmd/plugin-config/export/export.go
  • pkg/cmd/config/sync/sync_test.go
  • pkg/cmd/plugin-config/get/get_test.go
  • pkg/cmd/plugin-config/delete/delete_test.go
  • pkg/cmd/plugin-config/update/update.go
  • pkg/cmd/plugin-config/get/get.go
  • test/e2e/plugin_config_test.go
  • pkg/cmd/plugin-config/update/update_test.go
  • pkg/cmd/config/dump/dump_test.go
  • pkg/cmd/plugin-config/list/list_test.go
  • pkg/cmd/plugin-config/create/create.go
  • pkg/cmd/root/root.go
  • pkg/cmd/plugin-config/list/list.go
  • pkg/cmd/config/sync/sync.go
  • pkg/cmd/plugin-config/delete/delete.go
  • pkg/cmd/plugin-config/create/create_test.go

📝 Walkthrough

Walkthrough

The pull request completely removes the plugin-config CLI command and related infrastructure because API7 EE does not expose plugin-config. Type definitions are deleted, config handling (diff, fetch, validation, sync) is updated to treat plugin_configs as unsupported, and all subcommands and registration are removed. Documentation and tests are updated accordingly.

Changes

Plugin-Config Command and Config Handling Removal

Layer / File(s) Summary
Documentation scope changes
PRD.md, docs/ga-test-plan.md
Removes plugin-config from supported export resources, user-guide list, e2e matrix, and unsupported-command table. Declares both the command and declarative config section as unsupported.
Type system changes
pkg/api/types_config.go
ConfigFile.PluginConfigs field type changed from []PluginConfig to []interface{} to enable deferred rejection. PluginConfig struct is removed entirely. Comments clarify plugin_configs is captured only for explicit rejection.
Config diff and remote fetch infrastructure
pkg/cmd/config/configutil/configutil.go
Removes plugin_configs from DiffResult struct and Sections() ordering. Stops FetchRemoteConfig from fetching /apisix/admin/plugin_configs endpoint. Removes plugin_configs comparison from ComputeDiff and reindexes subsequent sections. Hardens ValidateSupportedSections to append plugin_configs to unsupported list.
Declarative config validation
pkg/cmd/config/validate/validate.go, validate_test.go
ValidateConfigFile now explicitly rejects non-nil plugin_configs section with validation error. Duplicate-ID checking for plugin_configs removed. Test updated with case asserting empty plugin_configs is rejected.
Config sync resource handling
pkg/cmd/config/sync/sync.go
Removes plugin_configs cases from putPathAndBody and deletePath, causing plugin_configs operations to fall through to unsupported-resource-type error instead of constructing API requests.
Config command test infrastructure updates
pkg/cmd/config/diff/diff_test.go, dump/dump_test.go, sync/sync_test.go
Removes /apisix/admin/plugin_configs endpoint from registerEmptyResources helpers in config test files.
CLI command registration and structure
pkg/cmd/root/root.go
Removes plugin-config package import and command registration from root. Plugin-metadata and other subcommands continue to be registered.
E2E test and help validation
test/e2e/completion_version_test.go
Updates help text assertion to verify plugin-config is absent from top-level help. Adds plugin-config to unsupported/removed resource command list in e2e tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

  • #24: Remove/disable the plugin-config command — This PR directly implements all the objectives listed in the issue: removes the plugin-config command and subcommands, updates config dump/diff/sync handling, adds declarative-config validation rejection, removes documentation references, and adds e2e coverage asserting the command is unsupported.

Possibly related PRs

  • api7/a7#21: Both PRs adjust shared config-validation and diff plumbing in pkg/cmd/config/configutil/configutil.go to treat top-level declarative sections as unsupported (main: plugin_configs; that PR: upstreams/consumer_groups).
  • api7/a7#31: Both PRs modify the same config-validation code paths (ValidateSupportedSections / ValidateConfigFile) to reject explicit unsupported top-level declarative sections (main: plugin_configs; that PR: service_templates).
  • api7/a7#16: Related to the same plugin-config command surface; that PR changed existing plugin-config command error handling for APISIX-compatibility messages, while this PR removes the command entirely.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removal of the plugin-config command because API7 EE does not expose it.
Linked Issues check ✅ Passed All primary coding objectives from #24 are met: command removal, config handling updates, validation rejection, E2E coverage, and root registration removal.
Out of Scope Changes check ✅ Passed All changes are directly aligned with #24 requirements; documentation updates (PRD, ga-test-plan) are in-scope scope clarifications.
E2e Test Quality Review ✅ Passed E2E test quality passes all criteria: (1) real CLI testing, (2) clear removal verification, (3) readable assertions, (4) real services, (5) proper error handling, (6) addresses Issue #24 requirement.
Security Check ✅ Passed No security vulnerabilities found. PR safely removes plugin-config command with proper rejection of plugin_configs sections. No auth bypasses, secret exposure, or partial implementations detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-plugin-config-command

Comment @coderabbitai help to get the list of available commands and usage tips.

@shreemaan-abhishek shreemaan-abhishek merged commit ac31b9d into master May 18, 2026
6 checks passed
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.

Remove/disable the plugin-config command (stream-route stays)

1 participant