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

jira-translator-cdevents : translate jira issue and worklog events into ticket CDEvents #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

rjalander
Copy link

This PR includes the changes for a plugin implementation of EventTranslator interface that is exposed by CDEvents Webhook Adapter to translate jira events into CDEvents.

Below are the Jira events that are currently have mappings with CDEvents and are supported by this translator.

CDEvent Type Jira Event Type
dev.cdevents.ticket.created issue_created
dev.cdevents.ticket.updated issue_updated
dev.cdevents.ticket.updated issue_commented
dev.cdevents.ticket.updated issue_assigned
dev.cdevents.ticket.updated issue_work_logged
dev.cdevents.ticket.updated issue_worklog_updated
dev.cdevents.ticket.updated issue_worklog_deleted
dev.cdevents.ticket.closed issue_generic

Note:

  • This implementation is as per the RFC proposed
  • CDEvents Ticket related events are created from sd-go main, will be updated once sdk-go v0.4 released
  • webhook-adapter dependency also will be updated once sdk-go v0.4 released

Signed-off-by: Jalander Ramagiri @rjalander

Jalander Ramagiri added 4 commits July 25, 2024 14:38
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Copy link
Collaborator

@xibz xibz left a comment

Choose a reason for hiding this comment

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

Most of my comments are very minor, so should be able to be resolved fairly quickly

Comment on lines +31 to +32
pEvent = &JiraEvent{event}
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
pEvent = &JiraEvent{event}
return
return &JiraEvent{event}

Event string
}

func NewJiraEvent(event string) (pEvent *JiraEvent) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
func NewJiraEvent(event string) (pEvent *JiraEvent) {
func NewJiraEvent(event string) *JiraEvent {

"net/http"
)

type JiraEvent struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If it is only a single string field, we can do something like this instead

type JiraEvent string

Copy link
Collaborator

@xibz xibz left a comment

Choose a reason for hiding this comment

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

Most of my comments are very minor, so should be able to be resolved fairly quickly

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