diff --git a/internal/run/sourceTracking.go b/internal/run/sourceTracking.go index c87a7564c..7f95cb2d2 100644 --- a/internal/run/sourceTracking.go +++ b/internal/run/sourceTracking.go @@ -22,13 +22,11 @@ import ( "github.com/speakeasy-api/speakeasy/internal/changes" "github.com/speakeasy-api/speakeasy/internal/config" "github.com/speakeasy-api/speakeasy/internal/env" - "github.com/speakeasy-api/speakeasy/internal/git" "github.com/speakeasy-api/speakeasy/internal/github" "github.com/speakeasy-api/speakeasy/internal/log" "github.com/speakeasy-api/speakeasy/internal/reports" "github.com/speakeasy-api/speakeasy/internal/workflowTracking" "github.com/speakeasy-api/speakeasy/registry" - "go.uber.org/zap" ) func (w *Workflow) computeChanges(ctx context.Context, rootStep *workflowTracking.WorkflowStep, targetLock workflow.TargetLock, newDocPath string) (r *reports.ReportResult, err error) { @@ -179,11 +177,6 @@ func (w *Workflow) snapshotSource(ctx context.Context, parentStep *workflowTrack return fmt.Errorf("error localizing openapi document: %w", err) } - gitRepo, err := git.NewLocalRepository(w.ProjectDir) - if err != nil { - log.From(ctx).Debug("error sniffing git repository", zap.Error(err)) - } - rootDocument, err := memfs.Open(filepath.Join(bundler.BundleRoot.String(), "openapi.yaml")) if errors.Is(err, fs.ErrNotExist) { rootDocument, err = memfs.Open(filepath.Join(bundler.BundleRoot.String(), "openapi.json")) @@ -197,14 +190,6 @@ func (w *Workflow) snapshotSource(ctx context.Context, parentStep *workflowTrack return fmt.Errorf("error extracting annotations from openapi document: %w", err) } - revision := "" - if gitRepo != nil { - revision, err = gitRepo.HeadHash() - if err != nil { - log.From(ctx).Debug("error sniffing head commit hash", zap.Error(err)) - } - } - annotations.Revision = revision annotations.BundleRoot = strings.TrimPrefix(rootDocumentPath, string(os.PathSeparator)) // Always add the openapi document version as a tag tags = append(tags, annotations.Version) diff --git a/internal/run/target.go b/internal/run/target.go index 35a5d046f..a5d17f446 100644 --- a/internal/run/target.go +++ b/internal/run/target.go @@ -313,14 +313,6 @@ func (w *Workflow) snapshotCodeSamples(ctx context.Context, parentStep *workflow return "", "", fmt.Errorf("error extracting annotations from openapi document: %w", err) } - revision := "" - if gitRepo != nil { - revision, err = gitRepo.HeadHash() - if err != nil { - log.From(ctx).Debug("error sniffing head commit hash", zap.Error(err)) - } - } - annotations.Revision = revision annotations.BundleRoot = overlayPath err = pl.BuildOCIImage(ctx, bundler.NewReadWriteFS(memfs, memfs), &bundler.OCIBuildOptions{