Skip to content

Commit

Permalink
Add hal to echo converter for microsoft team (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
KeisukeYamashita authored Nov 16, 2020
1 parent cb975ff commit 16354ee
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 68 deletions.
137 changes: 77 additions & 60 deletions api/client/config/echo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions api/proto/config/echo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import "google/protobuf/wrappers.proto";
import "artifact/artifacts.proto";
import "ci/gcb.proto";
import "notification/github_status.proto";
import "notification/microsoft_teams.proto";
import "notification/slack.proto";
import "notification/twilio.proto";
import "pubsub/pubsub.proto";
Expand All @@ -25,6 +26,8 @@ message Echo {
Stats stats = 7;
Scheduler scheduler = 8;

notification.MicrosoftTeams microsoftteams = 9;

// Echo scheduler configuration.
message Scheduler {

Expand Down
1 change: 1 addition & 0 deletions docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3813,6 +3813,7 @@ Configuration for the echo microservice.
| gcb | [proto.ci.GoogleCloudBuild](#proto.ci.GoogleCloudBuild) | | |
| stats | [Echo.Stats](#proto.config.Echo.Stats) | | |
| scheduler | [Echo.Scheduler](#proto.config.Echo.Scheduler) | | |
| microsoftteams | [proto.notification.MicrosoftTeams](#proto.notification.MicrosoftTeams) | | |



Expand Down
17 changes: 9 additions & 8 deletions internal/convert/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ import (
// HalToEcho generates the echo config for the supplied config.Hal h.
func HalToEcho(h *config.Hal) *config.Echo {
return &config.Echo{
Slack: h.GetNotifications().GetSlack(),
Twilio: h.GetNotifications().GetTwilio(),
GithubStatus: h.GetNotifications().GetGithubStatus(),
Artifacts: h.GetArtifacts(),
Pubsub: h.GetPubsub(),
Gcb: h.GetCi().GetGcb(),
Stats: getEchoStats(h),
Scheduler: getEchoScheduler(h),
Slack: h.GetNotifications().GetSlack(),
Twilio: h.GetNotifications().GetTwilio(),
GithubStatus: h.GetNotifications().GetGithubStatus(),
Artifacts: h.GetArtifacts(),
Pubsub: h.GetPubsub(),
Gcb: h.GetCi().GetGcb(),
Stats: getEchoStats(h),
Scheduler: getEchoScheduler(h),
Microsoftteams: h.GetNotifications().GetMicrosoftteams(),
}
}

Expand Down

0 comments on commit 16354ee

Please sign in to comment.