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

Push <- Release/v6.1.18 #40

Closed
wants to merge 75 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
557ab05
Add support for passive flows
rowanseymour Jan 6, 2021
53d29ce
Add Interrupts method to flow type
rowanseymour Jan 6, 2021
cb7a1b6
Add test for session interruption based on flow type
rowanseymour Jan 6, 2021
bb4e512
Merge pull request #393 from nyaruka/passive
rowanseymour Jan 6, 2021
b58f1a5
Update to latest goflow v0.107.2
rowanseymour Jan 6, 2021
8d46fdd
Update CHANGELOG.md for v6.1.6
Jan 7, 2021
f7086c2
Use background instead of passive
rowanseymour Jan 7, 2021
9c97524
Merge pull request #394 from nyaruka/background
rowanseymour Jan 7, 2021
d43b302
Update CHANGELOG.md for v6.1.7
Jan 7, 2021
2d25cba
Update to latest goflow 0.108.0
rowanseymour Jan 7, 2021
33d36ca
Update CHANGELOG.md for v6.1.8
Jan 7, 2021
824dc64
Ensure courier messages are always queued for a single contact
rowanseymour Jan 12, 2021
8ecffc4
Update to goflow v0.109.0
rowanseymour Jan 12, 2021
0251ba1
Update CHANGELOG.md for v6.1.9
Jan 12, 2021
ecde9c8
Add testing of Android channel syncing
rowanseymour Jan 12, 2021
e5127bc
More testing
rowanseymour Jan 13, 2021
0b511e2
Fix updating message status when id column is bigint
rowanseymour Jan 13, 2021
dce316c
Remove unused function
rowanseymour Jan 13, 2021
0495b9c
Merge pull request #396 from nyaruka/bigint_fix
rowanseymour Jan 13, 2021
1048e45
Merge branch 'master' into send_msgs_refactor
rowanseymour Jan 13, 2021
34e10e5
Refactor of FCM client usage so it's a property of ther mailroom inst…
rowanseymour Jan 14, 2021
de21e2f
Remove crud
rowanseymour Jan 14, 2021
4b23bc0
Merge pull request #395 from nyaruka/send_msgs_refactor
rowanseymour Jan 14, 2021
b7a2edb
Merge branch 'master' into fcm_client_refactor
rowanseymour Jan 14, 2021
4a36e5a
Don't pass redis pool or FCM client to ApplyModifiers which shouldn't…
rowanseymour Jan 14, 2021
bfc9340
Merge pull request #397 from nyaruka/fcm_client_refactor
rowanseymour Jan 14, 2021
b7f6706
Revert "Merge pull request #397 from nyaruka/fcm_client_refactor"
rowanseymour Jan 14, 2021
5091587
Simplify FCM client code
rowanseymour Jan 14, 2021
1e6afa4
Merge pull request #398 from nyaruka/fcm_cleanup_take_2
rowanseymour Jan 14, 2021
0a311c7
Update CHANGELOG.md for v6.1.10
Jan 14, 2021
1859359
update goflow for forward_ivr action
nicpottier Jan 14, 2021
ed8709d
Merge branch 'master' of github.com:nyaruka/mailroom
nicpottier Jan 14, 2021
1dbb538
Update to latest goflow v0.109.4
rowanseymour Jan 14, 2021
4e6a450
Merge branch 'master' into latest_goflow
rowanseymour Jan 14, 2021
4d49990
Merge pull request #399 from nyaruka/latest_goflow
rowanseymour Jan 15, 2021
c2ae802
Update CHANGELOG.md for v6.1.11
Jan 15, 2021
8b352dc
Update to latest goflow v0.110.0
rowanseymour Jan 15, 2021
7f6cf8f
Update CHANGELOG.md for v6.1.12
Jan 15, 2021
f97e3b5
Update to latest goflow
rowanseymour Jan 18, 2021
37e7fee
Update to latest goflow
rowanseymour Jan 19, 2021
14be2f2
Update CHANGELOG.md for v6.1.13
Jan 19, 2021
96cd3ba
update to elastic v7
nicpottier Jan 20, 2021
c0e47e6
mod tidy
nicpottier Jan 20, 2021
e70571b
Merge pull request #400 from nyaruka/elastic-v7
nicpottier Jan 21, 2021
783cb66
Update CHANGELOG.md for v6.2.0
Jan 21, 2021
f1cccc9
remove incorrect 6.2.0
nicpottier Jan 21, 2021
2816432
Update CHANGELOG.md for v6.1.14
Jan 21, 2021
3a67c4c
Bump CI testing to PG 11 and 12
rowanseymour Jan 24, 2021
f789ead
Update ci.yml
rowanseymour Jan 24, 2021
8d24925
Update ci.yml
rowanseymour Jan 25, 2021
c94ef67
Update ci.yml
rowanseymour Jan 25, 2021
bacf9dc
Fix tests so not trying to create flow sessions with NULL session_type
rowanseymour Jan 25, 2021
873bdd9
Test on PG 12
rowanseymour Jan 25, 2021
143d10d
Fix test
rowanseymour Jan 25, 2021
2289160
Fix non-deterministic ordering of org languages
rowanseymour Jan 25, 2021
14b5823
Merge pull request #401 from nyaruka/pg12
rowanseymour Jan 26, 2021
734563b
Update to latest goflow
rowanseymour Jan 26, 2021
c38a4fc
Decrease locations cache timeout to 1 minute
rowanseymour Jan 29, 2021
99c8c71
Add link local ips to default disallowed networks config
rowanseymour Feb 3, 2021
f0a9ed3
update phonenumbers lib
nicpottier Feb 3, 2021
90e51b2
Merge pull request #405 from nyaruka/update-phones
rowanseymour Feb 3, 2021
17fdf24
Update CHANGELOG.md for v6.1.15
Feb 3, 2021
b64e889
Merge pull request #404 from nyaruka/disallow_link_local
rowanseymour Feb 5, 2021
cf80bdd
Update to latest goflow
rowanseymour Feb 5, 2021
c8fe14e
Update CHANGELOG.md for v6.1.16
Feb 8, 2021
03c9328
Should match referral trigger with case insensitive
norkans7 Feb 9, 2021
17739c3
Merge pull request #407 from nyaruka/referral-trigger-fix
rowanseymour Feb 9, 2021
47c8581
Update CHANGELOG.md for v6.1.17
Feb 11, 2021
7d7f1f0
Rename tickets/internal package
rowanseymour Feb 17, 2021
3468758
Merge pull request #409 from nyaruka/internal_pkg_name
rowanseymour Feb 17, 2021
a8b68c3
Minor copypasta
ericnewcomer Feb 17, 2021
7e9b2be
Revert general test across ticketers
ericnewcomer Feb 17, 2021
44009d8
Merge pull request #411 from nyaruka/copypasta
rowanseymour Feb 18, 2021
d86c120
Update to latest goflow
rowanseymour Feb 25, 2021
1ce90dc
Update CHANGELOG.md for v6.1.18
Feb 25, 2021
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
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: CI
on: [push, pull_request]
env:
go-version: '1.14.x'
postgis-version: '2.5'
jobs:
test:
name: Test
strategy:
matrix:
pg-version: ['10', '11']
pg-version: ['11', '12']
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -19,26 +20,32 @@ jobs:
redis version: '5'

- name: Install PostgreSQL
uses: nyaruka/postgis-action@master
uses: nyaruka/postgis-action@v2
with:
postgresql version: ${{ matrix.pg-version }}
postgis version: ${{ env.postgis-version }}
postgresql password: temba

- name: Install Linux packages
run: sudo apt install -y --no-install-recommends postgresql-client

- name: Initialize database
# we create our test database with a different user so that we can drop everything owned by this user between tests
run: |
psql -h localhost -U postgres -c "CREATE USER mailroom_test PASSWORD 'temba';"
psql -h localhost -U postgres -c "ALTER ROLE mailroom_test WITH SUPERUSER;"
psql -h localhost -U postgres -c "CREATE DATABASE mailroom_test;"
export PGPASSWORD=temba
psql -h localhost -U postgres --no-password -c "CREATE USER mailroom_test PASSWORD 'temba';"
psql -h localhost -U postgres --no-password -c "ALTER ROLE mailroom_test WITH SUPERUSER;"
psql -h localhost -U postgres --no-password -c "CREATE DATABASE mailroom_test;"

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.go-version }}

- name: Run tests
run: go test -p=1 -coverprofile=coverage.text -covermode=atomic ./...
run: |
export PGPASSWORD=temba
go test -p=1 -coverprofile=coverage.text -covermode=atomic ./...

- name: Upload coverage
if: success()
Expand All @@ -59,7 +66,7 @@ jobs:
# for backward compatibility, English docs are copied to root of docs directory
run: |
GOFLOW_VERSION=$(grep goflow go.mod | cut -d" " -f2 | cut -c2-)
curl https://codeload.github.com/nyaruka/goflow/tar.gz/v$GOFLOW_VERSION | tar --wildcards --strip=1 -zx "goflow-${GOFLOW_VERSION}/docs/*"
curl -L https://github.com/nyaruka/goflow/releases/download/v${GOFLOW_VERSION}/docs.tar.gz | tar zxv
cp ./docs/en-us/*.* docs/

- name: Install Go
Expand Down
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
v6.1.18
----------
* Update to latest goflow
* Rename tickets/internal package

v6.1.17
----------
* Should match referral trigger with case insensitive

v6.1.16
----------
* Update to latest goflow
* Add link local ips to default disallowed networks config

v6.1.15
----------
* Update phonenumbers lib
* Decrease locations cache timeout to 1 minute

v6.1.14
----------
* Support ElasticSearch 7.2 (backwards incompatible to Elastic 6.*)

v6.1.13
----------
* Update to latest goflow

v6.1.12
----------
* Update to latest goflow v0.110.0

v6.1.11
----------
* Update to latest goflow v0.109.4

v6.1.10
----------
* Simplify FCM client code
* Fix updating message status when id column is bigint
* Ensure courier messages are always queued for a single contact
* Fix not triggering FCM syncs for broadcasts and ticket reply messages

v6.1.9
----------
* Update to goflow v0.109.0

v6.1.8
----------
* Update to latest goflow 0.108.0

v6.1.7
----------
* Use background instead of passive

v6.1.6
----------
* Update to latest goflow v0.107.2
* Add support for passive flows

v6.1.5
----------
* Update to goflow v0.107.1
Expand Down
1 change: 1 addition & 0 deletions cmd/mailroom/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
_ "github.com/nyaruka/mailroom/core/tasks/starts"
_ "github.com/nyaruka/mailroom/core/tasks/stats"
_ "github.com/nyaruka/mailroom/core/tasks/timeouts"
_ "github.com/nyaruka/mailroom/services/tickets/intern"
_ "github.com/nyaruka/mailroom/services/tickets/mailgun"
_ "github.com/nyaruka/mailroom/services/tickets/rocketchat"
_ "github.com/nyaruka/mailroom/services/tickets/zendesk"
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func NewMailroomConfig() *Config {
WebhooksInitialBackoff: 5000,
WebhooksBackoffJitter: 0.5,
SMTPServer: "",
DisallowedNetworks: `127.0.0.1,::1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16`,
DisallowedNetworks: `127.0.0.1,::1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16,fe80::/10`,
MaxStepsPerSprint: 100,
MaxValueLength: 640,

Expand Down
5 changes: 4 additions & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ func TestParseDisallowedNetworks(t *testing.T) {
privateNetwork2 := &net.IPNet{IP: net.IPv4(172, 16, 0, 0).To4(), Mask: net.CIDRMask(12, 32)}
privateNetwork3 := &net.IPNet{IP: net.IPv4(192, 168, 0, 0).To4(), Mask: net.CIDRMask(16, 32)}

linkLocalIPv4 := &net.IPNet{IP: net.IPv4(169, 254, 0, 0).To4(), Mask: net.CIDRMask(16, 32)}
_, linkLocalIPv6, _ := net.ParseCIDR("fe80::/10")

// test with config defaults
ips, ipNets, err := cfg.ParseDisallowedNetworks()
assert.NoError(t, err)
assert.Equal(t, []net.IP{net.IPv4(127, 0, 0, 1), net.ParseIP(`::1`)}, ips)
assert.Equal(t, []*net.IPNet{privateNetwork1, privateNetwork2, privateNetwork3}, ipNets)
assert.Equal(t, []*net.IPNet{privateNetwork1, privateNetwork2, privateNetwork3, linkLocalIPv4, linkLocalIPv6}, ipNets)

// test with empty
cfg.DisallowedNetworks = ``
Expand Down
168 changes: 0 additions & 168 deletions core/courier/courier_test.go

This file was deleted.

8 changes: 4 additions & 4 deletions core/handlers/msg_created.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func handlePreMsgCreated(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, oa *m
event := e.(*events.MsgCreatedEvent)

// we only clear timeouts on messaging flows
if scene.Session().SessionType() != models.MessagingFlow {
if scene.Session().SessionType() != models.FlowTypeMessaging {
return nil
}

Expand Down Expand Up @@ -73,12 +73,12 @@ func handleMsgCreated(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, oa *mode

// ignore events that don't have a channel or URN set
// TODO: maybe we should create these messages in a failed state?
if scene.Session().SessionType() == models.MessagingFlow && (event.Msg.URN() == urns.NilURN || event.Msg.Channel() == nil) {
if scene.Session().SessionType() == models.FlowTypeMessaging && (event.Msg.URN() == urns.NilURN || event.Msg.Channel() == nil) {
return nil
}

// messages in messaging flows must have urn id set on them, if not, go look it up
if scene.Session().SessionType() == models.MessagingFlow {
if scene.Session().SessionType() == models.FlowTypeMessaging {
urn := event.Msg.URN()
if models.GetURNInt(urn, "id") == 0 {
urn, err := models.GetOrCreateURN(ctx, tx, oa, scene.ContactID(), event.Msg.URN())
Expand Down Expand Up @@ -114,7 +114,7 @@ func handleMsgCreated(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, oa *mode
scene.AppendToEventPreCommitHook(hooks.CommitMessagesHook, msg)

// don't send messages for surveyor flows
if scene.Session().SessionType() != models.SurveyorFlow {
if scene.Session().SessionType() != models.FlowTypeSurveyor {
scene.AppendToEventPostCommitHook(hooks.SendMessagesHook, msg)
}

Expand Down
2 changes: 1 addition & 1 deletion core/handlers/msg_received.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func handleMsgReceived(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, oa *mod
event := e.(*events.MsgReceivedEvent)

// for surveyor sessions we need to actually create the message
if scene.Session() != nil && scene.Session().SessionType() == models.SurveyorFlow {
if scene.Session() != nil && scene.Session().SessionType() == models.FlowTypeSurveyor {
logrus.WithFields(logrus.Fields{
"contact_uuid": scene.ContactUUID(),
"session_id": scene.SessionID(),
Expand Down
Loading