Skip to content

Add code for webhook dispatcher#839

Merged
Allda merged 1 commit into
mainfrom
ISV-6108
Aug 5, 2025
Merged

Add code for webhook dispatcher#839
Allda merged 1 commit into
mainfrom
ISV-6108

Conversation

@Allda

@Allda Allda commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

A dispatcher is a new component to manage incoming webhooks from Github. It accept new requests and manage a queue based on cluster capacity.

A capacity is defined as a number of running pipelines in certain namespace. This simple metrics will provide a buffer mechanism for time periods when we receive a bunk releases of operators. The mechanism keeps pending requests in the database queue and only trigger related pipeline in case of free capacity.

The solution is made of:

  • Rest API
  • Postgres database
  • Dispatcher
  • Capacity manager

JIRA: ISV-6108

Merge Request Checklists

  • Development is done in feature branches
  • Code changes are submitted as pull request into a primary branch [Provide reason for non-primary branch submissions]
  • Code changes are covered with unit and integration tests.
  • Code passes all automated code tests:
    • Linting
    • Code formatter - Black
    • Security scanners
    • Unit tests
    • Integration tests
  • Code is reviewed by at least 1 team member
  • Pull request is tagged with "risk/good-to-go" label for minor changes

@Allda Allda force-pushed the ISV-6108 branch 5 times, most recently from 3772b56 to 7d397d0 Compare July 28, 2025 14:23
@Allda Allda requested review from mavaras and wcheang July 28, 2025 14:54
@wcheang

wcheang commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

@Allda I'm on Konflux support until Wed, so I'm not sure if I'd find the time to review a long PR until Thurs. If this cannot wait, I'd suggest tagging someone else, otherwise I'll look at it Thurs.

@Allda Allda requested review from RichardPlesnik and removed request for wcheang July 28, 2025 18:47
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 30, 2025
Comment thread operator-pipeline-images/operatorcert/webhook_dispatcher/api.py Outdated
Comment thread operator-pipeline-images/operatorcert/webhook_dispatcher/dispatcher.py Outdated
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2025
A dispatcher is a new component to manage incoming webhooks from Github.
It accept new requests and manage a queue based on cluster capacity.

A capacity is defined as a number of running pipelines in certain
namespace. This simple metrics will provide a buffer mechanism for time
periods when we receive a bunk releases of operators. The mechanism
keeps pending requests in the database queue and only trigger related
pipeline in case of free capacity.

The solution is made of:
- Rest API
- Postgres database
- Dispatcher
- Capacity manager

JIRA: ISV-6108

Signed-off-by: Ales Raszka <araszka@redhat.com>
event.processing_error = None
event.processed_at = datetime.now()
event.status = "processed"
return

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.

This return seems to be redundant.

@RichardPlesnik RichardPlesnik 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.

One more nitpick, otherwise LGTM 👍 Good job with the design!

@Allda Allda merged commit 442c40f into main Aug 5, 2025
4 checks passed
@Allda Allda deleted the ISV-6108 branch August 5, 2025 12:37
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.

5 participants