Skip to content
Merged
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
17 changes: 17 additions & 0 deletions core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.3
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/lxc/incus/v6 v6.23.0
github.com/moby/go-archive v0.3.3
github.com/moby/moby/api v1.55.0
Expand Down Expand Up @@ -50,19 +51,25 @@ require (
github.com/BurntSushi/toml v1.6.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.4.1 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/apex/log v1.9.0 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/cloudflare/circl v1.6.5 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.18.2 // indirect
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
github.com/containers/ocicrypt v1.3.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 // indirect
github.com/cyphar/filepath-securejoin v0.7.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.8 // indirect
github.com/docker/go-connections v0.8.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
Expand All @@ -74,6 +81,7 @@ require (
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/google/go-containerregistry v0.21.6 // indirect
github.com/google/go-intervals v0.0.2 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -82,6 +90,9 @@ require (
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/mattn/go-runewidth v0.0.27 // indirect
github.com/mattn/go-sqlite3 v1.14.48 // indirect
github.com/miekg/pkcs11 v1.1.2 // indirect
github.com/mistifyio/go-zfs/v4 v4.0.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/sys/capability v0.4.0 // indirect
Expand All @@ -106,11 +117,15 @@ require (
github.com/sigstore/sigstore v1.10.8 // indirect
github.com/sirupsen/logrus v1.10.2 // indirect
github.com/skeema/knownhosts v1.3.3 // indirect
github.com/smallstep/pkcs7 v0.2.1 // indirect
github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6 // indirect
github.com/tchap/go-patricia/v2 v2.3.3 // indirect
github.com/ulikunitz/xz v0.5.16 // indirect
github.com/urfave/cli v1.22.17 // indirect
github.com/vbatts/go-mtree v0.7.0 // indirect
github.com/vbatts/tar-split v0.12.3 // indirect
github.com/vbauerster/cupwriter v0.0.4 // indirect
github.com/vbauerster/mpb/v8 v8.14.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
Expand All @@ -130,6 +145,8 @@ require (
golang.org/x/text v0.41.0 // indirect
golang.org/x/tools v0.49.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/grpc v1.82.0 // indirect
google.golang.org/protobuf v1.36.12 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
88 changes: 88 additions & 0 deletions core/go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions core/pkg/executor/action_composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import (
"drassi.run/core/pkg/expression/libraries"
"drassi.run/core/pkg/model/records"
"drassi.run/core/pkg/model/workflows"
"drassi.run/core/pkg/store/repository"
"drassi.run/core/pkg/store/git"
"drassi.run/core/util/dig"
"drassi.run/core/util/otel"
"go.uber.org/dig"
)

type CompositeActionSpec struct {
Repo *repository.Repository
Repo *gitstore.RepoReference
Inputs workflows.Evaluable[map[string]string]
Outputs workflows.Evaluable[map[string]string]

Expand Down Expand Up @@ -86,7 +86,7 @@ func (e *compositeActionExecutor) StepExecutor() StepExecutor {
}

func (e *compositeActionExecutor) Name() workflows.Evaluable[string] {
name := repository.Location(e.spec.Repo)
name := gitstore.Location(e.spec.Repo)
return workflows.NewLiteralToken(name)
}

Expand Down
6 changes: 3 additions & 3 deletions core/pkg/executor/action_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import (
"drassi.run/core/pkg/model/workflows"
"drassi.run/core/pkg/runtime"
"drassi.run/core/pkg/scribe"
"drassi.run/core/pkg/store/repository"
"drassi.run/core/pkg/store/git"
"drassi.run/core/util/dig"
semconv "go.opentelemetry.io/otel/semconv/v1.27.0"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

type DockerActionSpec struct {
Repo *repository.Repository
Repo *gitstore.RepoReference
Inputs workflows.Evaluable[map[string]string]
Outputs workflows.Evaluable[map[string]string]
Env workflows.Evaluable[map[string]string]
Expand Down Expand Up @@ -229,7 +229,7 @@ func (e *dockerActionExecutor) repr() string {
str += fmt.Sprintf(" with Dockerfile=%q", e.spec.Image)
}
if repo := e.spec.Repo; repo != nil {
str += fmt.Sprintf(" from %q", repository.Location(repo))
str += fmt.Sprintf(" from %q", gitstore.Location(repo))
}
return str
}
10 changes: 5 additions & 5 deletions core/pkg/executor/action_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
"drassi.run/core/pkg/model/workflows"
"drassi.run/core/pkg/sandboxer"
"drassi.run/core/pkg/scribe"
"drassi.run/core/pkg/store/repository"
"drassi.run/core/pkg/store/git"
"drassi.run/core/util/otel"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

type NodeActionSpec struct {
Repo *repository.Repository
Repo *gitstore.RepoReference
Inputs workflows.Evaluable[map[string]string]
Outputs workflows.Evaluable[map[string]string]

Expand Down Expand Up @@ -57,7 +57,7 @@ func (e *nodeActionExecutor) StepExecutor() StepExecutor {
}

func (e *nodeActionExecutor) Name() workflows.Evaluable[string] {
name := repository.Location(e.spec.Repo)
name := gitstore.Location(e.spec.Repo)
return workflows.NewLiteralToken(name)
}

Expand Down Expand Up @@ -139,7 +139,7 @@ func (e *nodeActionExecutor) computeScriptPath(layout *sandboxer.Layout, stage S
script = e.spec.Main
}

scriptPath := filepath.Join(layout.Actions, repository.Location(e.spec.Repo), script)
scriptPath := filepath.Join(layout.Actions, gitstore.Location(e.spec.Repo), script)
return scriptPath
}

Expand All @@ -160,5 +160,5 @@ func (e *nodeActionExecutor) addSpanAttrs(ctx context.Context, stage Stage) {
}

func (e *nodeActionExecutor) repr() string {
return fmt.Sprintf("node action from %q", repository.Location(e.spec.Repo))
return fmt.Sprintf("node action from %q", gitstore.Location(e.spec.Repo))
}
21 changes: 10 additions & 11 deletions core/pkg/executor/action_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import (
"drassi.run/core/pkg/model/workflows"
"drassi.run/core/pkg/sandboxer"
"drassi.run/core/pkg/scribe"
"drassi.run/core/pkg/store/repository"
"drassi.run/core/pkg/store/repository/gitstore"
"drassi.run/core/pkg/store/git"
"drassi.run/core/util/dig"
"drassi.run/core/util/otel"
"github.com/go-git/go-git/v5/plumbing/object"
Expand All @@ -36,13 +35,13 @@ type ReferenceActionSpec struct {
// + Using a public action: `uses: actions/aws@v2.0.1`
// + Using a public action in a subdirectory: `uses: actions/aws/ec2@main`
// + Using a local action: `uses: ./.github/actions/hello-world-action`
Repo *repository.Repository
Repo *gitstore.RepoReference

// cache resolved revision
rev string
}

func (spec *ReferenceActionSpec) Repository() *repository.Repository {
func (spec *ReferenceActionSpec) Repository() *gitstore.RepoReference {
return spec.Repo
}

Expand All @@ -53,11 +52,11 @@ func (spec *ReferenceActionSpec) CreateExecutor(

var (
forge *records.Forge
store gitstore.Store
store gitstore.Manager
)

span := trace.SpanFromContext(ctx)
span.SetAttributes(xotel.ActionRepo(repository.Location(spec.Repo)))
span.SetAttributes(xotel.ActionRepo(gitstore.Location(spec.Repo)))

if err := xdig.Populate(scope, &forge); err != nil {
return nil, err
Expand All @@ -72,14 +71,14 @@ func (spec *ReferenceActionSpec) CreateExecutor(
token := forge.Token
// If the action is located in different server than the job repo,
// unset the token to prevent an unauthenticated error.
if repository.Endpoint(spec.Repo) != spec.serverDomain(forge.ServerUrl) {
if gitstore.Endpoint(spec.Repo) != spec.serverDomain(forge.ServerUrl) {
token = ""
}

if rev, err := store.Fetch(ctx, spec.Repo, token); err != nil {
return nil, err
} else {
s.Writef("Download action repository %q (SHA:%s)", repository.Location(spec.Repo), rev)
s.Writef("Download action repository %q (SHA:%s)", gitstore.Location(spec.Repo), rev)
spec.rev = rev
}

Expand All @@ -92,7 +91,7 @@ func (spec *ReferenceActionSpec) CreateExecutor(
}
}

func (spec *ReferenceActionSpec) loadAction(ctx context.Context, s *scribe.Scribe, store gitstore.Store) (ActionSpec, error) {
func (spec *ReferenceActionSpec) loadAction(ctx context.Context, s *scribe.Scribe, store gitstore.Manager) (ActionSpec, error) {
span := trace.SpanFromContext(ctx)

// 1. First, try reading "action.yml" or "action.yaml" file
Expand Down Expand Up @@ -154,8 +153,8 @@ func (spec *ReferenceActionSpec) createDockerfileAction(dockerfile string) (Acti
return action, nil
}

func (spec *ReferenceActionSpec) transferAction(ctx context.Context, store gitstore.Store, sandbox sandboxer.Sandbox) error {
location := repository.FullName(spec.Repo) + "@" + spec.Repo.Ref
func (spec *ReferenceActionSpec) transferAction(ctx context.Context, store gitstore.Manager, sandbox sandboxer.Sandbox) error {
location := gitstore.FullName(spec.Repo) + "@" + spec.Repo.Ref
r, err := store.Read(ctx, spec.Repo, spec.rev, location)
if err != nil {
return err
Expand Down
6 changes: 4 additions & 2 deletions core/pkg/executor/step_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"drassi.run/core/pkg/model/workflows"
"drassi.run/core/pkg/sandboxer"
"drassi.run/core/pkg/scribe"
"drassi.run/core/pkg/store/repository"
"drassi.run/core/pkg/store/git"
"drassi.run/core/pkg/stream"
"drassi.run/core/util/context"
"drassi.run/core/util/dig"
Expand Down Expand Up @@ -200,7 +200,9 @@ func (e *stepExecutor) init(ctx context.Context, scope *dig.Scope) (ex error) {
e.aExec = exec
}

if r, ok := e.spec.Action.(interface{ Repository() *repository.Repository }); ok {
if r, ok := e.spec.Action.(interface {
Repository() *gitstore.RepoReference
}); ok {
repo := r.Repository()

e.forge.ActionRepository = repo.Name
Expand Down
6 changes: 3 additions & 3 deletions core/pkg/executor/z_converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"drassi.run/core/pkg/model/actions"
"drassi.run/core/pkg/model/records"
"drassi.run/core/pkg/model/workflows"
"drassi.run/core/pkg/store/repository"
"drassi.run/core/pkg/store/git"
"github.com/google/uuid"
)

Expand Down Expand Up @@ -95,7 +95,7 @@ func ToStepSpec(step workflows.Step) *StepSpec {
Image: s.Uses,
}
} else {
repo, _ := repository.Parse(s.Uses)
repo, _ := gitstore.Parse(s.Uses)
spec.Action = &ReferenceActionSpec{
Repo: repo,
}
Expand All @@ -104,7 +104,7 @@ func ToStepSpec(step workflows.Step) *StepSpec {
return spec
}

func ToActionSpec(action *actions.Action, repo *repository.Repository) (ActionSpec, error) {
func ToActionSpec(action *actions.Action, repo *gitstore.RepoReference) (ActionSpec, error) {
var spec ActionSpec
switch r := action.Runs.(type) {
case *actions.NodeRuns:
Expand Down
Loading
Loading