Skip to content

Commit

Permalink
Update notifications service dependencies
Browse files Browse the repository at this point in the history
Bring in updated grpc, protobuf, and cowboy

Should address the remaining of #1245

Signed-off-by: Jay Mundrawala <jmundrawala@chef.io>
  • Loading branch information
Jay Mundrawala committed Feb 13, 2020
1 parent 4122eb1 commit fa6a84c
Show file tree
Hide file tree
Showing 9 changed files with 283 additions and 256 deletions.
4 changes: 2 additions & 2 deletions components/notifications-service/server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ deps:
mix deps.get
.PHONY: deps

ELIXIR_PROTOC=PATH=$(PATH):~/.mix/escripts protoc --elixir_out=plugins=grpc:./lib/pb -I priv priv/notifications.proto
BASE_PROTO_FILES=priv/notifications.proto priv/rules.proto priv/server.proto priv/health.proto
ELIXIR_PROTOC=PATH=$(PATH):~/.mix/escripts protoc --elixir_out=plugins=grpc:./lib/pb -I ../../../ -I priv -I ../../../api/external/secrets -I ../../../vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/
BASE_PROTO_FILES=notifications.proto rules.proto server.proto health.proto slack_post.proto secrets.proto google/protobuf/struct.proto

elixir_client:
$(ELIXIR_PROTOC) $(BASE_PROTO_FILES) priv/google/protobuf/struct.proto
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
defmodule Google.Protobuf.Struct do
defmodule Google.Protobuf.NullValue do
@moduledoc false
use Protobuf, syntax: :proto3
use Protobuf, enum: true, syntax: :proto3

@type t :: %__MODULE__{
fields: %{String.t() => Google.Protobuf.Value.t() | nil}
}
defstruct [:fields]
@type t :: integer | :NULL_VALUE

field :fields, 1, repeated: true, type: Google.Protobuf.Struct.FieldsEntry, map: true
field :NULL_VALUE, 0
end

defmodule Google.Protobuf.Struct.FieldsEntry do
Expand All @@ -24,6 +21,18 @@ defmodule Google.Protobuf.Struct.FieldsEntry do
field :value, 2, type: Google.Protobuf.Value
end

defmodule Google.Protobuf.Struct do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
fields: %{String.t() => Google.Protobuf.Value.t() | nil}
}
defstruct [:fields]

field :fields, 1, repeated: true, type: Google.Protobuf.Struct.FieldsEntry, map: true
end

defmodule Google.Protobuf.Value do
@moduledoc false
use Protobuf, syntax: :proto3
Expand Down Expand Up @@ -53,10 +62,3 @@ defmodule Google.Protobuf.ListValue do

field :values, 1, repeated: true, type: Google.Protobuf.Value
end

defmodule Google.Protobuf.NullValue do
@moduledoc false
use Protobuf, enum: true, syntax: :proto3

field :NULL_VALUE, 0
end
208 changes: 104 additions & 104 deletions components/notifications-service/server/lib/pb/notifications.pb.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,84 +30,6 @@ defmodule Notifications.TimeInfo do
field :end_time, 2, type: :string
end

defmodule Notifications.Profile do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
name: String.t(),
title: String.t(),
version: String.t(),
summary: String.t(),
maintainer: String.t(),
license: String.t(),
copyright: String.t(),
copyright_email: String.t(),
sha256: String.t(),
supports: [Notifications.PlatformSupport.t()],
attributes: [Notifications.Profile.Attribute.t()],
failed_controls: [Notifications.Profile.Control.t()],
stats: Notifications.Profile.ControlTotals.t() | nil
}
defstruct [
:name,
:title,
:version,
:summary,
:maintainer,
:license,
:copyright,
:copyright_email,
:sha256,
:supports,
:attributes,
:failed_controls,
:stats
]

field :name, 1, type: :string
field :title, 2, type: :string
field :version, 3, type: :string
field :summary, 4, type: :string
field :maintainer, 5, type: :string
field :license, 6, type: :string
field :copyright, 7, type: :string
field :copyright_email, 8, type: :string
field :sha256, 9, type: :string
field :supports, 10, repeated: true, type: Notifications.PlatformSupport
field :attributes, 11, repeated: true, type: Notifications.Profile.Attribute
field :failed_controls, 12, repeated: true, type: Notifications.Profile.Control
field :stats, 13, type: Notifications.Profile.ControlTotals
end

defmodule Notifications.Profile.Control do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
id: String.t(),
impact: float | :infinity | :negative_infinity | :nan,
title: String.t(),
code: String.t(),
desc: String.t(),
source_location: Notifications.SourceLocation.t() | nil,
refs: [Notifications.Refs.t()],
failed_results: [Notifications.Profile.Control.Result.t()],
stats: Notifications.Profile.Control.ResultTotals.t() | nil
}
defstruct [:id, :impact, :title, :code, :desc, :source_location, :refs, :failed_results, :stats]

field :id, 1, type: :string
field :impact, 2, type: :float
field :title, 3, type: :string
field :code, 4, type: :string
field :desc, 5, type: :string
field :source_location, 6, type: Notifications.SourceLocation
field :refs, 7, repeated: true, type: Notifications.Refs
field :failed_results, 9, repeated: true, type: Notifications.Profile.Control.Result
field :stats, 10, type: Notifications.Profile.Control.ResultTotals
end

