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

fix(instrumentation-aws-lambda): add 'lint:semconv-deps' #2569

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

trentm
Copy link
Contributor

@trentm trentm commented Nov 30, 2024

This adds a lint step that checks that packages in the workspace
are following our 'rule' that uses of the semconv pkg 'incubating'
entry-point should pin the '@opentelemetry/semantic-conventions'
dep. This is because (though rare) the incubating/unstable
semconv exports can have breaking changes in minors.

Refs: #2549 (comment)
Refs: open-telemetry/opentelemetry-js#5182


That "rule" (to pin the semconv package dep when using the incubating entry-point) is the concensus from discussion on open-telemetry/opentelemetry-js#5182
I'm proposing this extra lint step (added to npm run lint) that will help check that this rule is followed.

This adds a lint step that checks that packages in the workspace
are following our 'rule' that uses of the semconv pkg 'incubating'
entry-point should *pin* the '@opentelemetry/semantic-conventions'
dep. This is because (though rare) the incubating/unstable
semconv exports can have breaking changes in minors.

Refs: open-telemetry#2549 (comment)
Refs: open-telemetry/opentelemetry-js#5182
@trentm trentm self-assigned this Nov 30, 2024
@trentm trentm requested a review from a team as a code owner November 30, 2024 00:58
@trentm
Copy link
Contributor Author

trentm commented Nov 30, 2024

Currently there is one package that is breaking this rule:

% npm run lint:semconv-deps

> [email protected] lint:semconv-deps
> ./scripts/lint-semconv-deps.mjs

lint-semconv-deps error: package @opentelemetry/instrumentation-aws-lambda (in plugins/node/opentelemetry-instrumentation-aws-lambda) imports "@opentelemetry/semantic-conventions/incubating" but does not *pin* the dependency: `"@opentelemetry/semantic-conventions": "^1.27.0"`

% echo $?
1

I'll update that dep in a commit on this PR.

@trentm trentm changed the title chore: add 'lint:semconv-deps' fix(instrumentation-aws-lambda): add 'lint:semconv-deps' Nov 30, 2024
Copy link

codecov bot commented Nov 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.75%. Comparing base (8bfa21f) to head (7d9a8c2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2569   +/-   ##
=======================================
  Coverage   90.75%   90.75%           
=======================================
  Files         169      169           
  Lines        8018     8018           
  Branches     1632     1632           
=======================================
  Hits         7277     7277           
  Misses        741      741           

Copy link
Contributor

@trivikr trivikr left a comment

Choose a reason for hiding this comment

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

Should instrumentation-aws-lambda be removed from commit message since the script is global?

@trentm
Copy link
Contributor Author

trentm commented Dec 3, 2024

Should instrumentation-aws-lambda be removed from commit message since the script is global?

This includes a change to instrumentation-aws-lambda's package.json#dependencies for which there should be a new version of this package, so I think it should stay. IIRC keeping it in the commit title is what gets the release process to notice that there should be a new version of this package.

Copy link
Contributor

@jj22ee jj22ee left a comment

Choose a reason for hiding this comment

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

Approving update to instrumentation-aws-lambda's package.json.

@trentm
Copy link
Contributor Author

trentm commented Dec 12, 2024

Given the decision here: open-telemetry/opentelemetry-js#5182 (comment)
(and the coming docs for that: open-telemetry/opentelemetry-js#5256), I'll be changing this PR so that the linting breaks if the semconv 'incubating' is used at all in runtime code.

@trentm trentm marked this pull request as draft December 12, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants