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

[chore][VERSIONING.md] Document approach to optional experimental interfaces #11482

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Oct 18, 2024

Description

Documents the approach we have taken for adding experimental functionality to interfaces. We take this approach with:

In these cases we reserve the right to change the optional, experimental parts of the underlying struct we return. You can also check whether you are using experimental functionality by checking your go.mod and seeing if you use one of these experimental modules.

@mx-psi mx-psi requested a review from a team as a code owner October 18, 2024 08:01
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.48%. Comparing base (68e1000) to head (564e0dc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11482   +/-   ##
=======================================
  Coverage   91.48%   91.48%           
=======================================
  Files         433      433           
  Lines       23617    23617           
=======================================
  Hits        21607    21607           
  Misses       1642     1642           
  Partials      368      368           

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

@@ -62,6 +62,9 @@ Unless otherwise specified in the documentation, the following may change in any
* **Protocol compatibility**. Changing the default minimum version of a supported protocol (e.g. TLS) or dropping support for protocols when there are security concerns is not considered a breaking change.
* **Dependency updates**. Updating dependencies is not considered a breaking change except when their types are part of the
public API or the update may change the behavior of applications in an incompatible way.
* **Underlying type for interfaces**. If a struct exported as an interface has an experimental
method, this method may change or be removed in a minor version. The method will be published in an
optional interface under an experimental module to signal it is experimental.
Copy link
Member

Choose a reason for hiding this comment

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

Should the method also be documented as experimental?

Copy link
Member Author

Choose a reason for hiding this comment

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

If the method is in an experimental module (one released under v0.x), do you think this is needed?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, sorry, I thought you were allowing struct methods to be defined in stable modules, as long as they were defined in experimental interfaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, still confused 😅 To make it more clear: let's talk about the case of the otlpreceiver.NewFactory function.

The NewFactory function returns receiver.Factory. The underlying struct that is returned by this function also implements the receiverprofiles.Factory interface. I want to make sure we write down that it is fine to change the extra methods in receiverprofiles.Factory (i.e. CreateProfiles) in a minor version. How can we best write this?

Right now, since receiverprofiles.Factory is in a different module it can remain 0.x while the receiver module goes 1.x, and this rule allows changes in CreateProfiles. Is this okay? I am not sure in this question:

Should the method also be documented as experimental?

where that method would be documented as experimental

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants