Skip to content

Commit e067196

Browse files
authored
Preprod to main for feature release v1.6.3 (#537)
1 parent 839a02f commit e067196

File tree

26 files changed

+512
-152
lines changed

26 files changed

+512
-152
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2.1
44
parameters:
55
golang-tag:
66
type: string
7-
default: "1.21"
7+
default: "1.22"
88
nodejs-ver:
99
type: integer
1010
default: 16

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SHELL:= /bin/bash
22
DEBUG_FLAG?=false
3-
GO_VERSION=1.21
3+
GO_VERSION=1.22
44

55
ifeq ($(DEBUG), "true")
66
BINDATA_OPTS="-debug"
@@ -159,7 +159,8 @@ fmt:
159159

160160
.PHONY: test
161161
test: generate
162-
go test $(COVERAGE_OPTS) ./main/... ./sys/... ./storage/... ./service/...
162+
go test $(COVERAGE_OPTS) ./main/... ./sys/... ./storage/... ./service/...; ret=$$?; \
163+
echo $$ret
163164

164165
.PHONY: test-integration
165166
test-integration:

demo/restore_db/i18n

0 Bytes
Binary file not shown.

go.mod

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/ProxeusApp/proxeus-core
22

3-
go 1.20
3+
go 1.21
4+
5+
toolchain go1.22.0
46

57
require (
68
github.com/SparkPost/gosparkpost v0.2.0
@@ -30,8 +32,8 @@ require (
3032
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
3133
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
3234
go.etcd.io/bbolt v1.3.8 // indirect
33-
golang.org/x/crypto v0.21.0
34-
golang.org/x/net v0.22.0
35+
golang.org/x/crypto v0.22.0
36+
golang.org/x/net v0.24.0
3537
gopkg.in/gavv/httpexpect.v2 v2.16.0
3638
)
3739

@@ -43,7 +45,7 @@ require (
4345
github.com/gorilla/context v1.1.2 // indirect
4446
github.com/gorilla/websocket v1.5.1 // indirect
4547
github.com/klauspost/compress v1.17.3 // indirect
46-
github.com/labstack/echo-contrib v0.15.0
48+
github.com/labstack/echo-contrib v0.17.0
4749
github.com/mattn/go-colorable v0.1.13 // indirect
4850
github.com/sergi/go-diff v1.3.1 // indirect
4951
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
@@ -59,7 +61,7 @@ require (
5961

6062
require (
6163
github.com/labstack/echo/v4 v4.11.4
62-
go.mongodb.org/mongo-driver v1.14.0
64+
go.mongodb.org/mongo-driver v1.15.0
6365
)
6466

6567
require (
@@ -78,7 +80,7 @@ require (
7880
github.com/go-ole/go-ole v1.3.0 // indirect
7981
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
8082
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
81-
github.com/golang/protobuf v1.5.3 // indirect
83+
github.com/golang/protobuf v1.5.4 // indirect
8284
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
8385
github.com/google/go-cmp v0.6.0 // indirect
8486
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a // indirect
@@ -102,7 +104,7 @@ require (
102104
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
103105
golang.org/x/mod v0.14.0 // indirect
104106
golang.org/x/sync v0.5.0 // indirect
105-
golang.org/x/sys v0.18.0 // indirect
107+
golang.org/x/sys v0.19.0 // indirect
106108
golang.org/x/text v0.14.0 // indirect
107109
golang.org/x/time v0.5.0 // indirect
108110
golang.org/x/tools v0.16.1 // indirect

go.sum

Lines changed: 64 additions & 20 deletions
Large diffs are not rendered by default.

main/www/security.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func redirectToLogin(c echo.Context) error {
5454
if isAjax {
5555
return echo.ErrUnauthorized
5656
}
57-
return c.Redirect(http.StatusTemporaryRedirect, "/login")
57+
return c.Redirect(http.StatusTemporaryRedirect, "/login?redirect="+req.URL.Path)
5858
}
5959

6060
func getURI(host, url string) string {

service/document.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (me *DefaultDocumentService) Edit(auth model.Auth, userId string, formInput
8787
if !ok {
8888
return ErrUnableToEdit
8989
}
90-
if len(fName) >= 80 || !filenameRegex.MatchString(fName) {
90+
if len(fName) > 80 || !filenameRegex.MatchString(fName) {
9191
return ErrUnableToEdit
9292
}
9393
usrDataItem, err := userDataDB().Get(auth, userId)

sys/workflow/engine.go

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ func (me *Engine) setupNodes(ctx *context) error {
304304
if len(me.nodeImpls) == 0 {
305305
return ErrNodeImplementationNotProvided
306306
}
307+
307308
for _, item := range ctx.flow.Nodes {
308-
item.internalNode = item.isCondition() || item.isWorkflow()
309+
item.internalNode = item.isCondition() || item.isWorkflow() || item.isPlaceholder()
309310
if !item.internalNode {
310311
if s, ok := me.nodeImpls[item.Type]; ok && s.InitImplFunc != nil {
311312
item.new = s.InitImplFunc
@@ -319,6 +320,62 @@ func (me *Engine) setupNodes(ctx *context) error {
319320
return nil
320321
}
321322

323+
func (me *Engine) removeUselessNodes(ctx *context) error {
324+
uselessConnections := make(map[string]*Connection, 0)
325+
326+
for name, item := range ctx.flow.Nodes {
327+
if !item.isPlaceholder() {
328+
continue
329+
}
330+
331+
for _, conn := range item.Connections {
332+
correctConnection := conn
333+
currentNode := ctx.flow.Nodes[correctConnection.NodeID]
334+
335+
for currentNode.isPlaceholder() {
336+
if len(currentNode.Connections) > 0 {
337+
correctConnection = currentNode.Connections[0]
338+
currentNode = ctx.flow.Nodes[correctConnection.NodeID]
339+
} else {
340+
break
341+
}
342+
}
343+
344+
uselessConnections[name] = correctConnection
345+
}
346+
}
347+
348+
for _, item := range ctx.flow.Nodes {
349+
if item.isPlaceholder() {
350+
continue
351+
}
352+
353+
for i := 0; i < len(item.Connections); i++ {
354+
conn := item.Connections[i]
355+
356+
if val, ok := uselessConnections[conn.NodeID]; ok {
357+
item.Connections[i] = val
358+
}
359+
}
360+
}
361+
362+
if val, ok := uselessConnections[ctx.flow.Start.NodeID]; ok {
363+
ctx.flow.Start.NodeID = val.NodeID
364+
}
365+
366+
filteredNodes := make(map[string]*Node, 0)
367+
368+
for name, item := range ctx.flow.Nodes {
369+
if !item.isPlaceholder() {
370+
filteredNodes[name] = item
371+
}
372+
}
373+
374+
ctx.flow.Nodes = filteredNodes
375+
376+
return nil
377+
}
378+
322379
func (me *Engine) execute(nn *Node, considerSteps bool) (proceed bool, err error) {
323380
nn.focus()
324381
if nn.internalNode {

sys/workflow/node.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ func (n *Node) isWorkflow() bool {
7171
return n.Type == "workflow"
7272
}
7373

74+
func (n *Node) isPlaceholder() bool {
75+
return n.Type == "placeholder"
76+
}
77+
7478
func (me *Node) getImpl() (NodeIF, error) {
7579
//instance is still valid for reuse
7680
if me.impl != nil {

sys/workflow/workflow.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ func newWorkflow(wf *Workflow, engine *Engine, parent *context) (*context, error
7373
if wf == nil {
7474
return nil, ErrWorkflowMissing
7575
}
76+
7677
if wf.Flow == nil || wf.Flow.Start == nil || wf.Flow.Start.NodeID == "" {
7778
return nil, ErrStartNodeMissing
7879
}
80+
7981
me := context{
8082
id: "root",
8183
flow: wf.Flow,
@@ -84,11 +86,18 @@ func newWorkflow(wf *Workflow, engine *Engine, parent *context) (*context, error
8486
engine: engine,
8587
}
8688

87-
err := engine.setupNodes(&me)
89+
err := engine.removeUselessNodes(&me)
8890
if err != nil {
8991
return nil, err
9092
}
93+
94+
err = engine.setupNodes(&me)
95+
if err != nil {
96+
return nil, err
97+
}
98+
9199
me.start()
100+
92101
return &me, nil
93102
}
94103

@@ -122,6 +131,8 @@ func (me *context) resolve(n *Node) error {
122131
return err
123132
}
124133
return me.resolve(nn)
134+
} else if n.isPlaceholder() {
135+
return nil
125136
} else if n.isWorkflow() {
126137
return me.stepIntoWorkflow(n)
127138
}

0 commit comments

Comments
 (0)