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

CDEvents proposal #229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

afrittoli
Copy link

@afrittoli afrittoli commented Jun 15, 2023

Proposal to implement CDEvents (cdevents.dev) notifications for Harbor.

This proposal is not 100% complete yet, the "Implementation Design" section is TBD, and there are a few open questions.

Vad1mo
Vad1mo previously approved these changes Jun 18, 2023
Vad1mo
Vad1mo previously approved these changes Jul 4, 2023
OrlinVasilev
OrlinVasilev previously approved these changes Jul 4, 2023
Copy link
Member

@OrlinVasilev OrlinVasilev left a comment

Choose a reason for hiding this comment

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

looks great to me :)

@OrlinVasilev
Copy link
Member

@chlins can you take a look please

@OrlinVasilev OrlinVasilev requested a review from chlins July 4, 2023 12:56

### Supported Events

Harbor events support today are documented in the [webhook notification documentation][harbor-webhook].
Copy link
Member

Choose a reason for hiding this comment

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

Some events here are defined based on the functional scenarios of Harbor. CDEvents seem to have some differences compared to CloudEvents. CloudEvents only standardizes the structure of payload data without restricting event types, while CDEvents appear to have events associated with types. This means that some events in question may not be within the scope of CDEvents currently or in the future. Therefore, should we consider implementing restrictions on the frontend, allowing only specific event subscriptions for CDEvents? For example, currently, only PUSH events are supported.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @chlins - that's a great point. I think only allowing users to select available events via the UI sounds like a good option. I'm not very experienced with front-end development, so I could probably use some help there.
Another question I have related to this is whether Harbor provides users with an alternative way of configuring webhooks, i.e. not via the UI, some configuration file or API. If so, the restriction would have to be applied there too.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this is where it is not suitable at present. The original design of harbor only supports custom extensions to the payload data structure, but does not limit the event type. If only such restrictions are applied to CDEvents, it feels too specific.

Copy link
Author

Choose a reason for hiding this comment

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

Perhaps we could alter GetSupportedEventTypes to be PayloadFormat specific.

Copy link
Author

Choose a reason for hiding this comment

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

@chlins we plan to work to expand the list of events in CDEvents, but it may not match the list of events from Harbor. To that end, I will propose to the CDEvents community to introduce support in the SDKs for custom types.

In the meanwhile, given that Habor supports configuring multiple webhooks, it seems acceptable that the CDEvents ones won't send all event types, as long as we make it clear to users that only a subset of events will be sent. Would this be enough for you to move forward? Please let me know if there is any more changes I shall make to let this proposal move forward.

Proposal to implement CDEvents (cdevents.dev) notifications for Harbor.

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
@wy65701436
Copy link
Contributor

wy65701436 commented Aug 31, 2023

Due to the current limitation of CDEvents, only the "artifact.published" event is supported at the moment. Therefore, I would like to hold on this proposal for now.

In order to introduce a new format of webhook, Harbor requires that there are no disruptive changes to user behavior, both from the UI and API perspectives, and that consistency is maintained.

The dependency here is that either CDEvents should support all types of events defined on the Harbor side or provide a general method for Harbor to define customized events, whether through annotations or attributes.

Copy link
Contributor

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

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

It needs to discuss

@afrittoli
Copy link
Author

It needs to discuss

Thanks @wy65701436 - I'm happy to discuss about this - what is your preferred forum for discussion? Would that be the Harbor working group or here on the proposal or else?

@OrlinVasilev
Copy link
Member

@wy65701436 @afrittoli did you manage to figure out what is needed

@afrittoli afrittoli mentioned this pull request Nov 2, 2023
@OrlinVasilev
Copy link
Member

@afrittoli what's the progress of this one do you need anything from our side?

@afrittoli
Copy link
Author

@afrittoli what's the progress of this one do you need anything from our side?

Hi @OrlinVasilev, thanks for asking. I've been working with the CDEvents community to add:

The two features will allow covering all existing Harbor events through CDEvents, as requested.

Feel free to review the custom events proposal https://hackmd.io/LftfRirGRbKuAcLg9pdOag - I used Harbor as a case study for that.

@afrittoli
Copy link
Author

@afrittoli what's the progress of this one do you need anything from our side?

Hi @OrlinVasilev, thanks for asking. I've been working with the CDEvents community to add:

The two features will allow covering all existing Harbor events through CDEvents, as requested.

Feel free to review the custom events proposal https://hackmd.io/LftfRirGRbKuAcLg9pdOag - I used Harbor as a case study for that.

An update on this. Support for custom events was just merged in CDEvents https://github.com/cdevents/spec/tree/main/custom. We'll probably cut a release after KubeCon and then I will be able to update the proposal and implementation with support for all existing Harbor events as requested.

@Vad1mo
Copy link
Member

Vad1mo commented Apr 9, 2024

The registry: maintainers of the specifications of CDEvents custom events are encouraged to add their specification to the shared registry

@wy65701436 @chlins @OrlinVasilev can we agree upon supporting or not supporting this feature and let @afrittoli know before more time is wasted?

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.

None yet

8 participants