Skip to content

Replace the Knative API dependencies with duck types - #6851

Open
michalvavrik wants to merge 3 commits into
apache:mainfrom
michalvavrik:in-review/6354
Open

michalvavrik wants to merge 3 commits into
apache:mainfrom
michalvavrik:in-review/6354

Conversation

@michalvavrik

@michalvavrik michalvavrik commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
  • I wasn't sure about this table, https://camel.apache.org/camel-k/next/concepts/dependencies.html, KEDA and Strimzi doesn't have something similar, so I used 1.20.1 which is what we test and is API of a sort, but isn't called "Knative API".
  • AI disclosure: I used Claude Opus during development, to help me iterate and find bugs and run tests in a fork CI, then refactored it and fixed few things manually before opening this PR.

@squakez squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot for the work. A few comments about the changes:

  • we can remove the mention to the knative serving version and the script that regen it
  • I don't see a strong reason to test the duck types, they are even skipped from coverage
  • I am not sure we need the entire API set. We should probably only identify those object that we use along the code and the related fields used.
  • I realize we need to restrict the work on serving API only. Eventing is deprecated on our side (just added a note to the issue)
  • Nice to see additional tests adding coverage beside the API ones, we can keep them

Overall it seems complete, we can make some cleaning to reduce the size of the API to the real code usage and the duck types unit tests. We can even keep eventing now that the work is done.

@github-actions

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 63.8% to 64.1% (+0.3%)

@squakez

squakez commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

I think we can merge this one and work on follow up issues to polish the pending points identified during the review, or do you prefer tackling them before?

@michalvavrik

Copy link
Copy Markdown
Contributor Author

I think we can merge this one and work on follow up issues to polish the pending points identified during the review, or do you prefer tackling them before?

I prepared changes you asked for yesterday, but I need to finish something else now and go over it again now that I am not tired. I'll push it as a separate commit later today and you will be able to decide if you want this new version or we can drop it and merge the original commit (or I'll address more comments of course).

@michalvavrik

Copy link
Copy Markdown
Contributor Author

There were more things that I think could be removed (Broker and Channel types and Knative Service status.url, and address). I didn't remove them because I can see preexisting tests using them.

Comment thread pkg/apis/duck/knative/apis/duck_types.go Outdated
@squakez

squakez commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

There were more things that I think could be removed (Broker and Channel types and Knative Service status.url, and address). I didn't remove them because I can see preexisting tests using them.

Thanks. Yeah, anything that is not directly used by our code can be removed. In this way we reduce the maintenance and any possible future API change to the bare minimum. Feel free to give it another shot or, if checks pass we can merge and then work on follow up issues.

@github-actions

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 63.8% to 64.1% (+0.3%)

@michalvavrik

Copy link
Copy Markdown
Contributor Author

Sorry, bit busy, I'll try to address it tomorrow.

@michalvavrik
michalvavrik force-pushed the in-review/6354 branch 2 times, most recently from ccbab94 to 9ab2459 Compare October 1, 2026 16:47
Comment thread pkg/trait/knative_test.go
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 64.4% to 64.8% (+0.4%)

@michalvavrik

Copy link
Copy Markdown
Contributor Author

Oh merge conflict for go.sum again, I thought I resolved one yesterday. I'll resolve it.

Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 64.4% to 64.8% (+0.4%)

This branch has not been deployed

No deployments
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.

Consider moving Knative API to duck types

2 participants