defmodule Notifications.Profile.Control.Result do
@moduledoc false
use Protobuf, syntax: :proto3
Expand Down Expand Up @@ -148,18 +70,32 @@ defmodule Notifications.Profile.Control.ResultTotals do
field :num_passed_tests, 4, type: :int32
end

defmodule Notifications.Profile.Attribute do
defmodule Notifications.Profile.Control do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
name: String.t(),
options: Notifications.Profile.Attribute.Options.t() | nil
id: String.t(),
impact: float | :infinity | :negative_infinity | :nan,
title: String.t(),
code: String.t(),
desc: String.t(),
source_location: Notifications.SourceLocation.t() | nil,
refs: [Notifications.Refs.t()],
failed_results: [Notifications.Profile.Control.Result.t()],
stats: Notifications.Profile.Control.ResultTotals.t() | nil
}
defstruct [:name, :options]
defstruct [:id, :impact, :title, :code, :desc, :source_location, :refs, :failed_results, :stats]

field :name, 1, type: :string
field :options, 2, type: Notifications.Profile.Attribute.Options
field :id, 1, type: :string
field :impact, 2, type: :float
field :title, 3, type: :string
field :code, 4, type: :string
field :desc, 5, type: :string
field :source_location, 6, type: Notifications.SourceLocation
field :refs, 7, repeated: true, type: Notifications.Refs
field :failed_results, 9, repeated: true, type: Notifications.Profile.Control.Result
field :stats, 10, type: Notifications.Profile.Control.ResultTotals
end

defmodule Notifications.Profile.Attribute.Options do
Expand All @@ -174,6 +110,20 @@ defmodule Notifications.Profile.Attribute.Options do
field :description, 1, type: :string
end

defmodule Notifications.Profile.Attribute do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
name: String.t(),
options: Notifications.Profile.Attribute.Options.t() | nil
}
defstruct [:name, :options]

field :name, 1, type: :string
field :options, 2, type: Notifications.Profile.Attribute.Options
end

defmodule Notifications.Profile.ControlTotals do
@moduledoc false
use Protobuf, syntax: :proto3
Expand All @@ -192,6 +142,56 @@ defmodule Notifications.Profile.ControlTotals do
field :num_passed_tests, 4, type: :int32
end

defmodule Notifications.Profile do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
name: String.t(),
title: String.t(),
version: String.t(),
summary: String.t(),
maintainer: String.t(),
license: String.t(),
copyright: String.t(),
copyright_email: String.t(),
sha256: String.t(),
supports: [Notifications.PlatformSupport.t()],
attributes: [Notifications.Profile.Attribute.t()],
failed_controls: [Notifications.Profile.Control.t()],
stats: Notifications.Profile.ControlTotals.t() | nil
}
defstruct [
:name,
:title,
:version,
:summary,
:maintainer,
:license,
:copyright,
:copyright_email,
:sha256,
:supports,
:attributes,
:failed_controls,
:stats
]

field :name, 1, type: :string
field :title, 2, type: :string
field :version, 3, type: :string
field :summary, 4, type: :string
field :maintainer, 5, type: :string
field :license, 6, type: :string
field :copyright, 7, type: :string
field :copyright_email, 8, type: :string
field :sha256, 9, type: :string
field :supports, 10, repeated: true, type: Notifications.PlatformSupport
field :attributes, 11, repeated: true, type: Notifications.Profile.Attribute
field :failed_controls, 12, repeated: true, type: Notifications.Profile.Control
field :stats, 13, type: Notifications.Profile.ControlTotals
end

defmodule Notifications.SourceLocation do
@moduledoc false
use Protobuf, syntax: :proto3
Expand Down Expand Up @@ -260,6 +260,26 @@ defmodule Notifications.ComplianceSuccess do
field :timestamp, 6, type: :string
end

defmodule Notifications.ComplianceFailure.ControlTotals do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
skipped: integer,
passed: integer,
failed: integer,
critical: integer,
critical_failed: integer
}
defstruct [:skipped, :passed, :failed, :critical, :critical_failed]

field :skipped, 1, type: :int32
field :passed, 2, type: :int32
field :failed, 3, type: :int32
field :critical, 4, type: :int32
field :critical_failed, 5, type: :int32
end

defmodule Notifications.ComplianceFailure do
@moduledoc false
use Protobuf, syntax: :proto3
Expand Down Expand Up @@ -298,26 +318,6 @@ defmodule Notifications.ComplianceFailure do
field :timestamp, 9, type: :string
end

defmodule Notifications.ComplianceFailure.ControlTotals do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
skipped: integer,
passed: integer,
failed: integer,
critical: integer,
critical_failed: integer
}
defstruct [:skipped, :passed, :failed, :critical, :critical_failed]

field :skipped, 1, type: :int32
field :passed, 2, type: :int32
field :failed, 3, type: :int32
field :critical, 4, type: :int32
field :critical_failed, 5, type: :int32
end

defmodule Notifications.CCRFailure do
@moduledoc false
use Protobuf, syntax: :proto3
Expand Down
Loading

0 comments on commit fa6a84c

Please sign in to comment.