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

Not enough information in replication status webhook payload #20182

Open
andrwca opened this issue Mar 28, 2024 · 0 comments
Open

Not enough information in replication status webhook payload #20182

andrwca opened this issue Mar 28, 2024 · 0 comments
Labels
area/webhook backlog kind/requirement New feature or idea on top of harbor

Comments

@andrwca
Copy link

andrwca commented Mar 28, 2024

Hey,

So we're attempting to replicate projects across Harbor instances as part of an automated process. We can do so via the REST API, and we can get back some sort of progress via webhooks.

The problem we're having is that we'd like to be informed when the replication execution completes, either successfully or unsuccessfully. Unfortunately, the replication status changed webhook seems to call back on a per artifact basis, rather than when the replication execution status changes.

This makes our code for attempting to understand when a replication is complete, and hence when a project can be used, a little messy as we either have to:

  • Store state before the webhook is created around the number of artifacts expecting to be replicated and tick them off as the webhooks callback, or
  • Grab the execution ID after the replication has been started and pass it as part of the webhook URL, but of course, we have to be careful here in case the execution completes before the webhook is setup.

Are there any other ideas around that may be better to suit our needs?

Alternatively, I can think of a couple of code change options which may help others in this situation, but I'm not yet aware of impact and effort required.

  • Add a new webhook specifically for replication execution lifecycle events (started, stopped, failed, succeeded).
  • Add the execution ID to the replication status changed payload.
  • Add the overall replication progress to the status changed payload.

Thoughts?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/webhook backlog kind/requirement New feature or idea on top of harbor
Projects
None yet
Development

No branches or pull requests

2 participants