Skip to content

Commit c221e75

Browse files
committed
Merge branch 'main' into temp-to-expr
2 parents 1267582 + 4606279 commit c221e75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+497
-267
lines changed

.github/workflows/analyze.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Go
2424
uses: actions/setup-go@v5
2525
with:
26-
go-version: "^1.23"
26+
go-version: "^1.24"
2727
- name: Install Go Tools
2828
run: |
2929
go install go.uber.org/mock/[email protected]
@@ -50,11 +50,11 @@ jobs:
5050
- name: Set up Go
5151
uses: actions/setup-go@v5
5252
with:
53-
go-version: "^1.23"
53+
go-version: "^1.24"
5454
- name: golangci-lint
5555
uses: golangci/golangci-lint-action@v6
5656
with:
57-
version: v1.60.3
57+
version: v1.64.5
5858
args: --out-format=sarif:results.sarif,colored-line-number,github-actions
5959
- name: Upload SARIF file
6060
uses: github/codeql-action/upload-sarif@v3

.github/workflows/codeql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Go
2323
uses: actions/setup-go@v5
2424
with:
25-
go-version: "^1.23"
25+
go-version: "^1.24"
2626
- name: Initialize CodeQL
2727
uses: github/codeql-action/init@v3
2828
with:

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Set up Go
2828
uses: actions/setup-go@v5
2929
with:
30-
go-version: "^1.23"
30+
go-version: "^1.24"
3131
- name: Generate docs
3232
run: |
3333
go run ./tools/docsgen/.
@@ -52,7 +52,7 @@ jobs:
5252
- name: Set up Go
5353
uses: actions/setup-go@v5
5454
with:
55-
go-version: "^1.23"
55+
go-version: "^1.24"
5656
- name: Set up QEMU
5757
uses: docker/setup-qemu-action@v3
5858
- name: Login to GitHub Container Registry

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Go
2525
uses: actions/setup-go@v5
2626
with:
27-
go-version: "^1.23"
27+
go-version: "^1.24"
2828
- name: Run Tests with Retries
2929
uses: nick-invision/retry@v3
3030
with:

.golangci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ linters-settings:
1717
enable-all: true
1818
disable:
1919
- fieldalignment # too strict
20-
tenv:
21-
all: true
2220

2321
linters:
2422
disable-all: true
@@ -61,7 +59,7 @@ linters:
6159
- predeclared # finds code that shadows one of Go's predeclared identifiers
6260
- reassign # checks that package variables are not reassigned
6361
- stylecheck # is a replacement for golint
64-
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
62+
- usetesting # detects when some calls can be replaced by methods from the testing package
6563
- testableexamples # checks if examples are testable (have an expected output)
6664
- testpackage # makes you use a separate _test package
6765
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
@@ -94,6 +92,8 @@ issues:
9492
- gosec
9593
- noctx
9694
- wrapcheck
95+
- linters: [gosec]
96+
text: "G115"
9797
- linters:
9898
- staticcheck
9999
text: "SA5011" # SA5011: Should not use unsafe.Pointer - this throws false positives when a nil check does not result in a return

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23.3-bookworm
1+
FROM golang:1.24.1-bookworm
22

33
ENV DISABLE_FLOW_INTERACTIVE="true"
44

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<p align="center">
66
<a href="https://img.shields.io/github/v/release/jahvon/flow"><img src="https://img.shields.io/github/v/release/jahvon/flow" alt="GitHub release"></a>
77
<a href="https://pkg.go.dev/github.com/jahvon/flow"><img src="https://pkg.go.dev/badge/github.com/jahvon/flow.svg" alt="Go Reference"></a>
8-
<a href="https://goreportcard.com/report/github.com/jahvon/flow"><img src="https://goreportcard.com/badge/github.com/jahvon/flow" alt="Go Report Card"></a>
98
</p>
109

1110
<p align="center">

cmd/internal/exec.go

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func RegisterExecCmd(ctx *context.Context, rootCmd *cobra.Command) {
4040
io.TypesDocsURL("flowfile", "ExecutableRef"),
4141
execExamples,
4242
),
43-
Args: cobra.MinimumNArgs(1),
43+
Args: cobra.ArbitraryArgs,
4444
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
4545
execList, err := ctx.ExecutableCache.GetExecutableList(ctx.Logger)
4646
if err != nil {
@@ -82,8 +82,14 @@ func execFunc(ctx *context.Context, cmd *cobra.Command, verb executable.Verb, ar
8282
logger.FatalErr(err)
8383
}
8484

85-
idArg := args[0]
86-
ref := context.ExpandRef(ctx, executable.NewRef(idArg, verb))
85+
var ref executable.Ref
86+
if len(args) == 0 {
87+
ref = context.ExpandRef(ctx, executable.NewRef("", verb))
88+
} else {
89+
idArg := args[0]
90+
ref = context.ExpandRef(ctx, executable.NewRef(idArg, verb))
91+
}
92+
8793
e, err := ctx.ExecutableCache.GetExecutableByRef(logger, ref)
8894
if err != nil && errors.Is(cache.NewExecutableNotFoundError(ref.String()), err) {
8995
logger.Debugf("Executable %s not found in cache, syncing cache", ref)
@@ -108,12 +114,15 @@ func execFunc(ctx *context.Context, cmd *cobra.Command, verb executable.Verb, ar
108114
))
109115
}
110116

111-
execArgs := args[1:]
117+
execArgs := make([]string, 0)
118+
if len(args) >= 2 {
119+
execArgs = args[1:]
120+
}
112121
envMap, err := argUtils.ProcessArgs(e, execArgs, nil)
113122
if err != nil {
114123
logger.FatalErr(err)
115124
}
116-
s, err := store.NewStore()
125+
s, err := store.NewStore(store.Path())
117126
if err != nil {
118127
logger.FatalErr(err)
119128
}
@@ -145,7 +154,7 @@ func execFunc(ctx *context.Context, cmd *cobra.Command, verb executable.Verb, ar
145154
logger.FatalErr(err)
146155
}
147156
dur := time.Since(startTime)
148-
processStore, err := store.NewStore()
157+
processStore, err := store.NewStore(store.Path())
149158
if err != nil {
150159
logger.Errorf("failed clearing process store\n%v", err)
151160
}
@@ -369,6 +378,14 @@ Flag arguments are specified with the format 'flag=value' and positional argumen
369378
`
370379
execExamples = `
371380
#### Examples
381+
**Execute a nameless flow in the current workspace with the 'install' verb**
382+
383+
flow install
384+
385+
**Execute a nameless flow in the 'ws' workspace with the 'test' verb**
386+
387+
flow test ws
388+
372389
**Execute the 'build' flow in the current workspace and namespace**
373390
374391
flow exec build

cmd/internal/flags/helpers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/jahvon/flow/internal/context"
1111
)
1212

13+
//nolint:errcheck
1314
func ToPflag(cmd *cobra.Command, metadata Metadata, persistent bool) (*pflag.FlagSet, error) {
1415
flagSet := cmd.Flags()
1516
if persistent {
@@ -108,5 +109,6 @@ func ValueFor[T any](ctx *context.Context, cmd *cobra.Command, metadata Metadata
108109
logger.Fatalf("unexpected flag default type (%v)", reflect.TypeOf(metadata.Default).Kind())
109110
}
110111

112+
//nolint:errcheck
111113
return val.(T)
112114
}

cmd/internal/flags/helpers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ var _ = Describe("ValueFor", func() {
7171
Expect(err).NotTo(HaveOccurred())
7272
cmd.Flags().AddFlagSet(flagset)
7373
if reflect.TypeOf(expectedValue).Kind() == reflect.Slice {
74+
//nolint:errcheck
7475
err = cmd.ParseFlags([]string{"--test", expectedValue.([]string)[0]})
7576
} else {
7677
err = cmd.ParseFlags([]string{"--test=" + fmt.Sprintf("%v", expectedValue)})

0 commit comments

Comments
 (0)