Skip to content

Commit

Permalink
Merge pull request #376 from nyaruka/13.6.1
Browse files Browse the repository at this point in the history
Update goflow which has new 13.6.1 flow migration
  • Loading branch information
rowanseymour authored Dec 9, 2024
2 parents bae638f + 7322013 commit fad343e
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 17 deletions.
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.6.0"), goflow.SpecVersion())
assert.Equal(t, semver.MustParse("13.6.1"), goflow.SpecVersion())
}

func TestReadFlow(t *testing.T) {
Expand Down Expand Up @@ -65,6 +65,7 @@ func TestMigrateDefinition(t *testing.T) {
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")
v13_6_1 := testsuite.ReadFile("testdata/migrate/13.6.1.json")

// 13.0 > 13.1
migrated, err := goflow.MigrateDefinition(rt.Config, v13_0_0, semver.MustParse("13.1.0"))
Expand Down Expand Up @@ -96,8 +97,13 @@ func TestMigrateDefinition(t *testing.T) {
assert.NoError(t, err)
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"))
// 13.6 > 13.6.1
migrated, err = goflow.MigrateDefinition(rt.Config, migrated, semver.MustParse("13.6.1"))
assert.NoError(t, err)
test.AssertEqualJSON(t, v13_6_0, migrated)
test.AssertEqualJSON(t, v13_6_1, migrated)

// 13.0 > 13.6.1
migrated, err = goflow.MigrateDefinition(rt.Config, v13_0_0, semver.MustParse("13.6.1"))
assert.NoError(t, err)
test.AssertEqualJSON(t, v13_6_1, migrated)
}
2 changes: 1 addition & 1 deletion core/goflow/testdata/migrate/13.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"uuid": "82a1de5f-af1a-45ef-8511-4d60c160e486",
"type": "send_msg",
"text": "Hello @webhook",
"text": "Hello @webhook from @results.this_is_a_reference_to_a_result_whose_name_will_have_been_truncated",
"templating": {
"template": {
"uuid": "641b8b05-082a-497e-bf63-38aa48b1f0c4",
Expand Down
2 changes: 1 addition & 1 deletion core/goflow/testdata/migrate/13.1.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"uuid": "82a1de5f-af1a-45ef-8511-4d60c160e486",
"type": "send_msg",
"text": "Hello @webhook",
"text": "Hello @webhook from @results.this_is_a_reference_to_a_result_whose_name_will_have_been_truncated",
"templating": {
"uuid": "1ae96956-4b34-433e-8d1a-f05fe6923d6d",
"template": {
Expand Down
2 changes: 1 addition & 1 deletion core/goflow/testdata/migrate/13.2.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"uuid": "82a1de5f-af1a-45ef-8511-4d60c160e486",
"type": "send_msg",
"text": "Hello @webhook",
"text": "Hello @webhook from @results.this_is_a_reference_to_a_result_whose_name_will_have_been_truncated",
"templating": {
"uuid": "1ae96956-4b34-433e-8d1a-f05fe6923d6d",
"template": {
Expand Down
2 changes: 1 addition & 1 deletion core/goflow/testdata/migrate/13.3.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"uuid": "82a1de5f-af1a-45ef-8511-4d60c160e486",
"type": "send_msg",
"text": "Hello @webhook.json",
"text": "Hello @webhook.json from @results.this_is_a_reference_to_a_result_whose_name_will_have_been_truncated",
"templating": {
"uuid": "1ae96956-4b34-433e-8d1a-f05fe6923d6d",
"template": {
Expand Down
2 changes: 1 addition & 1 deletion core/goflow/testdata/migrate/13.4.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"uuid": "82a1de5f-af1a-45ef-8511-4d60c160e486",
"type": "send_msg",
"text": "Hello @webhook.json",
"text": "Hello @webhook.json from @results.this_is_a_reference_to_a_result_whose_name_will_have_been_truncated",
"templating": {
"template": {
"uuid": "641b8b05-082a-497e-bf63-38aa48b1f0c4",
Expand Down
2 changes: 1 addition & 1 deletion core/goflow/testdata/migrate/13.5.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"uuid": "82a1de5f-af1a-45ef-8511-4d60c160e486",
"type": "send_msg",
"text": "Hello @webhook.json",
"text": "Hello @webhook.json from @results.this_is_a_reference_to_a_result_whose_name_will_have_been_truncated",
"template": {
"uuid": "641b8b05-082a-497e-bf63-38aa48b1f0c4",
"name": "welcome"
Expand Down
2 changes: 1 addition & 1 deletion core/goflow/testdata/migrate/13.6.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"uuid": "82a1de5f-af1a-45ef-8511-4d60c160e486",
"type": "send_msg",
"text": "Hello @webhook.json",
"text": "Hello @webhook.json from @results.this_is_a_reference_to_a_result_whose_name_will_have_been_truncated",
"template": {
"uuid": "641b8b05-082a-497e-bf63-38aa48b1f0c4",
"name": "welcome"
Expand Down
31 changes: 31 additions & 0 deletions core/goflow/testdata/migrate/13.6.1.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.1",
"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 from @results.this_is_a_reference_to_a_result_whose_name_will_have_been_trunca",
"template": {
"uuid": "641b8b05-082a-497e-bf63-38aa48b1f0c4",
"name": "welcome"
},
"template_variables": [
"@contact.name"
]
}
],
"exits": [
{
"uuid": "fdd370e0-ffa9-48b3-8148-b9241d74fc72"
}
]
}
]
}
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.6.0",
"spec_version": "13.6.1",
"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.6.0",
"spec_version": "13.6.1",
"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.6.0",
"spec_version": "13.6.1",
"language": "spa",
"type": "messaging",
"revision": 16,
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.6.0",
"spec_version": "13.6.1",
"type": "messaging",
"uuid": "42362831-f376-4df1-b6d9-a80b102821d9"
}
Expand Down Expand Up @@ -169,7 +169,7 @@
}
],
"revision": 1,
"spec_version": "13.6.0",
"spec_version": "13.6.1",
"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.6.0",
"spec_version": "13.6.1",
"language": "und",
"type": "messaging",
"revision": 1,
Expand Down

0 comments on commit fad343e

Please sign in to comment.