Skip to content
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

chore: no longer track revision #1204

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions internal/run/sourceTracking.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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"))
Expand All @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions internal/run/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@

registryStep.NewSubstep("Snapshotting Code Samples")

gitRepo, err := git.NewLocalRepository(w.ProjectDir)

Check failure on line 301 in internal/run/target.go

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

declared and not used: gitRepo

Check failure on line 301 in internal/run/target.go

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

declared and not used: gitRepo
if err != nil {
log.From(ctx).Debug("error sniffing git repository", zap.Error(err))
}
Expand All @@ -313,14 +313,6 @@
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{
Expand Down
Loading