Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[component] Change component.Type underlying type to a struct #9472

Merged
merged 4 commits into from
Mar 6, 2024

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Feb 6, 2024

Description:

Follow up to #9414 and open-telemetry/opentelemetry-collector-contrib/pull/31038.

Link to tracking Issue: Fixes #9208.

@@ -155,14 +157,18 @@ func MustNewType(strType string) Type {
// collecting metrics, traces and logs, this can expand in the future.
type DataType = Type
Copy link
Member Author

Choose a reason for hiding this comment

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

I am keeping this for now, but we can revisit once we tackle #9429

Copy link
Member Author

Choose a reason for hiding this comment

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

(The alternative is to change this to type DataType string)

Copy link
Member

Choose a reason for hiding this comment

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

It is an alias to Type because we use component.ID (which is not generic) for the pipeline.ID. Because of that we made this equal with Type.

mx-psi added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Feb 6, 2024
**Description:** Replaces usages of `component.Type(..)` by
`component.MustNewType`

**Link to tracking Issue:** Needed for
open-telemetry/opentelemetry-collector/pull/9472
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.60%. Comparing base (939c740) to head (fc1ff7d).
Report is 43 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9472      +/-   ##
==========================================
- Coverage   90.62%   90.60%   -0.02%     
==========================================
  Files         347      347              
  Lines       18238    18240       +2     
==========================================
- Hits        16528    16527       -1     
- Misses       1381     1383       +2     
- Partials      329      330       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

mx-psi added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Feb 6, 2024
@mx-psi mx-psi added needed-for-1.0 release:required-for-ga Must be resolved before GA release and removed needed-for-1.0 labels Feb 7, 2024
mx-psi added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Feb 8, 2024
…ame` when passing literal strings (#31125)

**Description:** 

Runs the following commands:

- `rg "component.NewID\(\".*?\"\)" -l | xargs sd
'component.NewID\((".*?")\)' 'component.MustNewID($1)'`
- `rg "component.NewIDWithName\(\".*?\"" -l | xargs sd
'component.NewIDWithName\((".*?")' 'component. MustNewIDWithName($1'`

Additionally, makes some manual fixes

Needed for open-telemetry/opentelemetry-collector/pull/9472

**Link to tracking Issue:**
open-telemetry/opentelemetry-collector/issues/9208
mx-psi added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Feb 8, 2024
mx-psi added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Feb 8, 2024
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
**Description:** Replaces usages of `component.Type(..)` by
`component.MustNewType`

**Link to tracking Issue:** Needed for
open-telemetry/opentelemetry-collector/pull/9472
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
…ame` when passing literal strings (open-telemetry#31125)

**Description:** 

Runs the following commands:

- `rg "component.NewID\(\".*?\"\)" -l | xargs sd
'component.NewID\((".*?")\)' 'component.MustNewID($1)'`
- `rg "component.NewIDWithName\(\".*?\"" -l | xargs sd
'component.NewIDWithName\((".*?")' 'component. MustNewIDWithName($1'`

Additionally, makes some manual fixes

Needed for open-telemetry/opentelemetry-collector/pull/9472

**Link to tracking Issue:**
open-telemetry/opentelemetry-collector/issues/9208
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
@mx-psi
Copy link
Member Author

mx-psi commented Feb 14, 2024

I think open-telemetry/opentelemetry-collector-contrib/pull/31263 should fix the remaining issues with contrib tests

@mx-psi mx-psi marked this pull request as ready for review February 14, 2024 16:52
@mx-psi mx-psi requested a review from a team as a code owner February 14, 2024 16:52
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Feb 29, 2024
mx-psi added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Mar 4, 2024
@mx-psi
Copy link
Member Author

mx-psi commented Mar 4, 2024

cc @open-telemetry/collector-approvers this is ready to review, but I won't merge this for v0.96.0, will wait until after the release

breedx-splk pushed a commit to breedx-splk/opentelemetry-collector-contrib that referenced this pull request Mar 4, 2024
@mx-psi mx-psi merged commit b269362 into open-telemetry:main Mar 6, 2024
46 checks passed
@mx-psi mx-psi deleted the mx-psi/switch-to-type branch March 6, 2024 11:56
@github-actions github-actions bot added this to the next release milestone Mar 6, 2024
mx-psi added a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Mar 6, 2024
**Description:** Include
open-telemetry/opentelemetry-collector/pull/9472

---------

Signed-off-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
samiura pushed a commit to samiura/opentelemetry-collector-contrib that referenced this pull request Mar 8, 2024
**Description:** Include
open-telemetry/opentelemetry-collector/pull/9472

---------

Signed-off-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
DougManton pushed a commit to DougManton/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
DougManton pushed a commit to DougManton/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
**Description:** Include
open-telemetry/opentelemetry-collector/pull/9472

---------

Signed-off-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
**Description:** Include
open-telemetry/opentelemetry-collector/pull/9472

---------

Signed-off-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:required-for-ga Must be resolved before GA release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restrict component identifiers character set
3 participants