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

Prevent duplicate comments in Gerrit #108

Closed
lazyfiend opened this issue Jul 29, 2015 · 5 comments
Closed

Prevent duplicate comments in Gerrit #108

lazyfiend opened this issue Jul 29, 2015 · 5 comments

Comments

@lazyfiend
Copy link

Added post build step to run sputnik in Jenkins with Gerrit Trigger.

When we retrigger the patchset using Gerrit Trigger, sputnik is also executed against the same patchset. This causes the comments in Gerrit added by sputnik to be added again.

I would like to request for a way to prevent it inside sputnik.

@SpOOnman
Copy link
Collaborator

We're aware of that. This change would reguire additional calls to Gerrit to fetch actual comments and compare them. Pull request is very welcome!

@lazyfiend
Copy link
Author

I see. I might check it if i have the time.

@vitas
Copy link

vitas commented Sep 27, 2019

would be great to get it done

corebonts added a commit to corebonts/sputnik that referenced this issue Aug 10, 2020
As it's a Gerrit feature and not a client side deduplication, it should
not have a large overhead, therefore it's enabled by default.
corebonts added a commit to corebonts/sputnik that referenced this issue Aug 10, 2020
As it's a Gerrit feature and not a client side deduplication, it should
not have a large overhead, therefore it's enabled by default.
@corebonts
Copy link
Contributor

There's a gerrit feature omitDuplicateComments which can be set on ReviewInput. (see my commit)
It's good because this way there's no need for the additional Gerrit call.

corebonts added a commit to corebonts/sputnik that referenced this issue Jan 14, 2021
As it's a Gerrit feature and not a client side deduplication, it should
not have a large overhead, therefore it's enabled by default.
SpOOnman pushed a commit that referenced this issue Jan 28, 2021
* Allow usage of Gerrit HTTP password tokens (#220)

This makes it possible to use http password token that is defined in
Settings -> HTTP Password page instead of the regular site password.

https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication

* URL encode changeId when creating GerritPatchset (#221)

When a cherry-pick is done and there are more commits with the same
changeId, an exended id can be used to distinguish between them.

It has a tilde separated format:
project/subproject~branch/subbranch~changeId

If this is not encoded but just put in the URL, an error message comes
from the server like:
Request not successful. Message: Not Found. Status-Code: 404.
Content: Not found: project

* Support gerrit configuration to omit duplicate comments (#108)

As it's a Gerrit feature and not a client side deduplication, it should
not have a large overhead, therefore it's enabled by default.

* Improve test coverage of Gerrit connector

* Use Gerrit API's URL encoding in GerritFacadeBuilder

This actually does the same as the old 'safeUrlEncode(String)'.
Also a reference is now added for the ID encoding method.

* Clean up Gerrit connector tests to better fit the project style

Co-authored-by: Gabor Garancsi <gabor.garancsi@casrd.net>
@SpOOnman
Copy link
Collaborator

It is fixed in #230 and released with 2.6.0.

rufuslevi pushed a commit to rufuslevi/sputnik that referenced this issue Mar 12, 2024
* Allow usage of Gerrit HTTP password tokens (TouK#220)

This makes it possible to use http password token that is defined in
Settings -> HTTP Password page instead of the regular site password.

https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication

* URL encode changeId when creating GerritPatchset (TouK#221)

When a cherry-pick is done and there are more commits with the same
changeId, an exended id can be used to distinguish between them.

It has a tilde separated format:
project/subproject~branch/subbranch~changeId

If this is not encoded but just put in the URL, an error message comes
from the server like:
Request not successful. Message: Not Found. Status-Code: 404.
Content: Not found: project

* Support gerrit configuration to omit duplicate comments (TouK#108)

As it's a Gerrit feature and not a client side deduplication, it should
not have a large overhead, therefore it's enabled by default.

* Improve test coverage of Gerrit connector

* Use Gerrit API's URL encoding in GerritFacadeBuilder

This actually does the same as the old 'safeUrlEncode(String)'.
Also a reference is now added for the ID encoding method.

* Clean up Gerrit connector tests to better fit the project style

Co-authored-by: Gabor Garancsi <gabor.garancsi@casrd.net>
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

No branches or pull requests

4 participants