Skip to content

Commit

Permalink
[extension/filestorage] enable feature gate `extension.filestorage.re…
Browse files Browse the repository at this point in the history
…placeUnsafeCharacters` (#30755)

**Description:**

Moves the feature gate `extension.filestorage.replaceUnsafeCharacters`
to Beta stage, which means it is now enabled by default. This is
according to the schedule for this feature gate described in the File
Storage extension's
[README](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.92.0/extension/storage/filestorage/README.md#extensionfilestoragereplaceunsafecharacters).

**Link to tracking Issue:**

-
#3148

**Testing:**

Updated tests to not require enabling of the feature gate.

**Documentation:**

Updated version in which feature gate was moved to Beta.
  • Loading branch information
andrzej-stencel committed Jan 24, 2024
1 parent 0166328 commit d316a95
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
29 changes: 29 additions & 0 deletions .chloggen/file-storage-feature-beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use this changelog template to create an entry for release notes.

# 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. filelogreceiver)
component: extension/filestorage

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Replace path-unsafe characters in component names

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [3148]

# (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 feature gate `extension.filestorage.replaceUnsafeCharacters` is now enabled by default.
See the File Storage extension's README for details.
# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
2 changes: 1 addition & 1 deletion extension/storage/filestorage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ For more details, see the following issues:
The schedule for this feature gate is:

- Introduced in v0.87.0 (October 2023) as `alpha` - disabled by default.
- Moved to `beta` in January 2024 - enabled by default.
- Moved to `beta` in v0.92.0 (January 2024) - enabled by default.
- Moved to `stable` in April 2024 - cannot be disabled.
- Removed three releases after `stable`.

Expand Down
2 changes: 1 addition & 1 deletion extension/storage/filestorage/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

var replaceUnsafeCharactersFeatureGate = featuregate.GlobalRegistry().MustRegister(
"extension.filestorage.replaceUnsafeCharacters",
featuregate.StageAlpha,
featuregate.StageBeta,
featuregate.WithRegisterDescription("When enabled, characters that are not safe in file paths are replaced in component name using the extension. For example, the data for component `filelog/logs/json` will be stored in file `receiver_filelog_logs~007Ejson` and not in `receiver_filelog_logs/json`."),
featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/3148"),
featuregate.WithRegisterFromVersion("v0.87.0"),
Expand Down
4 changes: 0 additions & 4 deletions extension/storage/filestorage/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/extension/experimental/storage"
"go.opentelemetry.io/collector/extension/extensiontest"
"go.opentelemetry.io/collector/featuregate"
)

func TestExtensionIntegrity(t *testing.T) {
Expand Down Expand Up @@ -223,9 +222,6 @@ func TestSanitize(t *testing.T) {
}

func TestComponentNameWithUnsafeCharacters(t *testing.T) {
err := featuregate.GlobalRegistry().Set("extension.filestorage.replaceUnsafeCharacters", true)
require.NoError(t, err)

tempDir := t.TempDir()

f := NewFactory()
Expand Down

0 comments on commit d316a95

Please sign in to comment.