Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/lfx-v2-committee-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ apiVersion: v2
name: lfx-v2-committee-service
description: LFX Platform V2 Committee Service chart
type: application
version: 0.2.10
version: 0.2.11
appVersion: "latest"
22 changes: 0 additions & 22 deletions cmd/committee-api/design/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ var CommitteeBaseWithReadonlyAttributes = dsl.Type("committee-base-with-readonly
ProjectNameAttribute()
SSOGroupNameAttribute()

TotalMembersAttribute()
TotalVotingReposAttribute()

})

var CommitteeFullWithReadonlyAttributes = dsl.Type("committee-full-with-readonly-attributes", func() {
Expand All @@ -81,9 +78,6 @@ var CommitteeFullWithReadonlyAttributes = dsl.Type("committee-full-with-readonly

SSOGroupNameAttribute()

TotalMembersAttribute()
TotalVotingReposAttribute()

// Include settings attributes for complete representation
CommitteeSettingsAttributes()

Expand Down Expand Up @@ -277,22 +271,6 @@ func ParentCommitteeUIDAttribute() {
})
}

// TotalMembersAttribute is the DSL attribute for total members count.
func TotalMembersAttribute() {
dsl.Attribute("total_members", dsl.Int, "The total number of members in this committee", func() {
dsl.Minimum(0)
dsl.Example(15)
})
}

// TotalVotingReposAttribute is the DSL attribute for total voting repositories count.
func TotalVotingReposAttribute() {
dsl.Attribute("total_voting_repos", dsl.Int, "The total number of repositories with voting permissions for this committee", func() {
dsl.Minimum(0)
dsl.Example(3)
})
}

// WritersAttribute is the DSL attribute for committee writers.
func WritersAttribute() {
dsl.Attribute("writers", dsl.ArrayOf(dsl.String), "Manager user IDs who can edit/modify this committee", func() {
Expand Down
58 changes: 27 additions & 31 deletions cmd/committee-api/service/committee_service_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,19 @@ func (s *committeeServicesrvc) convertPayloadToUpdateSettings(p *committeeservic

func (s *committeeServicesrvc) convertDomainToFullResponse(response *model.Committee) *committeeservice.CommitteeFullWithReadonlyAttributes {
result := &committeeservice.CommitteeFullWithReadonlyAttributes{
UID: &response.CommitteeBase.UID,
ProjectUID: &response.ProjectUID,
Name: &response.Name,
Category: &response.Category,
Description: &response.Description,
Website: response.Website,
EnableVoting: response.EnableVoting,
SsoGroupEnabled: response.SSOGroupEnabled,
RequiresReview: response.RequiresReview,
Public: response.Public,
DisplayName: &response.DisplayName,
ParentUID: response.ParentUID,
SsoGroupName: &response.SSOGroupName,
TotalMembers: &response.TotalMembers,
TotalVotingRepos: &response.TotalVotingRepos,
UID: &response.CommitteeBase.UID,
ProjectUID: &response.ProjectUID,
Name: &response.Name,
Category: &response.Category,
Description: &response.Description,
Website: response.Website,
EnableVoting: response.EnableVoting,
SsoGroupEnabled: response.SSOGroupEnabled,
RequiresReview: response.RequiresReview,
Public: response.Public,
DisplayName: &response.DisplayName,
ParentUID: response.ParentUID,
SsoGroupName: &response.SSOGroupName,
}

// Handle Calendar mapping
Expand All @@ -193,22 +191,20 @@ func (s *committeeServicesrvc) convertDomainToFullResponse(response *model.Commi
// convertBaseToResponse converts domain CommitteeBase to GOA response type
func (s *committeeServicesrvc) convertBaseToResponse(base *model.CommitteeBase) *committeeservice.CommitteeBaseWithReadonlyAttributes {
result := &committeeservice.CommitteeBaseWithReadonlyAttributes{
UID: &base.UID,
ProjectUID: &base.ProjectUID,
Name: &base.Name,
ProjectName: &base.ProjectName,
Category: &base.Category,
Description: &base.Description,
Website: base.Website,
EnableVoting: base.EnableVoting,
SsoGroupEnabled: base.SSOGroupEnabled,
RequiresReview: base.RequiresReview,
Public: base.Public,
DisplayName: &base.DisplayName,
ParentUID: base.ParentUID,
SsoGroupName: &base.SSOGroupName,
TotalMembers: &base.TotalMembers,
TotalVotingRepos: &base.TotalVotingRepos,
UID: &base.UID,
ProjectUID: &base.ProjectUID,
Name: &base.Name,
ProjectName: &base.ProjectName,
Category: &base.Category,
Description: &base.Description,
Website: base.Website,
EnableVoting: base.EnableVoting,
SsoGroupEnabled: base.SSOGroupEnabled,
RequiresReview: base.RequiresReview,
Public: base.Public,
DisplayName: &base.DisplayName,
ParentUID: base.ParentUID,
SsoGroupName: &base.SSOGroupName,
}

// Handle Calendar mapping
Expand Down
138 changes: 62 additions & 76 deletions cmd/committee-api/service/committee_service_response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,22 +400,20 @@ func TestConvertDomainToFullResponse(t *testing.T) {
name: "complete domain to response conversion",
domain: &model.Committee{
CommitteeBase: model.CommitteeBase{
UID: "committee-123",
ProjectUID: "project-123",
ProjectName: "Test Project",
Name: "Test Committee",
Category: "governance",
Description: "Test description",
Website: stringPtr("https://example.com"),
EnableVoting: true,
SSOGroupEnabled: true,
SSOGroupName: "test-sso-group",
RequiresReview: true,
Public: true,
DisplayName: "Test Display Name",
ParentUID: stringPtr("parent-123"),
TotalMembers: 10,
TotalVotingRepos: 5,
UID: "committee-123",
ProjectUID: "project-123",
ProjectName: "Test Project",
Name: "Test Committee",
Category: "governance",
Description: "Test description",
Website: stringPtr("https://example.com"),
EnableVoting: true,
SSOGroupEnabled: true,
SSOGroupName: "test-sso-group",
RequiresReview: true,
Public: true,
DisplayName: "Test Display Name",
ParentUID: stringPtr("parent-123"),
Calendar: model.Calendar{
Public: true,
},
Expand All @@ -432,21 +430,19 @@ func TestConvertDomainToFullResponse(t *testing.T) {
},
},
expected: &committeeservice.CommitteeFullWithReadonlyAttributes{
UID: stringPtr("committee-123"),
ProjectUID: stringPtr("project-123"),
Name: stringPtr("Test Committee"),
Category: stringPtr("governance"),
Description: stringPtr("Test description"),
Website: stringPtr("https://example.com"),
EnableVoting: true,
SsoGroupEnabled: true,
SsoGroupName: stringPtr("test-sso-group"),
RequiresReview: true,
Public: true,
DisplayName: stringPtr("Test Display Name"),
ParentUID: stringPtr("parent-123"),
TotalMembers: intPtr(10),
TotalVotingRepos: intPtr(5),
UID: stringPtr("committee-123"),
ProjectUID: stringPtr("project-123"),
Name: stringPtr("Test Committee"),
Category: stringPtr("governance"),
Description: stringPtr("Test description"),
Website: stringPtr("https://example.com"),
EnableVoting: true,
SsoGroupEnabled: true,
SsoGroupName: stringPtr("test-sso-group"),
RequiresReview: true,
Public: true,
DisplayName: stringPtr("Test Display Name"),
ParentUID: stringPtr("parent-123"),
Calendar: &struct {
Public bool
}{
Expand Down Expand Up @@ -475,15 +471,13 @@ func TestConvertDomainToFullResponse(t *testing.T) {
CommitteeSettings: nil,
},
expected: &committeeservice.CommitteeFullWithReadonlyAttributes{
UID: stringPtr("committee-456"),
ProjectUID: stringPtr("project-456"),
Name: stringPtr("Minimal Committee"),
Category: stringPtr("technical"),
Description: stringPtr("Minimal description"),
DisplayName: stringPtr(""),
SsoGroupName: stringPtr(""),
TotalMembers: intPtr(0),
TotalVotingRepos: intPtr(0),
UID: stringPtr("committee-456"),
ProjectUID: stringPtr("project-456"),
Name: stringPtr("Minimal Committee"),
Category: stringPtr("technical"),
Description: stringPtr("Minimal description"),
DisplayName: stringPtr(""),
SsoGroupName: stringPtr(""),
Calendar: &struct {
Public bool
}{
Expand Down Expand Up @@ -512,43 +506,39 @@ func TestConvertBaseToResponse(t *testing.T) {
{
name: "complete base to response conversion",
base: &model.CommitteeBase{
UID: "committee-123",
ProjectUID: "project-123",
ProjectName: "Test Project",
Name: "Test Committee",
Category: "governance",
Description: "Test description",
Website: stringPtr("https://example.com"),
EnableVoting: true,
SSOGroupEnabled: true,
SSOGroupName: "test-sso-group",
RequiresReview: true,
Public: true,
DisplayName: "Test Display Name",
ParentUID: stringPtr("parent-123"),
TotalMembers: 15,
TotalVotingRepos: 8,
UID: "committee-123",
ProjectUID: "project-123",
ProjectName: "Test Project",
Name: "Test Committee",
Category: "governance",
Description: "Test description",
Website: stringPtr("https://example.com"),
EnableVoting: true,
SSOGroupEnabled: true,
SSOGroupName: "test-sso-group",
RequiresReview: true,
Public: true,
DisplayName: "Test Display Name",
ParentUID: stringPtr("parent-123"),
Calendar: model.Calendar{
Public: true,
},
},
expected: &committeeservice.CommitteeBaseWithReadonlyAttributes{
UID: stringPtr("committee-123"),
ProjectUID: stringPtr("project-123"),
ProjectName: stringPtr("Test Project"),
Name: stringPtr("Test Committee"),
Category: stringPtr("governance"),
Description: stringPtr("Test description"),
Website: stringPtr("https://example.com"),
EnableVoting: true,
SsoGroupEnabled: true,
SsoGroupName: stringPtr("test-sso-group"),
RequiresReview: true,
Public: true,
DisplayName: stringPtr("Test Display Name"),
ParentUID: stringPtr("parent-123"),
TotalMembers: intPtr(15),
TotalVotingRepos: intPtr(8),
UID: stringPtr("committee-123"),
ProjectUID: stringPtr("project-123"),
ProjectName: stringPtr("Test Project"),
Name: stringPtr("Test Committee"),
Category: stringPtr("governance"),
Description: stringPtr("Test description"),
Website: stringPtr("https://example.com"),
EnableVoting: true,
SsoGroupEnabled: true,
SsoGroupName: stringPtr("test-sso-group"),
RequiresReview: true,
Public: true,
DisplayName: stringPtr("Test Display Name"),
ParentUID: stringPtr("parent-123"),
Calendar: &struct {
Public bool
}{
Expand Down Expand Up @@ -1250,7 +1240,3 @@ func TestConvertPayloadToUpdateMember(t *testing.T) {
func stringPtr(s string) *string {
return &s
}

func intPtr(i int) *int {
return &i
}
8 changes: 0 additions & 8 deletions gen/committee_service/service.go

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

Loading