-
Notifications
You must be signed in to change notification settings - Fork 367
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: hook pre/post merge include merge source #8703
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,13 +73,15 @@ Upon execution, a webhook will send a request containing a JSON object with the | |
| commit_message[^2] | The message for the commit (or merge) that is taking place | string | | ||
| committer[^2] | Name of the committer | string | | ||
| commit_metadata[^2] | The metadata for the commit that is taking place | string | | ||
| commit_id[^2,^4] | The ID of the commit that is being created | string | | ||
| commit_id[^2,^4] | The ID of the commit that is being created | string | | ||
| tag_id[^3] | The ID of the created/deleted tag | string | | ||
| merge_source[^5] | The source branch/tag/ref on merge operation | string | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
[^1]: N\A for Tag events | ||
[^2]: N\A for Tag and Create/Delete Branch events | ||
[^3]: Applicable only for Tag events | ||
[^4]: Applicable to commit/merge events. For merges, this represents the merge commit ID to be created if the merge operation succeeds. | ||
[^5]: Applicable to merge events. This represents the merge source, it may be same as `source_ref` in case the source is a commit. | ||
|
||
Example: | ||
```json | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ type EventInfo struct { | |
CommitMessage string `json:"commit_message,omitempty"` | ||
Committer string `json:"committer,omitempty"` | ||
CommitMetadata map[string]string `json:"commit_metadata,omitempty"` | ||
MergeSource string `json:"merge_source,omitempty"` | ||
} | ||
|
||
func marshalEventInformation(actionName, hookID string, record graveler.HookRecord) ([]byte, error) { | ||
|
@@ -37,6 +38,7 @@ func marshalEventInformation(actionName, hookID string, record graveler.HookReco | |
CommitMessage: record.Commit.Message, | ||
Committer: record.Commit.Committer, | ||
CommitMetadata: record.Commit.Metadata, | ||
MergeSource: record.MergeSource.String(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this left out from lua type on purpose? (https://github.com/treeverse/lakeFS/blob/master/pkg/actions/lua.go#L47) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, It is a bug - will fix it |
||
} | ||
return json.Marshal(info) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not rendering (see screenshot in comment blueish' arrow)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll fix it