Skip to content

Commit

Permalink
Merge branch 'main' into remove-checkdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Jul 31, 2023
2 parents b4bd190 + 52ec6e4 commit bfcc2c7
Show file tree
Hide file tree
Showing 36 changed files with 942 additions and 251 deletions.
16 changes: 16 additions & 0 deletions .chloggen/chloggen-multiple-logs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add ability to configure separate changelogs for different audiences

# One or more tracking issues related to the change
issues: [364]

# (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:
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
path: ~/.tools
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }}
- name: Run linters
run: make dependabot-check license-check lint
run: make multimod-verify dependabot-check license-check lint
- name: Build
run: make build
- name: Check clean repository
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ check-clean-work-tree:
.PHONY: multimod-verify
multimod-verify: $(MULTIMOD)
@echo "Validating versions.yaml"
multimod verify
$(MULTIMOD) verify

.PHONY: multimod-prerelease
multimod-prerelease: $(MULTIMOD)
multimod prerelease -s=true -v ./versions.yaml -m tools
multimod-prerelease: multimod-verify $(MULTIMOD)
$(MULTIMOD) prerelease -s=true -v ./versions.yaml -m tools
$(MAKE) tidy

COMMIT?=HEAD
Expand Down
29 changes: 24 additions & 5 deletions chloggen/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,45 @@ func entryWithSubtext() *chlog.Entry {
}
}

func entryForChangelogs(changeType string, issue int, keys ...string) *chlog.Entry {
keyStr := "default"
if len(keys) > 0 {
keyStr = strings.Join(keys, ",")
}
return &chlog.Entry{
ChangeLogs: keys,
ChangeType: changeType,
Component: "receiver/foo",
Note: fmt.Sprintf("Some change relevant to [%s]", keyStr),
Issues: []int{issue},
}
}

func setupTestDir(t *testing.T, entries []*chlog.Entry) {
require.NotNil(t, globalCfg, "test should instantiate globalCfg before calling setupTestDir")

// Create a known dummy changelog which may be updated by the test
changelogBytes, err := os.ReadFile(filepath.Join("testdata", config.DefaultChangelogMD))
// Create dummy changelogs which may be updated by the test
changelogBytes, err := os.ReadFile(filepath.Join("testdata", config.DefaultChangeLogFilename))
require.NoError(t, err)
require.NoError(t, os.WriteFile(globalCfg.ChangelogMD, changelogBytes, os.FileMode(0755)))
for _, filename := range globalCfg.ChangeLogs {
require.NoError(t, os.MkdirAll(filepath.Dir(filename), os.FileMode(0755)))
require.NoError(t, os.WriteFile(filename, changelogBytes, os.FileMode(0755)))
}

require.NoError(t, os.Mkdir(globalCfg.ChlogsDir, os.FileMode(0755)))
// Create the entries directory
require.NoError(t, os.MkdirAll(globalCfg.EntriesDir, os.FileMode(0755)))

// Copy the entry template, for tests that ensure it is not deleted
templateInRootDir := config.New("testdata").TemplateYAML
templateBytes, err := os.ReadFile(filepath.Clean(templateInRootDir))
require.NoError(t, err)
require.NoError(t, os.WriteFile(globalCfg.TemplateYAML, templateBytes, os.FileMode(0755)))

// Write the entries to the entries directory
for i, entry := range entries {
entryBytes, err := yaml.Marshal(entry)
require.NoError(t, err)
path := filepath.Join(globalCfg.ChlogsDir, fmt.Sprintf("%d.yaml", i))
path := filepath.Join(globalCfg.EntriesDir, fmt.Sprintf("%d.yaml", i))
require.NoError(t, os.WriteFile(path, entryBytes, os.FileMode(0755)))
}
}
Expand Down
2 changes: 1 addition & 1 deletion chloggen/cmd/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func newCmd() *cobra.Command {
Use: "new",
Short: "Creates new change file",
RunE: func(cmd *cobra.Command, args []string) error {
path := filepath.Join(globalCfg.ChlogsDir, cleanFileName(filename))
path := filepath.Join(globalCfg.EntriesDir, cleanFileName(filename))
var pathWithExt string
switch ext := filepath.Ext(path); ext {
case ".yaml":
Expand Down
12 changes: 6 additions & 6 deletions chloggen/cmd/new_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,27 @@ func TestNew(t *testing.T) {
var out, err string

out, err = runCobra(t, "new", "--filename", "my-change")
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.ChlogsDir, "my-change.yaml")))
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.EntriesDir, "my-change.yaml")))
assert.Empty(t, err)

out, err = runCobra(t, "new", "--filename", "some-change.yaml")
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.ChlogsDir, "some-change.yaml")))
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.EntriesDir, "some-change.yaml")))
assert.Empty(t, err)

out, err = runCobra(t, "new", "--filename", "some-change.yml")
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.ChlogsDir, "some-change.yaml")))
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.EntriesDir, "some-change.yaml")))
assert.Empty(t, err)

out, err = runCobra(t, "new", "--filename", "replace/forward/slash")
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.ChlogsDir, "replace_forward_slash.yaml")))
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.EntriesDir, "replace_forward_slash.yaml")))
assert.Empty(t, err)

out, err = runCobra(t, "new", "--filename", "not.an.extension")
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.ChlogsDir, "not.an.extension.yaml")))
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.EntriesDir, "not.an.extension.yaml")))
assert.Empty(t, err)

out, err = runCobra(t, "new", "--filename", "my-change.txt")
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.ChlogsDir, "my-change.txt.yaml")))
assert.Contains(t, out, fmt.Sprintf("Changelog entry template copied to: %s", filepath.Join(globalCfg.EntriesDir, "my-change.txt.yaml")))
assert.Empty(t, err)
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions chloggen/cmd/testdata/multiple_changelogs/CHANGELOG-API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

<!-- next version -->

## v0.45.0

### 🛑 Breaking changes 🛑

- `receiver/foo`: Some change relevant to [api] (#125)
- `receiver/foo`: Some change relevant to [user,api] (#11)

### 🚩 Deprecations 🚩

- `receiver/foo`: Some change relevant to [api] (#223)
- `receiver/foo`: Some change relevant to [user,api] (#234)

### 💡 Enhancements 💡

- `receiver/foo`: Some change relevant to [api,user] (#333)
- `receiver/foo`: Some change relevant to [api] (#555)

### 🧰 Bug fixes 🧰

- `receiver/foo`: Some change relevant to [api] (#111)
- `receiver/foo`: Some change relevant to [api] (#777)

## v0.44.0

### 🛑 Breaking changes 🛑

- `prometheusexporter`: Automatically rename metrics with units to follow Prometheus naming convention (#8950)

### 💡 Enhancements 💡

- `filterprocessor`: Ability to filter `Spans` (#6341)
- `flinkmetricsreceiver`: add attribute values to metadata #11520

### 🧰 Bug fixes 🧰

- `redactionprocessor`: respect allow_all_keys configuration (#11542)
39 changes: 39 additions & 0 deletions chloggen/cmd/testdata/multiple_changelogs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Changelog

<!-- next version -->

## v0.45.0

### 🛑 Breaking changes 🛑

- `receiver/foo`: Some change relevant to [user,api] (#11)

### 🚩 Deprecations 🚩

- `receiver/foo`: Some change relevant to [user] (#123)
- `receiver/foo`: Some change relevant to [user,api] (#234)

### 💡 Enhancements 💡

- `receiver/foo`: Some change relevant to [user] (#21)
- `receiver/foo`: Some change relevant to [api,user] (#333)

### 🧰 Bug fixes 🧰

- `receiver/foo`: Some change relevant to [user] (#32)
- `receiver/foo`: Some change relevant to [user] (#222)

## v0.44.0

### 🛑 Breaking changes 🛑

- `prometheusexporter`: Automatically rename metrics with units to follow Prometheus naming convention (#8950)

### 💡 Enhancements 💡

- `filterprocessor`: Ability to filter `Spans` (#6341)
- `flinkmetricsreceiver`: add attribute values to metadata #11520

### 🧰 Bug fixes 🧰

- `redactionprocessor`: respect allow_all_keys configuration (#11542)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Changelog

<!-- next version -->

## v0.45.0

### 🛑 Breaking changes 🛑

- `receiver/foo`: Some change relevant to [api] (#125)
- `receiver/foo`: Some change relevant to [user,api] (#11)

### 🚩 Deprecations 🚩

- `receiver/foo`: Some change relevant to [default] (#123)
- `receiver/foo`: Some change relevant to [api] (#223)
- `receiver/foo`: Some change relevant to [user,api] (#234)

### 💡 Enhancements 💡

- `receiver/foo`: Some change relevant to [default] (#21)
- `receiver/foo`: Some change relevant to [api,user] (#333)
- `receiver/foo`: Some change relevant to [api] (#555)

### 🧰 Bug fixes 🧰

- `receiver/foo`: Some change relevant to [default] (#32)
- `receiver/foo`: Some change relevant to [default] (#222)
- `receiver/foo`: Some change relevant to [api] (#111)
- `receiver/foo`: Some change relevant to [api] (#777)

## v0.44.0

### 🛑 Breaking changes 🛑

- `prometheusexporter`: Automatically rename metrics with units to follow Prometheus naming convention (#8950)

### 💡 Enhancements 💡

- `filterprocessor`: Ability to filter `Spans` (#6341)
- `flinkmetricsreceiver`: add attribute values to metadata #11520

### 🧰 Bug fixes 🧰

- `redactionprocessor`: respect allow_all_keys configuration (#11542)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Changelog

<!-- next version -->

## v0.45.0

### 🛑 Breaking changes 🛑

- `receiver/foo`: Some change relevant to [user,api] (#11)

### 🚩 Deprecations 🚩

- `receiver/foo`: Some change relevant to [default] (#123)
- `receiver/foo`: Some change relevant to [user,api] (#234)

### 💡 Enhancements 💡

- `receiver/foo`: Some change relevant to [default] (#21)
- `receiver/foo`: Some change relevant to [api,user] (#333)

### 🧰 Bug fixes 🧰

- `receiver/foo`: Some change relevant to [default] (#32)
- `receiver/foo`: Some change relevant to [default] (#222)

## v0.44.0

### 🛑 Breaking changes 🛑

- `prometheusexporter`: Automatically rename metrics with units to follow Prometheus naming convention (#8950)

### 💡 Enhancements 💡

- `filterprocessor`: Ability to filter `Spans` (#6341)
- `flinkmetricsreceiver`: add attribute values to metadata #11520

### 🧰 Bug fixes 🧰

- `redactionprocessor`: respect allow_all_keys configuration (#11542)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

<!-- next version -->

## v0.45.0

### 🛑 Breaking changes 🛑

- `receiver/foo`: Some change relevant to [api] (#125)
- `receiver/foo`: Some change relevant to [user,api] (#11)

### 🚩 Deprecations 🚩

- `receiver/foo`: Some change relevant to [api] (#223)
- `receiver/foo`: Some change relevant to [user,api] (#234)

### 💡 Enhancements 💡

- `receiver/foo`: Some change relevant to [api,user] (#333)
- `receiver/foo`: Some change relevant to [api] (#555)

### 🧰 Bug fixes 🧰

- `receiver/foo`: Some change relevant to [api] (#111)
- `receiver/foo`: Some change relevant to [api] (#777)

## v0.44.0

### 🛑 Breaking changes 🛑

- `prometheusexporter`: Automatically rename metrics with units to follow Prometheus naming convention (#8950)

### 💡 Enhancements 💡

- `filterprocessor`: Ability to filter `Spans` (#6341)
- `flinkmetricsreceiver`: add attribute values to metadata #11520

### 🧰 Bug fixes 🧰

- `redactionprocessor`: respect allow_all_keys configuration (#11542)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Changelog

<!-- next version -->

## v0.45.0

### 🛑 Breaking changes 🛑

- `receiver/foo`: Some change relevant to [user,api] (#11)

### 🚩 Deprecations 🚩

- `receiver/foo`: Some change relevant to [default] (#123)
- `receiver/foo`: Some change relevant to [user,api] (#234)

### 💡 Enhancements 💡

- `receiver/foo`: Some change relevant to [default] (#21)
- `receiver/foo`: Some change relevant to [api,user] (#333)

### 🧰 Bug fixes 🧰

- `receiver/foo`: Some change relevant to [default] (#32)
- `receiver/foo`: Some change relevant to [default] (#222)

## v0.44.0

### 🛑 Breaking changes 🛑

- `prometheusexporter`: Automatically rename metrics with units to follow Prometheus naming convention (#8950)

### 💡 Enhancements 💡

- `filterprocessor`: Ability to filter `Spans` (#6341)
- `flinkmetricsreceiver`: add attribute values to metadata #11520

### 🧰 Bug fixes 🧰

- `redactionprocessor`: respect allow_all_keys configuration (#11542)
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit bfcc2c7

Please sign in to comment.