-
Notifications
You must be signed in to change notification settings - Fork 327
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
CI check for Standard.Base
API changes via snapshotting
#10507
Comments
Prepare a design for review, Pavel. |
As part of library compilation, we already generate cached Suggestions. They are later sent to the IDE in JSON format. The sigfile can thus be a JSON-formatted |
|
The output format could be a simplified
with such an infrastructure we would then:
|
Standard.Base
API changes via snapshotting
Reordering methods/types in a module is not an API change. That is why the API signature generator should sort the markdown file. That will not only fix this case, but also provide better readability. We just have to stick to a certain ordering convention. |
Using |
Pavel Marek reports a new STANDUP for yesterday (2025-01-27): Progress: - Started to work on #10507
|
Important note to remember for some follow-up PRs: Exports should be part of the API. |
There should be no API file generated for synthetical and empty modules. In other words, there should be no empty |
Pavel Marek reports a new STANDUP for today (2025-01-29): Progress: - The preparation PR for the CI job is ready to review: #12175 It should be finished by 2025-02-04. |
Pavel Marek reports a new STANDUP for today (2025-01-31): Progress: - Generated API signatures in - #12203
|
Stability of Enso APIs, encapsulation of internals, detection of accidental API changes are of great value for Enso customers. Helping Enso runtime developers keeping these values is of high priority.
enso --docs
option & signature generator #10291Standard.Base.Meta
#12031 (comment)There have been two recent developments demonstrating how easy API snapshotting is and how it can be used in tests to ensure stability of API of a single module. The goal of this PR is to scale this up and apply such an API snapshotting to the whole
Standard.Base
and its APIs.Steps
First of all we need to do few manual steps to prepare the infrastructure:
Generate API Snapshot
Executing following command:
sbt:enso> runEngineDistribution --docs=api --in-project distribution/lib/Standard/Base/0.0.0-dev/
generates
distribution/lib/Standard/Base/0.0.0-dev/docs/api/
directory with a lot of API signatures of publicly accessible modules.Store in Version Control
Let's put the current snapshot under version control:
enso$ git add distribution/lib/Standard/Base/0.0.0-dev/docs/ enso$ git commit -m "Initial snapshot of Standard.Base APIs"
The CI Check
Now we need to modify the CI to perform the check. E.g. to execute:
sbt:enso> runEngineDistribution --docs=api --in-project distribution/lib/Standard/Base/0.0.0-dev/ enso$ git diff --exit-code distribution/lib/Standard/Base/0.0.0-dev/docs/api/
The first command re-generates the
Standard.Base
API snapshot according to latest state of the.enso
code. The second command checks for any differences. It succeeds if there are no differences. It fails with exit code1
when any differences is found. In such case let us fail the CI build.CI Failed. What Shall I do Now?
Once the above is implemented, we are likely to see the CI check to fail. Failing is good! Failure of this check means: we have discovered an unintended API change. Unintended API changes are bad. Thus detecting them is good!
Anyway, we need to fix the CI to be green. Here are the tips:
private
to the top of the.enso
file containing the changeprivate
Intentional API Change
When an API change is intended, it is not only changing the
.enso
code, but it is also updating the API snapshot. The simplest way to update the API snapshot is to regenerate it:sbt:enso> runEngineDistribution --docs=api --in-project distribution/lib/Standard/Base/0.0.0-dev/
then review the changes via
git diff
and if they seem OK, integrate them into your PR.Prior Work
Inspiration from NetBeans:
The text was updated successfully, but these errors were encountered: