For manually-created Control repositories, you must create a webhook so that Code
Genie can detect pull request activity and trigger automated scans and reviews
Before you begin, ensure that you have:
- Administrator access to the Control repository
- Created a Control repository manually.
- Read Code Genie documentation.
A webhook is an HTTP callback that Gitea triggers automatically when repository
events occur. When an event matches your configured trigger, Gitea sends a POST
request with a JSON payload to the Code Genie target URL. You can filter
triggers by event type and branch pattern, giving you precise control over which
pull request activities notify Code Genie.
Important: Automatic configuration of the webhook only applies to Control
repositories created through the Loop creation process. If you create a Control
repository manually, you must create the webhook yourself, as described in this
procedure. You must also configure branch protection rules and create the
.devops-loop/code-config.jsonc file for Code Genie to work
correctly.
-
Navigate to your Control repository in Gitea and click
Settings.
-
In the left navigation panel, click Webhooks under
Settings.
-
Click Add Webhook and select
Gitea from the drop-down list.
-
Configure the webhook with the following values.
- Target URL:
http://devops-code-container-mgr:3005/api/pull-request
- HTTP Method: POST
- POST Content Type:
application/json
-
Under Trigger On, select Custom
Events.
-
In the Pull Request Events section, select the following
check boxes.
- Pull Request — fires when a pull request is
opened, closed, reopened, or edited.
- Pull Request Synchronized — fires when new
commits are pushed to an open pull request.
-
In the Branch Filter field, enter
* to
apply the webhook to all branches.
To restrict to specific branches, use a glob pattern such as
master or {master,release*}.
-
Click Add Webhook to save the configuration.
-
Confirm that the webhook appears in the Webhooks list
with a green status indicator.
You have created a webhook on the Control repository. Gitea will now send a POST
request to Code Genie each time a pull request is opened or synchronized on the
repository.
After creating the webhook, you must complete the remaining manual configuration
steps before Code Genie can scan pull requests:
- Configure branch protection rules for the main branch.
- Create the .devops-loop/code-config.jsonc file in the
Control repository to enable Trivy scanning and AI code review with
CoPilot.