New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Privacy Sandbox: Topics in headers #3393
Privacy Sandbox: Topics in headers #3393
Conversation
530fc2a
to
fdd72c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left two very minor comments.
@SyntaxNode Logging in |
I think it's better to emit warnings without checking the debug flag than emit no warnings at all. We can add the debug descriptor in the future if it's needed. IMHO it's ok to use the existing warning functionality. Look at how errors are handled by If you want to follow the debug requirement, I don't think you need to create a new severity level. The severity is primarily used to know when to end the auction early and how to classify the error in the response. I think we may be ok with adding a signal to the Coder interface and adding a |
@SyntaxNode please review the latest changes. I'll add the UT, etc once the approach is accepted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating the PR to include warning. I appreciate that you want to fully implement the debug condition.
Adding a new severity level is opening us up to potential bugs. There is a good amount of code which assumes an error is either fatal or a warning, but now these cases need to be expanded to include debug warnings. Some of the code pathways may be missed (we're only human, after all). I also expect this would be a large effort to test.
The only difference between a warning and a debug warning is when to write it to the response. All other code pathways are unchanged.
I recommended adding a property of some kind to the warning type which will identify it's scope. You only need to change the warning loop in exchange.go - which introduces less risk and requires less testing.
Thinking about it more, consider adding a scope.go
in the errortypes
package which looks something like this:
type Scope int
const (
ScopeAny
ScopeDebug
)
type Scoped interface {
Scope() Scope
}
func ReadScope(err error) Scope {
if e, ok := err.(Scoped); ok {
return e.Scope()
}
return ScopeAny
}
When looping through errors, if debug is not enabled ignore any warnings with the ScopeDebug
scope. You can still create a DebugWarning
type with it implementing the Scoped
interface and returning a ScopeDebug
value. The default will be treat warnings as we do today.
@SyntaxNode Thanks for the prompt review. Could you please review the latest commit which implements the recommended changes |
Looks good to me. Thank you for acting on this feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found some things related to code coverage I wanted to ask about, and a spelling nitpick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates. Looking good to me. I performed end-to-end testing via Postman. I found it difficult to setup a test via the Chrome browser itself. I used different test topics posted by Google and they all worked well.
A few small nitpicks before I approve.
Implements #3008