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

CI: check apidiff once v1beta1 is released #1860

Closed
EmilienM opened this issue Feb 5, 2024 · 6 comments · Fixed by #2096
Closed

CI: check apidiff once v1beta1 is released #1860

EmilienM opened this issue Feb 5, 2024 · 6 comments · Fixed by #2096
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@EmilienM
Copy link
Contributor

EmilienM commented Feb 5, 2024

/kind feature

Describe the solution you'd like
Once we release CAPO v1beta1, our API should remain stable.

One way to check that in CI is to use github.com/joelanford/go-apidiff as it's already done in other providers.
We could add a job that will run apidiff against PR and return an error if the API change is major and not minor.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 5, 2024
@mdbooth
Copy link
Contributor

mdbooth commented Feb 22, 2024

This is a great idea in principal. I'm not convinced this specific library will help us, though, as it seems to be checking Go semantics rather than K8S semantics, and could therefore give us both false-positives (e.g. altering a Go field in a manner which doesn't affect the CRD) and false-negatives (e.g. altering a kubebuilder marker in a comment which is not visible in the Go semantics, but does alter the CRD).

That said, in light of #1891 we may want to start caring about the former, which we have not done previously.

@EmilienM
Copy link
Contributor Author

Azure has it:
https://prow.k8s.io/job-history/gs/kubernetes-jenkins/pr-logs/directory/pull-cluster-api-provider-azure-apidiff

And the way they use it is pretty smart:
https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-azure/4585/pull-cluster-api-provider-azure-apidiff/1760447267543715840/build-log.txt

+ WRAPPED_COMMAND_PID=18
+ wait 18
+ ./scripts/ci-apidiff.sh
*** Running go-apidiff ***
No files under api/ or exp/api/ changed.
+ EXIT_VALUE=0
+ set +o xtrace

So I really propose that we find a way to have something similar.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 22, 2024
@EmilienM
Copy link
Contributor Author

/remove-lifecycle stale
/assign EmilienM

This one is close to my heart, I'll take care of it.

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 22, 2024
@lentzi90
Copy link
Contributor

I think we should care about the Go API also, so this would be useful.

@mdbooth
Copy link
Contributor

mdbooth commented May 23, 2024

It would be good to agree the scope of our Go stability guarantees.

We should probably also switch to proper semver for CAPO releases to account for breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants