Skip to content

Implement direct controller and E2E fixtures for LoggingLogExclusion#9713

Open
codebot-robot wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
codebot-robot:issue_9710
Open

Implement direct controller and E2E fixtures for LoggingLogExclusion#9713
codebot-robot wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
codebot-robot:issue_9710

Conversation

@codebot-robot

Copy link
Copy Markdown
Collaborator

Please see the commit details for the direct controller and mockgcp Logging LogExclusion API implementations.

Fixes #9710

Comment on lines +134 to +148
func getParentString(id *krm.LoggingLogExclusionIdentity) string {
if id.Project != "" {
return fmt.Sprintf("projects/%s", id.Project)
}
if id.Folder != "" {
return fmt.Sprintf("folders/%s", id.Folder)
}
if id.Organization != "" {
return fmt.Sprintf("organizations/%s", id.Organization)
}
if id.BillingAccount != "" {
return fmt.Sprintf("billingAccounts/%s", id.BillingAccount)
}
return ""
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should move this to ParentString() on LoggingLogExclusionIdentity

Comment on lines +256 to +268
var maskedActual *loggingpb.LogExclusion
{
// A "trick" to only compare spec fields - round trip via the spec
mapCtx := &direct.MapContext{}
spec := LoggingLogExclusionSpec_FromProto(mapCtx, actual)
if mapCtx.Err() != nil {
return nil, nil, mapCtx.Err()
}
maskedActual = LoggingLogExclusionSpec_ToProto(mapCtx, spec)
if mapCtx.Err() != nil {
return nil, nil, mapCtx.Err()
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use mappers.OnlySpecFields

Also update the skill if this isn't clear

@justinsb

Copy link
Copy Markdown
Collaborator

Great job - two nits but really good stuff

Implement the direct controller for LoggingLogExclusion under pkg/controller/direct/logging/.
Add LogExclusion mock endpoints under mockgcp/mocklogging/.
Enable LoggingLogExclusion in sample E2E test harness.

Fixes GoogleCloudPlatform#9710
@codebot-robot codebot-robot removed their assignment Jun 11, 2026

@justinsb justinsb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/approve
/lgtm

@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement direct controller and E2E fixtures for LoggingLogExclusion

2 participants