Skip to content

Conversation

@legendecas
Copy link
Member

Which problem is this PR solving?

Short description of the changes

Given that applying the private access modifier could be a potential breaking change, this does not apply the rule to every package to reduce the burden of reviewers.

  • Apply rule @typescript-eslint/explicit-member-accessibility to (non-instrumentation) packages (less changes).

@github-actions
Copy link
Contributor

This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature.
Are you familiar with this package? Consider becoming a component owner.

private readonly DEFAULT_CGROUP_V2_PATH = '/proc/self/mountinfo';
private readonly UTF8_UNICODE = 'utf8';
private readonly HOSTNAME = 'hostname';
private readonly MARKING_PREFIX = ['containers', 'overlay-containers'];
Copy link
Member

Choose a reason for hiding this comment

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

Nice cleanup, looks like those constants aren't used here and are already being exported in utils.

Copy link
Member

@JamieDanielson JamieDanielson left a comment

Choose a reason for hiding this comment

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

Should this be marked as breaking since there are some private modifiers being added in where they weren't previously?

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Looks good overall, but I think we may have to undo the changes from public to private in packages/resource-detector-aws, as the package is already stable.

@legendecas
Copy link
Member Author

There are _ prefixed methods in packages/resource-detector-aws with implicit public accessibility. Should we mark these methods as private?

async _gatherData(): Promise<DetectedResourceAttributes> {

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

There are _ prefixed methods in packages/resource-detector-aws with implicit public accessibility. Should we mark these methods as private?

async _gatherData(): Promise<DetectedResourceAttributes> {

Looking into this again, it looks like the classes themselves are actually not exported. Only instances of it are, which makes adding private have less impact overall. So I think it'd be okay to describe this as a type-level bugfix use private here (current diff). 🙂

Note: I did this (making them as private) in #3242 because I knew it was an experimental package and it would end up in the breaking change section. I think the safest would be to use explicit public instead of private in this PR. Then in a second PR we can change methods that were intended as private methods to be actually private as a fix!:. This way the changelog will explicitly points it out as a breaking change. The version is then also auto-incremented as if we had merged a feat:. We could in that PR also leave the AWS detectors as-is (with the "incorrect" public modifiers) and wait for 3.0 to make them private.

Though I'm not convinced I would be worth the effort. So I'm actually okay with going as it is now 👍

@legendecas
Copy link
Member Author

Actually, I think it makes sense to revert the private on implicit fields. But I kept the _method as private.

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.