Skip to content

Commit c462d61

Browse files
authored
Revert "Miscellaneous cleanup (#740)"
This reverts commit 029bd2d.
1 parent 029bd2d commit c462d61

File tree

176 files changed

+4324
-3490
lines changed

Some content is hidden

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

176 files changed

+4324
-3490
lines changed

.golangci.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,22 @@ linters-settings:
7070
goheader:
7171
values:
7272
const:
73-
AUTHOR: Yota Hamada
73+
AUTHOR: The Dagu Authors
7474
template: |-
7575
Copyright (C) {{ YEAR }} {{ AUTHOR }}
76-
SPDX-License-Identifier: GPL-3.0-or-later
76+
77+
This program is free software: you can redistribute it and/or modify
78+
it under the terms of the GNU General Public License as published by
79+
the Free Software Foundation, either version 3 of the License, or
80+
(at your option) any later version.
81+
82+
This program is distributed in the hope that it will be useful,
83+
but WITHOUT ANY WARRANTY; without even the implied warranty of
84+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
85+
GNU General Public License for more details.
86+
87+
You should have received a copy of the GNU General Public License
88+
along with this program. If not, see <https://www.gnu.org/licenses/>.
7789
7890
run:
7991
allow-parallel-runners: true

.goreleaser.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ before:
66
# You may remove this if you don't use go modules.
77
- go mod tidy
88
builds:
9-
- dir: ./cmd
9+
- dir: .
1010
env:
1111
- CGO_ENABLED=0
1212
goos:
@@ -35,7 +35,7 @@ brews:
3535
name: homebrew-tap
3636
directory: Formula
3737
homepage: "https://github.com/dagu-org/dagu"
38-
description: "A No-code workflow engine that runs DAGs defined in a simple YAML format"
38+
description: "A No-code workflow executor that runs DAGs defined in a simple YAML format"
3939
license: "GNU General Public License v3.0"
4040
custom_block: |
4141
service do
@@ -50,7 +50,7 @@ brews:
5050
name: homebrew-brew
5151
directory: Formula
5252
homepage: "https://github.com/dagu-org/dagu"
53-
description: "A No-code workflow engine that runs DAGs defined in a simple YAML format"
53+
description: "A No-code workflow executor that runs DAGs defined in a simple YAML format"
5454
license: "GNU General Public License v3.0"
5555
custom_block: |
5656
service do

.vscode/settings.json

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"editor.formatOnSave": true,
66
"editor.defaultFormatter": "golang.go"
77
},
8-
"[markdown]": {
9-
"editor.formatOnSave": false
10-
},
118
"editor.rulers": [
129
80
1310
],

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY . .
2323
RUN go mod download && rm -rf frontend/assets
2424
COPY --from=ui-builder /app/dist/ ./internal/frontend/assets/
2525

26-
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="${LDFLAGS}" -o ./bin/dagu ./cmd
26+
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="${LDFLAGS}" -o ./bin/dagu .
2727

2828
# Stage 3: Final Image
2929
FROM --platform=$TARGETPLATFORM alpine:latest

LICENSE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
632632
the "copyright" line and a pointer to where the full notice is found.
633633

634634
<one line to give the program's name and a brief idea of what it does.>
635-
Copyright (C) 2024 Yota Hamada
635+
Copyright (C) <year> <name of author>
636636

637637
This program is free software: you can redistribute it and/or modify
638638
it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
652652
If the program does terminal interaction, make it output a short
653653
notice like this when it starts in an interactive mode:
654654

655-
<program> Copyright (C) 2024 Yota Hamada
655+
<program> Copyright (C) <year> <name of author>
656656
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657657
This is free software, and you are welcome to redistribute it
658658
under certain conditions; type `show c' for details.

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ OPENSSL_CONF=${CONFIG_DIR}/openssl.local.conf
8383
# run starts the frontend server and the scheduler.
8484
run: ${FE_BUNDLE_JS}
8585
@echo "${COLOR_GREEN}Starting the frontend server and the scheduler...${COLOR_RESET}"
86-
@go run ./cmd start-all
86+
@go run . start-all
8787

8888
# server build the binary and start the server.
8989
run-server: golangci-lint build-bin
@@ -105,7 +105,7 @@ run-server-https: ${SERVER_CERT_FILE} ${SERVER_KEY_FILE}
105105
@echo "${COLOR_GREEN}Starting the server with HTTPS...${COLOR_RESET}"
106106
@DAGU_CERT_FILE=${SERVER_CERT_FILE} \
107107
DAGU_KEY_FILE=${SERVER_KEY_FILE} \
108-
go run ./cmd start-all
108+
go run . start-all
109109

110110
# test runs all tests.
111111
test: build-bin
@@ -189,7 +189,7 @@ addlicense:
189189
-ignore "**/*.yaml" \
190190
-ignore "**/filenotify/*" \
191191
-ignore "**/testdata/**" \
192-
-c "Yota Hamada" \
192+
-c "The Dagu Authors" \
193193
-f scripts/header.txt \
194194
.
195195

@@ -201,7 +201,7 @@ addlicense:
201201
build-bin:
202202
@echo "${COLOR_GREEN}Building the binary...${COLOR_RESET}"
203203
@mkdir -p ${BIN_DIR}
204-
@go build -ldflags="$(LDFLAGS)" -o ${BIN_DIR}/${APP_NAME} ./cmd
204+
@go build -ldflags="$(LDFLAGS)" -o ${BIN_DIR}/${APP_NAME} .
205205

206206
# build-ui builds the frontend codes.
207207
build-ui:

cmd/common.go

-64
This file was deleted.

cmd/common_test.go

+23-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
// Copyright (C) 2024 Yota Hamada
2-
// SPDX-License-Identifier: GPL-3.0-or-later
3-
4-
package main
1+
// Copyright (C) 2024 The Dagu Authors
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful,
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU General Public License
14+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
15+
16+
package cmd
517

618
import (
7-
"context"
819
"path/filepath"
920
"testing"
1021
"time"
1122

1223
"github.com/dagu-org/dagu/internal/config"
13-
"github.com/dagu-org/dagu/internal/digraph"
14-
"github.com/dagu-org/dagu/internal/fileutil"
24+
"github.com/dagu-org/dagu/internal/dag"
1525
"github.com/dagu-org/dagu/internal/persistence"
1626

1727
"github.com/dagu-org/dagu/internal/client"
18-
"github.com/dagu-org/dagu/internal/digraph/scheduler"
28+
"github.com/dagu-org/dagu/internal/dag/scheduler"
29+
"github.com/dagu-org/dagu/internal/util"
1930
"github.com/spf13/cobra"
2031
"github.com/stretchr/testify/require"
2132
)
@@ -95,7 +106,7 @@ func withSpool(t *testing.T, testFunction func()) string {
95106

96107
func testDAGFile(name string) string {
97108
return filepath.Join(
98-
filepath.Join(fileutil.MustGetwd(), "testdata"),
109+
filepath.Join(util.MustGetwd(), "testdata"),
99110
name,
100111
)
101112
}
@@ -112,12 +123,11 @@ func testStatusEventual(t *testing.T, e client.Client, dagFile string, expected
112123
cfg, err := config.Load()
113124
require.NoError(t, err)
114125

115-
dag, err := digraph.Load(context.Background(), cfg.BaseConfig, dagFile, "")
126+
workflow, err := dag.Load(cfg.BaseConfig, dagFile, "")
116127
require.NoError(t, err)
117128

118-
ctx := context.Background()
119129
require.Eventually(t, func() bool {
120-
status, err := e.GetCurrentStatus(ctx, dag)
130+
status, err := e.GetCurrentStatus(workflow)
121131
require.NoError(t, err)
122132
return expected == status.Status
123133
}, waitForStatusTimeout, tick)
@@ -133,7 +143,7 @@ func testLastStatusEventual(
133143
t.Helper()
134144

135145
require.Eventually(t, func() bool {
136-
status := hs.ReadStatusRecent(context.Background(), dg, 1)
146+
status := hs.ReadStatusRecent(dg, 1)
137147
if len(status) < 1 {
138148
return false
139149
}

0 commit comments

Comments
 (0)