Notification Policy: Github PR Comment -- allow deleting and/or hiding existing comments

Imagine this scenario:
1. you make some changes, and the policy posts a few comments in a PR, let’s say Stack A, B, C have some changes, so a post gets added to the PR about that
2. you make some more changes, let’s say you accidentially touch something that changes other stacks, now stack D, E, F have also new comments added to the PR
3. you realize your mistake and undo those changes, the comments for stacks D, E, F are never updated, you have to manually hide/delete them in the PR

Perhaps “hiding” would work best here with the current paradigms, since then you could also un-hide it when needed.

eg:

package spacelift

import future.keywords

pull_request contains {
  "id": run.commit.pull_request_id,
  "deduplication_key": deduplication_key,
  "hide": hide,
} if {
  run := input.run_updated.run
  hide := count(input.run_updated.run.changes) == 0
  deduplication_key := input.run_updated.stack.id
}

Workaround
manually hide/delete them in the PR
Problem
Comments can't be asked to be deleted/hidden inside a policy

Please authenticate to join the conversation.

Upvoters
Status

➡️ Planned

Board

💡 Feature Requests

Tags

Integrations

Date

Over 1 year ago

Subscribe to post

Get notified by email when there are changes.