Skip to content

Consider adding optional fields and functions in Interfaces to avoid breaking changes in minor version updates #4775

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

Closed
1 of 2 tasks
sgohlke opened this issue Jun 7, 2024 · 2 comments
Labels

Comments

@sgohlke
Copy link

sgohlke commented Jun 7, 2024

We use opentelemetry-js in some of our projects and have a small implementation of the Span interface to be used in our unit tests. With the release of api v1.9 the Span interface contains additional non-optional fields/functions addLink and addLinks: #4528 . This broke our implementation of the interface.

While I can part of understand the reasoning stated in https://github.com/open-telemetry/opentelemetry-specification/blob/a03382ada8afa9415266a84dafac0510ec8c160f/specification/upgrading.md?plain=1#L97-L122 I would like to point out that it is possible to define optional fields/functions in interfaces. This can e.g. be used to add new logic in minor versions without breaking existing implementations and set the field/function to required in the next major version. This might come with a small drawback of a check like 'addLink' in span to ensure the function exists before calling it.

  • This only affects the JavaScript OpenTelemetry library
  • This may affect other libraries, but I would like to get opinions here first
@sgohlke sgohlke changed the title Consider adding optional fields and functions in Interfaces to avoid breaking changes Consider adding optional fields and functions in Interfaces to avoid breaking changes in minor version updates Jun 7, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Aug 12, 2024
Copy link

This issue was closed because it has been stale for 14 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant