Skip to content

Commit eabc296

Browse files
authored
Merge pull request #1376 from pdecat/enhancement/generalize_publish_output_progress
Add publish_output_progress config support to AzureDevOps, BitBucket and Gitlab providers
2 parents b440301 + a825aec commit eabc296

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

pr_agent/git_providers/azuredevops_provider.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ def get_diff_files(self) -> list[FilePatchInfo]:
378378
return []
379379

380380
def publish_comment(self, pr_comment: str, is_temporary: bool = False, thread_context=None):
381+
if is_temporary and not get_settings().config.publish_output_progress:
382+
get_logger().debug(f"Skipping publish_comment for temporary comment: {pr_comment}")
383+
return None
381384
comment = Comment(content=pr_comment)
382385
thread = CommentThread(comments=[comment], thread_context=thread_context, status=5)
383386
thread_response = self.azure_devops_client.create_thread(

pr_agent/git_providers/bitbucket_provider.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ def publish_persistent_comment(self, pr_comment: str,
325325
self.publish_comment(pr_comment)
326326

327327
def publish_comment(self, pr_comment: str, is_temporary: bool = False):
328+
if is_temporary and not get_settings().config.publish_output_progress:
329+
get_logger().debug(f"Skipping publish_comment for temporary comment: {pr_comment}")
330+
return None
328331
pr_comment = self.limit_output_characters(pr_comment, self.max_comment_length)
329332
comment = self.pr.comment(pr_comment)
330333
if is_temporary:

pr_agent/git_providers/gitlab_provider.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ def publish_persistent_comment(self, pr_comment: str,
194194
self.publish_persistent_comment_full(pr_comment, initial_header, update_header, name, final_update_message)
195195

196196
def publish_comment(self, mr_comment: str, is_temporary: bool = False):
197+
if is_temporary and not get_settings().config.publish_output_progress:
198+
get_logger().debug(f"Skipping publish_comment for temporary comment: {mr_comment}")
199+
return None
197200
mr_comment = self.limit_output_characters(mr_comment, self.max_comment_chars)
198201
comment = self.mr.notes.create({'body': mr_comment})
199202
if is_temporary:

0 commit comments

Comments
 (0)