Skip to content

Commit

Permalink
Split confmap into its own module (#6199)
Browse files Browse the repository at this point in the history
* Split confmap into its own module

Signed-off-by: Juraci Paixão Kröhling <[email protected]>

* Add confmap to builder test

Signed-off-by: Juraci Paixão Kröhling <[email protected]>

* Add missing replace statement

Signed-off-by: Juraci Paixão Kröhling <[email protected]>

* Set go version to 1.18 on confmap

Signed-off-by: Juraci Paixão Kröhling <[email protected]>

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling authored Dec 1, 2022
1 parent 7404802 commit 2bdff61
Show file tree
Hide file tree
Showing 23 changed files with 485 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .chloggen/split-confmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: confmap

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Splitting confmap into its own module

# One or more tracking issues or pull requests related to the change
issues: [6185]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |-
The import path for the confmap module can now be access directly:
- `go.opentelemetry.io/collector/confmap`
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ updates:
directory: "/component"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/confmap"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/consumer"
schedule:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ check-contrib:
@echo Setting contrib at $(CONTRIB_PATH) to use this core checkout
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector=$(CURDIR)"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector/component=$(CURDIR)/component"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector/confmap=$(CURDIR)/confmap"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector/consumer=$(CURDIR)/consumer"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector/exporter/loggingexporter=$(CURDIR)/exporter/loggingexporter"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector/exporter/otlpexporter=$(CURDIR)/exporter/otlpexporter"
Expand All @@ -331,6 +332,7 @@ restore-contrib:
@echo Restoring contrib at $(CONTRIB_PATH) to its original state
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector/component"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector/confmap"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector/consumer"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector/exporter/loggingexporter"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector/exporter/otlpexporter"
Expand Down
1 change: 1 addition & 0 deletions cmd/builder/internal/builder/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestGenerateAndCompileDefault(t *testing.T) {
workspaceDir := filepath.Dir(filepath.Dir(filepath.Dir(filepath.Dir(filepath.Dir(thisFile)))))
cfg.Replaces = append(cfg.Replaces, fmt.Sprintf("go.opentelemetry.io/collector => %s", workspaceDir))
cfg.Replaces = append(cfg.Replaces, fmt.Sprintf("go.opentelemetry.io/collector/component => %s/component", workspaceDir))
cfg.Replaces = append(cfg.Replaces, fmt.Sprintf("go.opentelemetry.io/collector/confmap => %s/confmap", workspaceDir))

assert.NoError(t, cfg.Validate())
assert.NoError(t, cfg.SetGoPath())
Expand Down
1 change: 1 addition & 0 deletions cmd/builder/test/core.builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ exporters:
replaces:
- go.opentelemetry.io/collector => ${WORKSPACE_DIR}
- go.opentelemetry.io/collector/component => ${WORKSPACE_DIR}/component
- go.opentelemetry.io/collector/confmap => ${WORKSPACE_DIR}/confmap
1 change: 1 addition & 0 deletions cmd/otelcorecol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ processors:
replaces:
- go.opentelemetry.io/collector => ../../
- go.opentelemetry.io/collector/component => ../../component
- go.opentelemetry.io/collector/confmap => ../../confmap
- go.opentelemetry.io/collector/consumer => ../../consumer
- go.opentelemetry.io/collector/exporter/loggingexporter => ../../exporter/loggingexporter
- go.opentelemetry.io/collector/exporter/otlpexporter => ../../exporter/otlpexporter
Expand Down
3 changes: 3 additions & 0 deletions cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ require (
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector/confmap v0.66.0 // indirect
go.opentelemetry.io/collector/consumer v0.66.0 // indirect
go.opentelemetry.io/collector/featuregate v0.66.0 // indirect
go.opentelemetry.io/collector/pdata v0.66.0 // indirect
Expand Down Expand Up @@ -93,6 +94,8 @@ replace go.opentelemetry.io/collector => ../../

replace go.opentelemetry.io/collector/component => ../../component

replace go.opentelemetry.io/collector/confmap => ../../confmap

replace go.opentelemetry.io/collector/consumer => ../../consumer

replace go.opentelemetry.io/collector/exporter/loggingexporter => ../../exporter/loggingexporter
Expand Down
3 changes: 3 additions & 0 deletions component/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.18
require (
github.com/stretchr/testify v1.8.1
go.opentelemetry.io/collector v0.66.0
go.opentelemetry.io/collector/confmap v0.66.0
go.opentelemetry.io/collector/consumer v0.66.0
go.opentelemetry.io/collector/pdata v0.66.0
go.opentelemetry.io/otel/metric v0.33.0
Expand Down Expand Up @@ -39,6 +40,8 @@ require (

replace go.opentelemetry.io/collector => ../

replace go.opentelemetry.io/collector/confmap => ../confmap

replace go.opentelemetry.io/collector/consumer => ../consumer

replace go.opentelemetry.io/collector/featuregate => ../featuregate
Expand Down
1 change: 1 addition & 0 deletions confmap/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../Makefile.Common
23 changes: 23 additions & 0 deletions confmap/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module go.opentelemetry.io/collector/confmap

go 1.18

require (
github.com/knadh/koanf v1.4.4
github.com/magiconair/properties v1.8.6
github.com/mitchellh/mapstructure v1.5.0
github.com/stretchr/testify v1.8.1
go.opentelemetry.io/collector/featuregate v0.65.0
go.uber.org/multierr v1.8.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
)

replace go.opentelemetry.io/collector/featuregate => ../featuregate
Loading

0 comments on commit 2bdff61

Please sign in to comment.