Skip to content

feat(provider): rename pkg/plugin to pkg/provider and sweep provider terminology#474

Open
marcusburghardt wants to merge 8 commits intocomplytime:mainfrom
marcusburghardt:004-providers-repository-split
Open

feat(provider): rename pkg/plugin to pkg/provider and sweep provider terminology#474
marcusburghardt wants to merge 8 commits intocomplytime:mainfrom
marcusburghardt:004-providers-repository-split

Conversation

@marcusburghardt
Copy link
Copy Markdown
Contributor

@marcusburghardt marcusburghardt commented Apr 15, 2026

Summary

Implements specification 004 (specs/004-providers-repository-split/spec.md) — the complyctl-side changes for migrating provider implementations out of complyctl and into the standalone complytime-providers repository.

What this PR contains

  • pkg/plugin/pkg/provider/ rename (refactor(provider): rename pkg/plugin to pkg/provider and update all references): renames the SDK package, updates all import paths, renames exported types and functions (PluginProvider, LoadedPluginLoadedProvider, PluginInfoProviderInfo, PluginIDProviderID, GetPluginGetProvider, ListPluginsListProviders, LoadPluginsLoadProviders). Handshake wire values ("COMPLYCTL_PLUGIN" magic cookie, UUID) are preserved byte-for-byte — only Go identifier names change.

  • Full terminology sweep (refactor(provider): sweep remaining plugin terminology to provider): updates CLI output strings, log keys, error messages, Makefile targets, CI workflow steps, and environment variables (COMPLYCTL_PLUGIN_DIRCOMPLYCTL_PROVIDER_DIR). Carve-outs preserved: hashicorp/go-plugin library name, proto package complyctl.plugin.v1, GRPCEvaluatorPlugin struct, COMPLYCTL_PLUGIN magic cookie, api/plugin/ directory.

  • Documentation update (docs(provider): update README and AGENTS with provider terminology): updates README.md, AGENTS.md, and all docs/ content to use provider terminology; removes docs/PLUGIN_GUIDE.md and docs/man/complyctl-openscap-plugin.*.

  • Spec nit fix (fix(spec): address review nits from PR #474): updates spec.md line 26 per jpower432 review comment.

  • Phase 1 design artifacts (docs(spec): add phase 1 design artifacts for providers repository split): adds specs/004-providers-repository-split/plan.md, research.md, data-model.md, and contracts/provider-sdk.md.

  • Build fix (fix(provider): update scan.go and cli_test.go plugin references to provider): fixes cmd/complyctl/cli/scan.go and its test file — references missed during the rename because upstream's Export RPC (PR feat: add --format otel to scan command for ComplyBeacon evidence export #463) landed in the same functions during the rebase.

Rebased onto upstream/main (PR #463 Export RPC)

This branch is rebased onto upstream/main which includes the merged Export RPC changes from PR #463. Conflict resolution in pkg/provider/client.go and pkg/provider/manager.go took both sets of changes simultaneously:

  • Export types (ExportRequest, ExportResponse, CollectorConfig, Exporter interface, SupportsExport field) were preserved from upstream.
  • Provider terminology from our rename was applied on top.
  • RouteExport/resolveExporter in manager.go arrived from upstream still using plugin terminology and were corrected as part of conflict resolution.

Related Issues

Review Hints

  • Handshake wire values are frozen: the "COMPLYCTL_PLUGIN" magic cookie and the UUID constant are unchanged byte-for-byte. Only Go identifier names change. This is intentional — changing the wire values would silently break all provider connections at runtime.

  • pkg/plugin/ import path change: any external consumer importing github.com/complytime/complyctl/pkg/plugin will need to update to pkg/provider. The complytime-providers repository's go.mod uses a replace directive during development; it must be replaced with a versioned require before merging that PR (tracked as T038).

  • Proto package rename deferred: complyctl.plugin.v1complyctl.provider.v1 is explicitly deferred to a future major version. The rationale is documented in contracts/provider-sdk.md.

  • cmd/openscap-plugin/ and cmd/ampel-plugin/ removal is out of scope for this PR: that step requires complytime-providers to publish a release first. It will land in a follow-up PR after the providers repository is stable.

  • RPM spec and testing-farm configuration updates are explicitly out of scope and will be addressed in a follow-up specification.

@marcusburghardt marcusburghardt requested a review from a team as a code owner April 15, 2026 09:32
Comment thread specs/004-providers-repository-split/spec.md
jpower432
jpower432 previously approved these changes Apr 16, 2026
Copy link
Copy Markdown
Member

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

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

LGTM. Left two nits.

Comment thread specs/004-providers-repository-split/spec.md Outdated
marcusburghardt added a commit to marcusburghardt/complyctl that referenced this pull request Apr 17, 2026
- Downgrade handshake constant identifier rename from MUST to SHOULD in
  FR-013 and the related Assumptions entry; the go-plugin framework does
  not require identifier names to follow any convention, so renaming them
  is a stylistic preference with no functional impact, left to the
  implementer's discretion.
- Remove local filesystem path from the Dependencies section; the path
  was developer-machine-specific and irrelevant to other contributors.

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
jpower432
jpower432 previously approved these changes Apr 20, 2026
Copy link
Copy Markdown
Member

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

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

LGTM

hbraswelrh
hbraswelrh previously approved these changes Apr 20, 2026
Copy link
Copy Markdown
Member

@hbraswelrh hbraswelrh left a comment

Choose a reason for hiding this comment

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

LGTM.

marcusburghardt added a commit to marcusburghardt/complyctl that referenced this pull request Apr 21, 2026
- Downgrade handshake constant identifier rename from MUST to SHOULD in
  FR-013 and the related Assumptions entry; the go-plugin framework does
  not require identifier names to follow any convention, so renaming them
  is a stylistic preference with no functional impact, left to the
  implementer's discretion.
- Remove local filesystem path from the Dependencies section; the path
  was developer-machine-specific and irrelevant to other contributors.

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt marcusburghardt dismissed stale reviews from hbraswelrh and jpower432 via 0006421 April 21, 2026 11:39
@marcusburghardt marcusburghardt force-pushed the 004-providers-repository-split branch from 417767f to 0006421 Compare April 21, 2026 11:39
@marcusburghardt marcusburghardt requested review from a team as code owners April 21, 2026 12:14
@marcusburghardt marcusburghardt force-pushed the 004-providers-repository-split branch 2 times, most recently from ca1faad to 5241554 Compare April 21, 2026 15:36
marcusburghardt added a commit to marcusburghardt/complyctl that referenced this pull request Apr 21, 2026
- Downgrade handshake constant identifier rename from MUST to SHOULD in
  FR-013 and the related Assumptions entry; the go-plugin framework does
  not require identifier names to follow any convention, so renaming them
  is a stylistic preference with no functional impact, left to the
  implementer's discretion.
- Remove local filesystem path from the Dependencies section; the path
  was developer-machine-specific and irrelevant to other contributors.

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt marcusburghardt force-pushed the 004-providers-repository-split branch from 5241554 to c8fc7a0 Compare April 21, 2026 15:53
@marcusburghardt marcusburghardt changed the title feat(spec): add providers repository split specification feat(provider): rename pkg/plugin to pkg/provider and sweep provider terminology Apr 21, 2026
@marcusburghardt marcusburghardt force-pushed the 004-providers-repository-split branch from f2c66e8 to 54cac1e Compare April 21, 2026 16:10
jpower432
jpower432 previously approved these changes Apr 21, 2026
Copy link
Copy Markdown
Member

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

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

LGTM

}
```

> **Note**: `Export` is included in the interface as of the tagged complyctl SDK release that
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.

Just one clarification - a second Export interface was defined after the initial design so this could remain optional for the plugin authors.. The Export method should not be included in the Provider interface.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @gvauter . The code was good, but the documentation was not updated. Fixed ba6fc6e

```go
type DescribeRequest struct{}

type DescribeResponse struct {
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.

Nit: This type should now include SupportsExport bool as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Documentation updated.

Providers MUST implement the `Export` method but MAY return an unimplemented stub:

```go
// Stub implementation — acceptable until Export is fully supported by a provider.
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.

Nit: We droppd the need for a stub implementation by making the Export it's own interface. Plugin authors can now skip completely if they do not want to implement export logic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Documentation updated.

Add spec 004 for extracting the OpenSCAP and AMPEL providers from the
complyctl repository into the standalone complytime-providers repository.
The spec covers the full scope of the migration including: provider source
code relocation, terminology rename from 'plugin' to 'provider' across
all complyctl surfaces, complytime-providers monorepo layout (single
go.mod), CI workflow updates (ci_compliance.yml to download provider
binary from complytime-providers releases), and the pkg/plugin →
pkg/provider SDK directory rename.

RPM spec and testing-farm configuration updates are explicitly deferred
to a follow-up specification.

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
- Downgrade handshake constant identifier rename from MUST to SHOULD in
  FR-013 and the related Assumptions entry; the go-plugin framework does
  not require identifier names to follow any convention, so renaming them
  is a stylistic preference with no functional impact, left to the
  implementer's discretion.
- Remove local filesystem path from the Dependencies section; the path
  was developer-machine-specific and irrelevant to other contributors.

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Add implementation plan, research decisions, data model, provider SDK
contract, and task breakdown for the 004-providers-repository-split
feature. Also update AGENTS.md with active technology context.

Assisted-by: OpenCode (claude-sonnet-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
…references

Implement Phase 1-3 of the providers repository split:

- Rename pkg/plugin/ → pkg/provider/ with full identifier renames:
  Plugin interface → Provider, LoadedPlugin → LoadedProvider,
  PluginInfo → ProviderInfo, LoadPlugins → LoadProviders,
  GetPlugin → GetProvider, ListPlugins → ListProviders,
  DiscoverPlugins → DiscoverProviders, SupportedPlugins → SupportedProviders
- Rename internal/complytime.PluginExecutablePrefix → ProviderExecutablePrefix
  and ResolvePluginDir → ResolveProviderDir (value unchanged: complyctl-provider-)
- Update all CLI, internal, and provider source files to import pkg/provider
  and use provider terminology in identifiers, error messages, and log fields
- Rename cmd/test-plugin/ → cmd/test-provider/ and update Makefile target
  build-test-plugin → build-test-provider
- Remove docs/PLUGIN_GUIDE.md and docs/man/complyctl-openscap-plugin.* from
  complyctl (to be migrated to complytime-providers)
- Remove openscap-plugin build step and vendor step from Makefile
- Update CI workflows behavioral_assessment.yml and e2e_test.yml to use
  build-test-provider target
- Update docs/man/complyctl.md, c2p-openscap-manifest.md, INSTALLATION.md,
  QUICK_START.md, STYLE_GUIDE.md to use provider terminology throughout
- Wire values (MagicCookieKey, UUID, protocol version) are unchanged

All 19 packages build and all tests pass.

Assisted-by: OpenCode (claude-sonnet-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Update all remaining non-exempt 'plugin' references across complyctl:
- pkg/log: log field key 'plugin' → 'provider'
- pkg/provider/client.go: comments and pluginClient field → gopluginClient
- internal/doctor: pluginLogger param → providerLogger
- cmd/behavioral-report: --test-plugin flag → --test-provider
- tests/behavioral: TestPluginBinary field → TestProviderBinary; update
  local vars, comments, and runtime error string assertions
- tests/e2e: update comments, make target references, and helper messages
- .github/actions/setup-complyctl: build-test-plugin → build-test-provider
- docs/man: update plugin→provider in complyctl.md and c2p-openscap-manifest.md

Exempt from renaming: hashicorp/go-plugin library names, GRPCEvaluatorPlugin
struct (implements goplugin.Plugin interface), proto-generated names
(RegisterPluginServer, NewPluginClient, PluginClient), COMPLYCTL_PLUGIN
magic cookie wire value (frozen), and api/plugin/ proto package.

Assisted-by: OpenCode (claude-sonnet-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Remove remaining 'plugin' user-visible references from README.md
(dispatch to plugins, Plugin Guide link, generate/variables descriptions).
Update AGENTS.md to remove stale reference to cmd/openscap-plugin/go.mod.
Mark tasks T020-T053 complete in specs/004-providers-repository-split/tasks.md.

SC-001 confirmed: zero source files under cmd/openscap-plugin/ or cmd/ampel-plugin/.
SC-002 confirmed: no provider-concept 'plugin' refs in Go sources, Makefile, CI, or docs.
SC-003 confirmed: both providers build from complytime-providers.
SC-004 confirmed: go test ./... passes.
SC-007 confirmed: make build produces only complyctl CLI binary.

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
…ovider

scan.go: Replace remaining pkg/plugin import alias usages in the
export path (executeScanPhase, maybeExport, runExport, exportToPlugins,
exportSinglePlugin, exportResult) with pkg/provider equivalents.

cli_test.go: Update import from pkg/plugin to pkg/provider and rename
all pluginID field references to providerID.

These references were missed during the pkg/plugin → pkg/provider rename
because upstream's Export RPC additions (PR complytime#463) landed in the same
functions during the rebase, leaving a mix of old and new package names.

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Export WorkspaceDir from pkg/provider so provider authors can import the
canonical workspace directory name instead of duplicating it locally.
Providers in complytime-providers were hard-coding ".complytime" because
internal/complytime.WorkspaceDir is not importable by external modules.

Update contracts/provider-sdk.md to address review feedback (gvauter):
- Remove Export from the Provider interface; Export is optional via the
  separate Exporter interface (ISP design finalised in PR complytime#463)
- Add SupportsExport bool to DescribeResponse struct definition
- Replace the stub implementation example with the correct opt-in pattern:
  implement Exporter + set SupportsExport: true in DescribeResponse
- Update the contract stability table to list Exporter separately

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt marcusburghardt force-pushed the 004-providers-repository-split branch from ba6fc6e to b9d9483 Compare April 22, 2026 09:45
@marcusburghardt
Copy link
Copy Markdown
Contributor Author

All testing-farm jobs are expected to fail. The initial spec intentionally excluded RPM updates from this PR. This will be addressed in a follow-up PR once the separation is concluded. Also integration tests will be worked later.

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