Skip to content

Commit 1051375

Browse files
authored
pb: expose buildInfo in get_configuration (#129)
* pb: expose buildInfo in get_configuration * sonarcloud: fix security hotspot
1 parent f2a2a6a commit 1051375

31 files changed

+765
-420
lines changed

pb/clear_cache.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pb/create_resource.pb.go

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pb/create_resource.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ syntax = "proto3";
1919
package service.pb;
2020

2121
import "grpc-gateway/pb/devices.proto";
22-
import "resource-aggregate/pb/commands.proto";
22+
import "resource-aggregate/pb/resources.proto";
2323

2424
option go_package = "github.com/plgd-dev/client-application/pb;pb";
2525

pb/delete_resource.pb.go

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pb/delete_resource.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ syntax = "proto3";
1818

1919
package service.pb;
2020

21-
import "resource-aggregate/pb/commands.proto";
21+
import "resource-aggregate/pb/resources.proto";
2222
option go_package = "github.com/plgd-dev/client-application/pb;pb";
2323

2424

pb/disown_device.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pb/get_configuration.go

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,42 @@ func (c *RemoteProvisioning) Clone() *RemoteProvisioning {
5858
}
5959
}
6060

61+
func (c *BuildInfo) Clone() *BuildInfo {
62+
if c == nil {
63+
return nil
64+
}
65+
return &BuildInfo{
66+
Version: c.GetVersion(),
67+
BuildDate: c.GetBuildDate(),
68+
CommitHash: c.GetCommitHash(),
69+
CommitDate: c.GetCommitDate(),
70+
ReleaseUrl: c.GetReleaseUrl(),
71+
}
72+
}
73+
74+
func NewGetConfigurationResponse(info *BuildInfo) *GetConfigurationResponse {
75+
return &GetConfigurationResponse{
76+
BuildInfo: info,
77+
Version: info.GetVersion(),
78+
BuildDate: info.GetBuildDate(),
79+
CommitHash: info.GetCommitHash(),
80+
CommitDate: info.GetCommitDate(),
81+
ReleaseUrl: info.GetReleaseUrl(),
82+
}
83+
}
84+
6185
func (r *GetConfigurationResponse) Clone() *GetConfigurationResponse {
6286
if r == nil {
6387
return nil
6488
}
6589
return &GetConfigurationResponse{
66-
Version: r.Version,
67-
BuildDate: r.BuildDate,
68-
CommitHash: r.CommitHash,
69-
CommitDate: r.CommitDate,
70-
ReleaseUrl: r.ReleaseUrl,
90+
Version: r.GetBuildInfo().GetVersion(),
91+
BuildDate: r.GetBuildInfo().GetBuildDate(),
92+
CommitHash: r.GetBuildInfo().GetCommitHash(),
93+
CommitDate: r.GetBuildInfo().GetCommitDate(),
94+
ReleaseUrl: r.GetBuildInfo().GetReleaseUrl(),
7195
RemoteProvisioning: r.RemoteProvisioning.Clone(),
96+
BuildInfo: r.GetBuildInfo().Clone(),
7297
}
7398
}
7499

0 commit comments

Comments
 (0)