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

Update to latest goflow that adds flow spec 13.6 #371

Merged
merged 2 commits into from
Dec 3, 2024
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
14 changes: 10 additions & 4 deletions core/goflow/flows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

func TestSpecVersion(t *testing.T) {
assert.Equal(t, semver.MustParse("13.5.0"), goflow.SpecVersion())
assert.Equal(t, semver.MustParse("13.6.0"), goflow.SpecVersion())
}

func TestReadFlow(t *testing.T) {
Expand Down Expand Up @@ -64,6 +64,7 @@ func TestMigrateDefinition(t *testing.T) {
v13_3_0 := testsuite.ReadFile("testdata/migrate/13.3.0.json")
v13_4_0 := testsuite.ReadFile("testdata/migrate/13.4.0.json")
v13_5_0 := testsuite.ReadFile("testdata/migrate/13.5.0.json")
v13_6_0 := testsuite.ReadFile("testdata/migrate/13.6.0.json")

// 13.0 > 13.1
migrated, err := goflow.MigrateDefinition(rt.Config, v13_0_0, semver.MustParse("13.1.0"))
Expand All @@ -90,8 +91,13 @@ func TestMigrateDefinition(t *testing.T) {
assert.NoError(t, err)
test.AssertEqualJSON(t, v13_5_0, migrated)

// 13.0 > 13.5
migrated, err = goflow.MigrateDefinition(rt.Config, v13_0_0, semver.MustParse("13.5.0"))
// 13.5 > 13.6
migrated, err = goflow.MigrateDefinition(rt.Config, migrated, semver.MustParse("13.6.0"))
assert.NoError(t, err)
test.AssertEqualJSON(t, v13_5_0, migrated)
test.AssertEqualJSON(t, v13_6_0, migrated)

// 13.0 > 13.6
migrated, err = goflow.MigrateDefinition(rt.Config, v13_0_0, semver.MustParse("13.6.0"))
assert.NoError(t, err)
test.AssertEqualJSON(t, v13_6_0, migrated)
}
31 changes: 31 additions & 0 deletions core/goflow/testdata/migrate/13.6.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"uuid": "502c3ee4-3249-4dee-8e71-c62070667d52",
"name": "New",
"spec_version": "13.6.0",
"type": "messaging",
"language": "und",
"nodes": [
{
"uuid": "d26486b1-193d-4512-85f0-c6db696f1e1c",
"actions": [
{
"uuid": "82a1de5f-af1a-45ef-8511-4d60c160e486",
"type": "send_msg",
"text": "Hello @webhook.json",
"template": {
"uuid": "641b8b05-082a-497e-bf63-38aa48b1f0c4",
"name": "welcome"
},
"template_variables": [
"@contact.name"
]
}
],
"exits": [
{
"uuid": "fdd370e0-ffa9-48b3-8148-b9241d74fc72"
}
]
}
]
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/lib/pq v1.10.9
github.com/nyaruka/ezconf v0.3.0
github.com/nyaruka/gocommon v1.59.3
github.com/nyaruka/goflow v0.224.1
github.com/nyaruka/goflow v0.225.0
github.com/nyaruka/null/v3 v3.0.0
github.com/nyaruka/redisx v0.8.1
github.com/nyaruka/rp-indexer/v9 v9.2.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ github.com/nyaruka/ezconf v0.3.0 h1:kGvJqVN8AHowb4HdaHAviJ0Z3yI5Pyekp1WqibFEaGk=
github.com/nyaruka/ezconf v0.3.0/go.mod h1:89GUW6EPRNLIxT7lC4LWnjWTgZeQwRoX7lBmc8ralAU=
github.com/nyaruka/gocommon v1.59.3 h1:fdjs9Z7aH+zog7FXlEpvJ0GtI6XNdNdBtjFxw5kVB7s=
github.com/nyaruka/gocommon v1.59.3/go.mod h1:peOpluiVBMeQu81Ar+7EPQVT7vawN6ho9Kh1k/Gj8Vk=
github.com/nyaruka/goflow v0.224.1 h1:JhQ3QzT7yO6JnPdFxCJ4o+vgbxfl3+seKaKzf3tcmxA=
github.com/nyaruka/goflow v0.224.1/go.mod h1:1Up4YMccDCugTrVcXEbNCxDJqZRJindQR75oiMBCZvY=
github.com/nyaruka/goflow v0.225.0 h1:N3LF00hTaQNrKzjRF2knNQzjJY7Kc3i7lV2q2j7ovOo=
github.com/nyaruka/goflow v0.225.0/go.mod h1:1Up4YMccDCugTrVcXEbNCxDJqZRJindQR75oiMBCZvY=
github.com/nyaruka/librato v1.1.1 h1:0nTYtJLl3Sn7lX3CuHsLf+nXy1k/tGV0OjVxLy3Et4s=
github.com/nyaruka/librato v1.1.1/go.mod h1:fme1Fu1PT2qvkaBZyw8WW+SrnFe2qeeCWpvqmAaKAKE=
github.com/nyaruka/null/v2 v2.0.3 h1:rdmMRQyVzrOF3Jff/gpU/7BDR9mQX0lcLl4yImsA3kw=
Expand Down
6 changes: 3 additions & 3 deletions web/flow/testdata/change_language.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"response": {
"uuid": "19cad1f2-9110-4271-98d4-1b968bf19410",
"name": "Change Language",
"spec_version": "13.5.0",
"spec_version": "13.6.0",
"language": "kin",
"type": "messaging",
"revision": 16,
Expand Down Expand Up @@ -517,7 +517,7 @@
"response": {
"uuid": "19cad1f2-9110-4271-98d4-1b968bf19410",
"name": "Change Language",
"spec_version": "13.5.0",
"spec_version": "13.6.0",
"language": "ara",
"type": "messaging",
"revision": 16,
Expand Down Expand Up @@ -842,7 +842,7 @@
"response": {
"uuid": "19cad1f2-9110-4271-98d4-1b968bf19410",
"name": "Change Language",
"spec_version": "13.5.0",
"spec_version": "13.6.0",
"language": "spa",
"type": "messaging",
"revision": 16,
Expand Down
2 changes: 1 addition & 1 deletion web/flow/testdata/inspect.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"flow": {
"uuid": "8f107d42-7416-4cf2-9a51-9490361ad517",
"name": "Invalid Flow",
"spec_version": "13.5.0",
"spec_version": "13.6.0",
"language": "base",
"type": "messaging",
"revision": 1,
Expand Down
4 changes: 2 additions & 2 deletions web/flow/testdata/migrate.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}
],
"revision": 1,
"spec_version": "13.5.0",
"spec_version": "13.6.0",
"type": "messaging",
"uuid": "42362831-f376-4df1-b6d9-a80b102821d9"
}
Expand Down Expand Up @@ -169,7 +169,7 @@
}
],
"revision": 1,
"spec_version": "13.5.0",
"spec_version": "13.6.0",
"type": "messaging",
"uuid": "42362831-f376-4df1-b6d9-a80b102821d9"
}
Expand Down
2 changes: 1 addition & 1 deletion web/po/testdata/import.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{
"uuid": "9de3663f-c5c5-4c92-9f45-ecbc09abcc85",
"name": "Favorites",
"spec_version": "13.5.0",
"spec_version": "13.6.0",
"language": "und",
"type": "messaging",
"revision": 1,
Expand Down
Loading