Skip to content

BREAKING CHANGE: Refactor plugin system to version 3#34

Open
mimuret wants to merge 3 commits intov3from
feature/v3.0.0
Open

BREAKING CHANGE: Refactor plugin system to version 3#34
mimuret wants to merge 3 commits intov3from
feature/v3.0.0

Conversation

@mimuret
Copy link
Copy Markdown
Owner

@mimuret mimuret commented Jul 27, 2025

  • Changed message processing flow to be configurable on a per-plugin basis, and deprecated Global Filter and OutputGroup settings
  • Changed configuration format from YAML/JSON to HCL

- Changed message processing flow to be configurable on a per-plugin basis, and deprecated Global Filter and OutputGroup settings
- Changed configuration format from YAML/JSON to HCL
@mimuret mimuret requested a review from Copilot July 28, 2025 15:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a breaking change to refactor the plugin system from version 2 to version 3, transitioning from YAML/JSON configuration to HCL format. The key changes include restructuring message processing to be configurable per-plugin, removing global filter and output group settings, and updating all output plugins to support the new HCL-based configuration system.

  • Migrated configuration format from YAML/JSON to HashiCorp Configuration Language (HCL)
  • Refactored plugin architecture to support per-plugin message processing flow
  • Updated all output plugins to use new configuration structure and interface changes

Reviewed Changes

Copilot reviewed 166 out of 173 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/dtap1/conf/dtap.hcl Adds new HCL configuration for DTAP 1 test setup with input file and multiple outputs
test/dtap2/conf/dtap.hcl Adds new HCL configuration for DTAP 2 test setup with multiple inputs and stdout output
test/compose.yml Adds Docker Compose configuration for testing the new system
schemas/*.json Removes old JSON schema files for validation
pkg/types/interface.go Updates plugin interfaces to use new context-based pattern
pkg/plugin/registry/plugin_registry.go Changes plugin setup functions to accept config blocks instead of raw JSON
pkg/plugin/output/*/config-schema.json Removes JSON schema files for all output plugins
pkg/plugin/output//.go Updates all output plugins to use HCL configuration and new interfaces
pkg/plugin/pub/*.go Updates publisher interfaces to accept context parameters
Comments suppressed due to low confidence (2)

test/dtap1/conf/dtap.hcl:31

  • Inconsistent indentation: using tab instead of spaces like the rest of the file.
	template = "{{ .Message.Timestamp }} in:{{ index .Labels \"input_plugin\" }} {{ .Message.Type }} {{ .Message.Qclass }} {{ .Message.Qtype }} {{ .Message.Qname }}"

test/dtap2/conf/dtap.hcl:30

  • Inconsistent indentation: using tab instead of spaces like the rest of the file.
	template = "{{ .Message.Timestamp }} in:{{ index .Labels \"input_plugin\" }} {{ .Message.Type }} {{ .Message.Qclass }} {{ .Message.Qtype }} {{ .Message.Qname }}"

}
}

func (d *DnstapMessage) SetOuputAttributes(res map[string]string, keys []string) error {
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

Typo in function name: 'SetOuputAttributes' should be 'SetOutputAttributes'.

Suggested change
func (d *DnstapMessage) SetOuputAttributes(res map[string]string, keys []string) error {
func (d *DnstapMessage) SetOutputAttributes(res map[string]string, keys []string) error {

Copilot uses AI. Check for mistakes.
var _ output.SocketOutput = &TCP{}

// The TCP plugin outputs messages to the tcp server.
// Eample configuration:
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

Typo in comment: 'Eample' should be 'Example'.

Suggested change
// Eample configuration:
// Example configuration:

Copilot uses AI. Check for mistakes.
Plugin
Start(context.Context, *OutputContext) error
Start(context.Context, Reader) error
// 同時実行可能数を取得する
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

Comment is in Japanese instead of English. Should be translated for consistency with the rest of the codebase.

Suggested change
// 同時実行可能数を取得する
// Get the maximum number of concurrent executions

Copilot uses AI. Check for mistakes.
return
}
labels := make(map[string]string, len(p.MessageLabels))
err := dm.SetOuputAttributes(labels, p.MessageLabels)
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

Typo in method call: 'SetOuputAttributes' should be 'SetOutputAttributes'.

Suggested change
err := dm.SetOuputAttributes(labels, p.MessageLabels)
err := dm.SetOutputAttributes(labels, p.MessageLabels)

Copilot uses AI. Check for mistakes.
}
}
labels := make(map[string]string, len(f.messageLabels))
if err := dm.SetOuputAttributes(labels, f.messageLabels); err != nil {
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

Typo in method call: 'SetOuputAttributes' should be 'SetOutputAttributes'.

Suggested change
if err := dm.SetOuputAttributes(labels, f.messageLabels); err != nil {
if err := dm.SetOutputAttributes(labels, f.messageLabels); err != nil {

Copilot uses AI. Check for mistakes.
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.

2 participants