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

fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service #1756

Merged
merged 5 commits into from Feb 1, 2024

Conversation

ovidiupopa07
Copy link
Contributor

@ovidiupopa07 ovidiupopa07 commented Jan 30, 2024

Disable the ORDER_MAP_ENTRIES_BY_KEYS serialization feature since this is causing an issue in Echo : Github Digest mismatch! Pipeline NOT triggered

Github webhook delivery
image

Spinnaker pipeline setup
image

Spinnaker pipeline triggered when the event is received

image
Closes spinnaker/spinnaker#6886

… when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886
@ovidiupopa07
Copy link
Contributor Author

@jasonmcintosh fyi

@dbyron-sf
Copy link
Contributor

Possible to add a test for this?

@jasonmcintosh
Copy link
Member

https://github.com/spinnaker/gate/pull/1663/files#r1227101209 is where this came in. What's interesting is the commentary - I'd GUESS that the defaults on the object mapper builder are breaking things incorrectly though this is just goofy/where. Tests/details appreciated!

… when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886
@ovidiupopa07
Copy link
Contributor Author

ovidiupopa07 commented Jan 31, 2024

The issue is caused by the fact that when Gate passes the payload to Echo, it sorts the keys alphabetically (this is enabled in the ObjectMapperBuilder. This is making the HmacUtils.hmacSha1Hex(secret, gitEvent.getRawContent()); in Echo to fail.

Gate needs to pass through the raw content without any additional parsing.

@ovidiupopa07
Copy link
Contributor Author

ovidiupopa07 commented Feb 1, 2024

hey @jasonmcintosh / @dbyron-sf

I added one test to verify that the body sent to Echo is not ordered alphabetically.

Copy link
Member

@jasonmcintosh jasonmcintosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice MERGING! :) Then backport time!

@jasonmcintosh jasonmcintosh added the ready to merge Approved and ready for merge label Feb 1, 2024
@mergify mergify bot added the auto merged label Feb 1, 2024
@mergify mergify bot merged commit 4aae98d into master Feb 1, 2024
5 checks passed
@jasonmcintosh
Copy link
Member

@mergify backport release-1.32.x release-1.33.x

Copy link
Contributor

mergify bot commented Feb 1, 2024

mergify bot pushed a commit that referenced this pull request Feb 1, 2024
… when creating the echo retrofit service (#1756)

* fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886

* fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886

* test: Add test verifying that the payload being sent to Echo is not ordered alphabetically

Closes spinnaker/spinnaker#6886

* fix: Apply spotless checks to the test

* fix: Fix failing test

(cherry picked from commit 4aae98d)
mergify bot pushed a commit that referenced this pull request Feb 1, 2024
… when creating the echo retrofit service (#1756)

* fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886

* fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886

* test: Add test verifying that the payload being sent to Echo is not ordered alphabetically

Closes spinnaker/spinnaker#6886

* fix: Apply spotless checks to the test

* fix: Fix failing test

(cherry picked from commit 4aae98d)
@jasonmcintosh
Copy link
Member

Fixes bug introduced in #1663 FYI

mergify bot added a commit that referenced this pull request Feb 1, 2024
… when creating the echo retrofit service (#1756) (#1758)

* fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886

* fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886

* test: Add test verifying that the payload being sent to Echo is not ordered alphabetically

Closes spinnaker/spinnaker#6886

* fix: Apply spotless checks to the test

* fix: Fix failing test

(cherry picked from commit 4aae98d)

Co-authored-by: ovidiupopa07 <105648914+ovidiupopa07@users.noreply.github.com>
mergify bot added a commit that referenced this pull request Feb 1, 2024
… when creating the echo retrofit service (#1756) (#1757)

* fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886

* fix: Fix git trigger issue caused by a misconfig of the object mapper when creating the echo retrofit service

Because of the misconfiguration echo was failing with GitEventHandler  : Github Digest mismatch! Pipeline NOT triggered

Closes spinnaker/spinnaker#6886

* test: Add test verifying that the payload being sent to Echo is not ordered alphabetically

Closes spinnaker/spinnaker#6886

* fix: Apply spotless checks to the test

* fix: Fix failing test

(cherry picked from commit 4aae98d)

Co-authored-by: ovidiupopa07 <105648914+ovidiupopa07@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants