diff --git a/pr_agent/servers/gitlab_polling.py b/pr_agent/servers/gitlab_polling.py index 529fae14..4409d176 100644 --- a/pr_agent/servers/gitlab_polling.py +++ b/pr_agent/servers/gitlab_polling.py @@ -16,7 +16,6 @@ gl = gitlab.Gitlab( projects_to_monitor = settings.get("GITLAB.PROJECTS_TO_MONITOR") magic_word = settings.get("GITLAB.MAGIC_WORD") -print(projects_to_monitor, magic_word, settings.get("GITLAB.PERSONAL_ACCESS_TOKEN")) # Hold the previous seen comments previous_comments = set() @@ -28,7 +27,7 @@ def check_comments(): project = gl.projects.get(project) merge_requests = project.mergerequests.list(state='opened') for mr in merge_requests: - notes = mr.notes.list(iterator=True) + notes = mr.notes.list(get_all=True) for note in notes: if note.id not in previous_comments and note.body.startswith(magic_word): new_comments[note.id] = dict( @@ -51,7 +50,7 @@ def handle_new_comments(new_comments): def run(): - + assert settings.get('CONFIG.GIT_PROVIDER') == 'gitlab', 'This script is only for GitLab' # Initial run to populate previous_comments check_comments() diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml index 6a9d0694..9d5f1642 100644 --- a/pr_agent/settings/configuration.toml +++ b/pr_agent/settings/configuration.toml @@ -19,10 +19,10 @@ num_code_suggestions=4 gitlab_url = "https://gitlab.com" # Polling (either proheheject id or namespace/project_name) syntax can be used -projects_to_monitor = [47494341, 'my_user/my_project', 'my_group/my_project'] +projects_to_monitor = ['nuclai/algo', 'nuclai/pr-agent-test'] # Polling trigger magic_word = "AutoReview" # Polling interval -polling_interval_seconds = 60 \ No newline at end of file +polling_interval_seconds = 300 \ No newline at end of file