Files
ruslan 7c3e1c1b47 Fix webhook tests (#9708)
<!-- Raise an issue to propose your change
(https://github.com/cvat-ai/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution guide](https://docs.cvat.ai/docs/contributing/).
-->

This PR replaces `example.com` domain name with the new alias
`webhooks.internal` that exists inside a docker network. Previously
tests failed often because example.com does not return any response for
some requests, RQ had webhooks jobs that tried to finish within 10
seconds, but also failed due to timeout.

Also since there are webhooks created in a DB, they try to reach
example.com when a cluster starts, that sometimes fills up the worker's
queue.

Usage of subdomain is important because Django URL matcher does not
allow domains like `webhooks`

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [ ] I submit my changes into the `develop` branch
- [ ] I have created a changelog fragment <!-- see top comment in
CHANGELOG.md -->
- [ ] I have updated the documentation accordingly
- [ ] I have added tests to cover my changes
- [ ] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))

### License

- [ ] I submit _my code changes_ under the same [MIT License](
https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.
2025-08-13 13:41:41 +02:00

138 lines
3.6 KiB
JSON

{
"count": 4,
"next": null,
"previous": null,
"results": [
{
"content_type": "application/json",
"created_date": "2022-09-29T08:00:48.440000Z",
"description": "",
"enable_ssl": true,
"events": [
"create:comment",
"create:invitation",
"create:issue",
"create:project",
"create:task",
"delete:comment",
"delete:invitation",
"delete:issue",
"delete:membership",
"delete:project",
"delete:task",
"update:comment",
"update:issue",
"update:job",
"update:membership",
"update:organization",
"update:project",
"update:task"
],
"id": 6,
"is_active": true,
"last_delivery_date": "2023-09-15T07:53:53.135000Z",
"last_status": 200,
"organization": 1,
"owner": {
"first_name": "Admin",
"id": 1,
"last_name": "First",
"url": "http://localhost:8080/api/users/1",
"username": "admin1"
},
"project_id": null,
"target_url": "http://webhooks.internal/",
"type": "organization",
"updated_date": "2022-09-29T08:00:48.441000Z",
"url": "http://localhost:8080/api/webhooks/6"
},
{
"content_type": "application/json",
"created_date": "2022-09-28T12:19:49.744000Z",
"description": "",
"enable_ssl": true,
"events": [
"create:issue",
"delete:issue",
"update:issue",
"update:project"
],
"id": 3,
"is_active": true,
"organization": 2,
"owner": {
"first_name": "User",
"id": 3,
"last_name": "Second",
"url": "http://localhost:8080/api/users/3",
"username": "user2"
},
"project_id": 3,
"target_url": "http://webhooks.internal",
"type": "project",
"updated_date": "2022-09-28T12:19:49.744000Z",
"url": "http://localhost:8080/api/webhooks/3"
},
{
"content_type": "application/json",
"created_date": "2022-09-28T12:18:12.412000Z",
"description": "",
"enable_ssl": true,
"events": [
"create:comment",
"create:issue",
"create:task",
"delete:comment",
"delete:issue",
"delete:task",
"update:comment",
"update:issue",
"update:job",
"update:project",
"update:task"
],
"id": 2,
"is_active": true,
"organization": null,
"owner": {
"first_name": "User",
"id": 10,
"last_name": "Seventh",
"url": "http://localhost:8080/api/users/10",
"username": "user7"
},
"project_id": 1,
"target_url": "http://webhooks.internal/",
"type": "project",
"updated_date": "2022-09-28T12:18:12.412000Z",
"url": "http://localhost:8080/api/webhooks/2"
},
{
"content_type": "application/json",
"created_date": "2022-09-28T12:16:28.311000Z",
"description": "",
"enable_ssl": true,
"events": [
"create:task",
"delete:task",
"update:job",
"update:task"
],
"id": 1,
"is_active": true,
"organization": null,
"owner": {
"first_name": "User",
"id": 2,
"last_name": "First",
"url": "http://localhost:8080/api/users/2",
"username": "user1"
},
"project_id": 6,
"target_url": "http://webhooks.internal/",
"type": "project",
"updated_date": "2022-09-28T12:16:28.311000Z",
"url": "http://localhost:8080/api/webhooks/1"
}
]
}