-
Notifications
You must be signed in to change notification settings - Fork 7
feat: support trace with executables #81
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #81 +/- ##
=======================================
Coverage 82.46% 82.46%
=======================================
Files 6 6
Lines 382 382
=======================================
Hits 315 315
Misses 45 45
Partials 22 22 |
Some general questions:
|
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
trace/trace.go
Outdated
if oldStart != nil { | ||
start := trace.ExecuteStart | ||
trace.ExecuteStart = func(executableName, action string) { | ||
start(executableName, action) |
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.
What if start
is nil
?
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.
Added the check and refactored this part of code.
trace/trace.go
Outdated
if oldDone != nil { | ||
done := trace.ExecuteDone | ||
trace.ExecuteDone = func(executableName, action string, err error) { | ||
done(executableName, action, err) |
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.
What if done
is nil
?
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.
Added the check and refactored this part of code.
trace/trace.go
Outdated
if trace == nil { | ||
return ctx | ||
} | ||
oldTrace, _ := ctx.Value(executableTraceContextKey{}).(*ExecutableTrace) |
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.
ContextExecutableTrace()
should be reused for this line.
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.
Resued ContextExecutableTrace()
I just wonder why this isn't being added to oras-go |
@TerryHowe It will be added to |
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
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.
LGTM with suggestions
native_store_test.go
Outdated
"context" | ||
"encoding/json" | ||
"fmt" | ||
"io" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/oras-project/oras-credentials-go/trace" | ||
|
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.
nit: remove empty line
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.
removed.
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
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.
LGTM
Resolves #63