From efc1c32d7936d467b8b8dafaa464baafe387b55d Mon Sep 17 00:00:00 2001 From: Nikola Forró Date: Mar 18 2024 12:27:46 +0000 Subject: Add changed_files and pull_request_id to pagure.git.receive schema Signed-off-by: Nikola Forró --- diff --git a/pagure_messages/git_schema.py b/pagure_messages/git_schema.py index 4990106..0388454 100644 --- a/pagure_messages/git_schema.py +++ b/pagure_messages/git_schema.py @@ -162,6 +162,11 @@ class GitReceiveV1(GitMessage): "total_commits": {"type": "number"}, "start_commit": {"type": "string"}, "end_commit": {"type": "string"}, + "changed_files": { + "type": "object", + "additionalProperties": {"type": "string"}, + }, + "pull_request_id": {"anyOf": [{"type": "integer"}, {"type": "null"}]}, }, "required": [ "agent", @@ -173,6 +178,8 @@ class GitReceiveV1(GitMessage): "total_commits", "start_commit", "end_commit", + "changed_files", + "pull_request_id", ], } diff --git a/pagure_messages/tests/test_git_receive.py b/pagure_messages/tests/test_git_receive.py index 05e7301..8abe84c 100644 --- a/pagure_messages/tests/test_git_receive.py +++ b/pagure_messages/tests/test_git_receive.py @@ -43,6 +43,8 @@ def body(): "total_commits": 42, "start_commit": "hash_commit_start", "end_commit": "hash_commit_stop", + "changed_files": {"file.1": "A", "file.2": "M"}, + "pull_request_id": 28, } @@ -171,6 +173,8 @@ def test_artifacts(namespace, msg_attr): "total_commits": 42, "start_commit": "hash_commit_start", "end_commit": "hash_commit_stop", + "changed_files": {"file.1": "A", "file.2": "M"}, + "pull_request_id": None, } body["repo"]["namespace"] = namespace message = GitReceiveV1(body=body)