Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Conversation

wangxiaoxuan273
Copy link
Collaborator

Resolves #63

@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2023

Codecov Report

Merging #81 (14e008a) into main (aff0773) will not change coverage.
The diff coverage is n/a.

❗ 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           

@Wwwsylvia
Copy link
Member

Wwwsylvia commented Jul 4, 2023

Some general questions:

  1. How should users trace the calls to native store through DynamicStore?
  2. What if users use the context with hook on other stores, like file store?

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)
Copy link
Contributor

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?

Copy link
Collaborator Author

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)
Copy link
Contributor

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?

Copy link
Collaborator Author

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)
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resued ContextExecutableTrace()

@TerryHowe
Copy link
Member

I just wonder why this isn't being added to oras-go

@wangxiaoxuan273
Copy link
Collaborator Author

I just wonder why this isn't being added to oras-go

@TerryHowe It will be added to oras-go soon.

Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM with suggestions

"context"
"encoding/json"
"fmt"
"io"
"strings"
"testing"

"github.com/oras-project/oras-credentials-go/trace"

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove empty line

Copy link
Collaborator Author

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>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia Wwwsylvia merged commit eb1a970 into oras-project:main Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trace support for executables
7 participants