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

feat(gcpPublishEvent): Add additionalEventData param #4928

Merged
merged 11 commits into from
May 17, 2024

Conversation

jliempt
Copy link
Member

@jliempt jliempt commented May 13, 2024

Makes it possible to insert additional data into the eventData JSON, which is useful when the eventData comes from the pipeline env.

This also fixes the format of the "data" part of the CloudEvent. If you pass a string to cloudEvent.SetData(), it will be marshalled and ends up with duplicated escape characters (for example {\\\\"testKey\\\\": \\\\"testValue\\\\"}), which causes problems when unmarshalling the data. Passing a map[string]interface{} solves it.

Changes

  • Tests
  • Documentation

@jliempt jliempt requested a review from a team as a code owner May 13, 2024 14:09
@jliempt jliempt requested a review from CCFenner May 13, 2024 16:23
Copy link
Member

@anilkeshav27 anilkeshav27 left a comment

Choose a reason for hiding this comment

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

approved with the same change about the gcp project number and project name that we can eliminate

cmd/gcpPublishEvent.go Outdated Show resolved Hide resolved
@jliempt
Copy link
Member Author

jliempt commented May 17, 2024

/it-go

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@jliempt jliempt enabled auto-merge (squash) May 17, 2024 08:22
@jliempt jliempt merged commit 7de5fdf into master May 17, 2024
12 checks passed
@jliempt jliempt deleted the jliempt/additionalEventData branch May 17, 2024 08:24
maxatsap pushed a commit to maxatsap/jenkins-library that referenced this pull request Jul 23, 2024
* add additionalEventData param

* fix double JSON marshalling

* go generate

* add logging of events and config

* change logging to debug

* add event log

* fix CloudEvent JSON type

* apply review feedback

* fix log

* add missing error handling

---------

Co-authored-by: jliempt <>
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 this pull request may close these issues.

2 participants