Commit graph

16 commits

Author SHA1 Message Date
Michal Konečný
19f48a0b52 Use message agent value instead of checking for the latest comment
The latest comment seems to be unreliable. We should use agent itself, this will
skip all the messages that were generated by toddler itself.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-07-21 18:38:37 +02:00
Michal Konečný
d23aa93424 Let's not comment on ticket we already commented on
If the last comment on the ticket is from your pagure_user ignore
pagure.issue.comment.added topic.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-07-21 17:16:52 +02:00
Michal Konečný
506e59558c Use correct topic for scm_request_processor
The Pagure messages are not sent with org.fedoraproject. prefix, but with
io.pagure. prefix.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-07-21 14:57:11 +02:00
Michal Konečný
401b425004 Notify the maintainers even if issue already contains a comment
Ping the maintainers if there is no comment from toddler user present yet. This
is a change from current behavior, when the comment was only done, when there
was no comment on the issue altogether.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-04-01 13:26:28 +02:00
Michal Konečný
5cc824a7f4 Send json the correct way
During the manual testing was found out that the json wasn't sent the way the
pagure is expecting it (as string). So this commit adds json.dumps before
sending the payload itself.

It also fixes formatting of one message.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-25 11:02:50 +01:00
Michal Konečný
5d0d0490d2 Fix unit tests
Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-24 17:57:29 +01:00
Michal Konečný
de4b19cae9 Fix the tests
Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-23 17:20:18 +01:00
Michal Konečný
ae122d7e55 Add manual interference to scm_request_processor
If manual interference is needed for SCM request, smc_request_processor first
adds comment to ticket notifying the maintainers of fedora-scm-requests
repository and then waits for subsequent comment that will validate
the issue.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-23 16:24:16 +01:00
Michal Konečný
c242621af0 Add manual way to run scm_request_processor toddler
This is helpful when trying to test the toddler manually. It now has main and
could be ran as separate script. It just needs configuration file and ticket
number on releng/fedora-scm-requests.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-22 16:16:30 +01:00
Michal Konečný
a8dca5908f Fix flake8 errors
Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-21 13:44:45 +01:00
Michal Konečný
6e69a65ce0 Fix formatting
Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-21 13:25:42 +01:00
Michal Konečný
d5f38f16d6 Unit tests for scm_request_processor done
Unit tests are now covering 100% of current code.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-21 13:22:10 +01:00
Michal Konečný
03b815c112 Add unit tests to scm_request_processor plugin
Add tests for create_new_branch and validate_review_bug.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-18 17:38:22 +01:00
Michal Konečný
cc26011ee2 Add unit tests for smc_request_processsor
Finish creating tests for create_new_repo method and continue with
create_new_branch method.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-17 16:44:11 +01:00
Michal Konečný
92497811d2 Add unit tests for scm_request_processor module
Add unit tests for verify_slas method and continue adding tests for
create_new_repo method.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-16 16:55:58 +01:00
Michal Konečný
cede6e9ab6 Add first unit tests for scm_request_processor
Currently process, process_ticket and accepts_topic are covered.

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
2022-03-15 15:52:27 +01:00