Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jx preview send too many comments on the pull request #7562

Closed
vbehar opened this issue Sep 12, 2020 · 0 comments · Fixed by #7563
Closed

jx preview send too many comments on the pull request #7562

vbehar opened this issue Sep 12, 2020 · 0 comments · Fixed by #7563

Comments

@vbehar
Copy link

vbehar commented Sep 12, 2020

Summary

At the end of the jx preview command, a comment is written on the Pull Request to say that the preview env is ready, with the link to the preview env.

The issue is that this comment is written each time the jx preview is run, which means that each time someone commit/push, the pipeline will run jx comment, and this will result in a new comment. It's not unusual to end up with tens of "useless" comments like that on a PR.

There is a flag to disable this feature - --no-comment - but there is nothing to ask for a single comment the first time the preview env is deployed.

Steps to reproduce the behavior

  • create a PR
  • push code a few times

Expected behavior

  • the bot will add a single comment to the PR will the link to the preview env

Actual behavior

  • a comment is written on the PR for each code push (pipeline run), which can be seen as "spam"

Jx version

The output of jx version is:

Version        2.1.86-dev+c65b5e25b
Commit         c65b5e25b
Build date     2020-09-12T15:38:23Z
Go version     1.15.1
Git tree state dirty
vbehar added a commit to vbehar/jx that referenced this issue Sep 12, 2020
fixes jenkins-x#7562

This adds a new flag to the `jx preview` command: `--single-comment`
With this flag, the Pull Request comment will only be sent once - the first time.
We use a new annotation on the Environment resource to store the last date a comment has been sent.

Signed-off-by: Vincent Behar <v.behar@free.fr>
jenkins-x-bot pushed a commit that referenced this issue Sep 16, 2020
fixes #7562

This adds a new flag to the `jx preview` command: `--single-comment`
With this flag, the Pull Request comment will only be sent once - the first time.
We use a new annotation on the Environment resource to store the last date a comment has been sent.

Signed-off-by: Vincent Behar <v.behar@free.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant