eventing icon indicating copy to clipboard operation
eventing copied to clipboard

Create validation function for cross namespace referencing

Open yijie-04 opened this issue 1 year ago • 13 comments

Fixes #7797

Proposed Changes

  • :gift: New package created for cross namespace referencing and added validation.go

Pre-review Checklist

  • [ ] At least 80% unit test coverage
  • [ ] E2E tests for any new behavior
  • [ ] Docs PR for any user-facing impact
  • [ ] Spec PR for any new API feature
  • [ ] Conformance test for any change to the spec

Release Note


Docs

yijie-04 avatar Mar 25 '24 15:03 yijie-04

\cc @Cali0707 @pierDipi

yijie-04 avatar Mar 25 '24 15:03 yijie-04

\cc @Cali0707 @pierDipi

the bot expects the forward slash /cc @Cali0707 @pierDipi

pierDipi avatar Mar 25 '24 15:03 pierDipi

@yijie-04 if you look at the comments the github actions left on your code, you'll see that there are a few unused/undefined variables that are causing the build to fail. Would you be able to fix those?

Cali0707 avatar Apr 03 '24 18:04 Cali0707

Codecov Report

Attention: Patch coverage is 17.80822% with 60 lines in your changes are missing coverage. Please review.

Project coverage is 69.29%. Comparing base (7e1c082) to head (3e323a0). Report is 21 commits behind head on main.

Files Patch % Lines
pkg/crossnamespace/validation.go 0.00% 46 Missing :warning:
pkg/apis/eventing/v1/trigger_types.go 0.00% 4 Missing :warning:
pkg/apis/eventing/v1/trigger_validation.go 66.66% 3 Missing and 1 partial :warning:
pkg/apis/messaging/v1/subscription_validation.go 0.00% 3 Missing and 1 partial :warning:
pkg/apis/messaging/v1/subscription_types.go 0.00% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7812      +/-   ##
==========================================
+ Coverage   69.22%   69.29%   +0.07%     
==========================================
  Files         339      341       +2     
  Lines       19494    15808    -3686     
==========================================
- Hits        13494    10954    -2540     
+ Misses       5337     4182    -1155     
- Partials      663      672       +9     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 03 '24 20:04 codecov[bot]

I wrote down some notes as comments in the files, I'll clean them up in the end!

yijie-04 avatar Apr 10 '24 01:04 yijie-04

/retest-required

Cali0707 avatar Apr 10 '24 20:04 Cali0707

@yijie-04 this is great! I think this might be ready to review and merge, what do you think?

Also cc @pierDipi , anything you see in this PR that needs changing?

Sounds good! I'll clean up the comments. For checking the pointer, I'll just return an empty kreference?

yijie-04 avatar Apr 10 '24 21:04 yijie-04

@yijie-04 if you think this is ready, feel free to remove the [WIP] from the title, that should remove the hold label. You can also comment /unhold!

Cali0707 avatar Apr 12 '24 18:04 Cali0707

/unhold

yijie-04 avatar Apr 13 '24 00:04 yijie-04

@Cali0707 @pierDipi I think the unit tests are all passing now! I originally had a test checking if the namespace is empty or is missing, I just want to confirm that this would not be necessary since we would just assume it's the same as the object namespace?

yijie-04 avatar Apr 23 '24 05:04 yijie-04

/unhold

Cali0707 avatar Apr 23 '24 13:04 Cali0707

@yijie-04 this looks really good so far! Would you be able to also add some unit tests to the trigger validation, similar to what you did for the subscription?

Cali0707 avatar Apr 23 '24 13:04 Cali0707

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, yijie-04

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

knative-prow[bot] avatar Apr 28 '24 20:04 knative-prow[bot]