Skip to content

Commit 9989b67

Browse files
author
Allan Lima
committed
Merge branch 'master' of https://github.com/nyaruka/rp-indexer into rapidpro-5.4
2 parents 7f20622 + 61674f4 commit 9989b67

File tree

630 files changed

+85
-225901
lines changed

Some content is hidden

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

630 files changed

+85
-225901
lines changed

.github/workflows/ci.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
name: Test
6+
strategy:
7+
matrix:
8+
pg-version: ['10', '11']
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v1
13+
14+
- name: Install ElasticSearch
15+
uses: nyaruka/elasticsearch-action@master
16+
with:
17+
elastic version: '6.8.5'
18+
19+
- name: Install PostgreSQL
20+
uses: harmon758/postgresql-action@v1
21+
with:
22+
postgresql version: ${{ matrix.pg-version }}
23+
postgresql db: elastic_test
24+
postgresql user: temba
25+
postgresql password: temba
26+
27+
- name: Install Go
28+
uses: actions/setup-go@v1
29+
with:
30+
go-version: 1.13.x
31+
32+
- name: Run tests
33+
run: go test -p=1 -coverprofile=coverage.text -covermode=atomic ./...
34+
35+
- name: Upload coverage
36+
if: success()
37+
uses: codecov/codecov-action@v1
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
41+
release:
42+
name: Release
43+
needs: [test]
44+
if: startsWith(github.ref, 'refs/tags/')
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v1
49+
50+
- name: Install Go
51+
uses: actions/setup-go@v1
52+
with:
53+
go-version: 1.13.x
54+
55+
- name: Publish release
56+
uses: goreleaser/goreleaser-action@v1
57+
with:
58+
version: latest
59+
args: release --rm-dist
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
fail_ci_if_error: true

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ fabconfig.pyc
1818
.glide/
1919

2020
*~
21+
22+
.DS_Store

.travis.yml

-36
This file was deleted.

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v5.4.0
2+
----------
3+
* touch README for 5.4 release
4+
15
v5.2.0
26
----------
37
* Sync release with RapidPro 5.2

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RapidPro Indexer [![Build Status](https://travis-ci.org/nyaruka/rp-indexer.svg?branch=master)](https://travis-ci.org/nyaruka/rp-indexer) [![codecov](https://codecov.io/gh/nyaruka/rp-indexer/branch/master/graph/badge.svg)](https://codecov.io/gh/nyaruka/rp-indexer) [![Go Report Card](https://goreportcard.com/badge/github.com/nyaruka/rp-indexer)](https://goreportcard.com/report/github.com/nyaruka/rp-indexer)
1+
# RapidPro Indexer [![Build Status](https://github.com/nyaruka/rp-indexer/workflows/CI/badge.svg)](https://github.com/nyaruka/rp-indexer/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/nyaruka/rp-indexer/branch/master/graph/badge.svg)](https://codecov.io/gh/nyaruka/rp-indexer) [![Go Report Card](https://goreportcard.com/badge/github.com/nyaruka/rp-indexer)](https://goreportcard.com/report/github.com/nyaruka/rp-indexer)
22

33
Simple service for indexing RapidPro contacts into ElasticSearch.
44

cmd/rp-indexer/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type config struct {
2626
func main() {
2727
config := config{
2828
ElasticURL: "http://localhost:9200",
29-
DB: "postgres://localhost/rapidpro?sslmode=disable",
29+
DB: "postgres://localhost/temba?sslmode=disable",
3030
Index: "contacts",
3131
Poll: 5,
3232
Rebuild: false,

go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ require (
2222
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
2323
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
2424
)
25+
26+
go 1.13

goreleaser.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ build:
88
goarch:
99
- amd64
1010

11-
archive:
12-
files:
11+
archives:
12+
- files:
1313
- LICENSE
1414
- README.md
1515

indexer_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func setup(t *testing.T) (*sql.DB, *elastic.Client) {
2424
testDB, err := ioutil.ReadFile("testdb.sql")
2525
assert.NoError(t, err)
2626

27-
db, err := sql.Open("postgres", "postgres://localhost/elastic_test?sslmode=disable")
27+
db, err := sql.Open("postgres", "postgres://temba:temba@localhost:5432/elastic_test?sslmode=disable")
2828
assert.NoError(t, err)
2929

3030
_, err = db.Exec(string(testDB))

testdb.sql

+10-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ CREATE TABLE contacts_contact (
99
org_id integer NOT NULL,
1010
is_blocked boolean NOT NULL,
1111
name character varying(128),
12-
is_test boolean NOT NULL,
1312
language character varying(3),
1413
uuid character varying(36) NOT NULL,
1514
is_stopped boolean NOT NULL,
@@ -88,24 +87,24 @@ ALTER SEQUENCE contacts_contactgroup_contacts_id_seq OWNED BY contacts_contactgr
8887
-- fcab2439-861c-4832-aa54-0c97f38f24ab - home_district (district)
8988
-- a551ade4-e5a0-4d83-b185-53b515ad2f2a - home_ward (ward)
9089

91-
INSERT INTO contacts_contact(id, is_active, created_by_id, created_on, modified_by_id, modified_on, org_id, is_blocked, name, is_test, language, uuid, is_stopped, fields) VALUES
92-
(1, TRUE, -1, '2017-11-10 21:11:59.890662+00', -1, '2017-11-10 21:11:59.890662+00', 1, FALSE, NULL, FALSE, 'eng', 'c7a2dd87-a80e-420b-8431-ca48d422e924', FALSE,
90+
INSERT INTO contacts_contact(id, is_active, created_by_id, created_on, modified_by_id, modified_on, org_id, is_blocked, name, language, uuid, is_stopped, fields) VALUES
91+
(1, TRUE, -1, '2017-11-10 21:11:59.890662+00', -1, '2017-11-10 21:11:59.890662+00', 1, FALSE, NULL, 'eng', 'c7a2dd87-a80e-420b-8431-ca48d422e924', FALSE,
9392
'{ "17103bb1-1b48-4b70-92f7-1f6b73bd3488": {"text": "the rock"}}'),
94-
(2, TRUE, -1, '2015-03-26 10:07:14.054521+00', -1, '2015-03-26 10:07:14.054521+00', 1, FALSE, NULL, FALSE, NULL, '7a6606c7-ff41-4203-aa98-454a10d37209', TRUE,
93+
(2, TRUE, -1, '2015-03-26 10:07:14.054521+00', -1, '2015-03-26 10:07:14.054521+00', 1, FALSE, NULL, NULL, '7a6606c7-ff41-4203-aa98-454a10d37209', TRUE,
9594
'{ "05bca1cd-e322-4837-9595-86d0d85e5adb": {"text": "11", "number": 11 }}'),
96-
(3, TRUE, -1, '2015-03-26 13:04:58.699648+00', -1, '2015-03-26 13:04:58.699648+00', 1, TRUE, NULL, FALSE, NULL, '29b45297-15ad-4061-a7d4-e0b33d121541', FALSE,
95+
(3, TRUE, -1, '2015-03-26 13:04:58.699648+00', -1, '2015-03-26 13:04:58.699648+00', 1, TRUE, NULL, NULL, '29b45297-15ad-4061-a7d4-e0b33d121541', FALSE,
9796
'{ "05bca1cd-e322-4837-9595-86d0d85e5adb": {"text": "9", "number": 9 }, "e0eac267-463a-4c00-9732-cab62df07b16": { "text": "2018-04-06T18:37:59+00:00", "datetime": "2018-04-06T18:37:59+00:00"}}'),
98-
(4, TRUE, -1, '2015-03-27 07:39:28.955051+00', -1, '2015-03-27 07:39:28.955051+00', 1, FALSE, 'John Doe', FALSE, NULL, '51762bba-01a2-4c4e-b5cd-b182d0405cd4', FALSE,
97+
(4, TRUE, -1, '2015-03-27 07:39:28.955051+00', -1, '2015-03-27 07:39:28.955051+00', 1, FALSE, 'John Doe', NULL, '51762bba-01a2-4c4e-b5cd-b182d0405cd4', FALSE,
9998
'{ "e0eac267-463a-4c00-9732-cab62df07b16": { "text": "2030-04-06T18:37:59+00:00", "datetime": "2030-04-06T18:37:59+00:00"}}'),
100-
(5, TRUE, -1, '2015-10-30 19:42:27.001837+00', -1, '2015-10-30 19:42:27.001837+00', 2, FALSE, 'Ajodinabiff Dane', FALSE, NULL, '3e814add-e614-41f7-8b5d-a07f670a698f', FALSE,
99+
(5, TRUE, -1, '2015-10-30 19:42:27.001837+00', -1, '2015-10-30 19:42:27.001837+00', 2, FALSE, 'Ajodinabiff Dane', NULL, '3e814add-e614-41f7-8b5d-a07f670a698f', FALSE,
101100
'{ "22d11697-edba-4186-b084-793e3b876379": { "text": "USA > Washington", "state": "USA > Washington"} }'),
102-
(6, TRUE, -1, '2017-11-10 21:11:59.890662+00', -1, '2017-11-10 21:11:59.890662+00', 2, FALSE, 'Joanne Stone', FALSE, NULL, '7051dff0-0a27-49d7-af1f-4494239139e6', FALSE,
101+
(6, TRUE, -1, '2017-11-10 21:11:59.890662+00', -1, '2017-11-10 21:11:59.890662+00', 2, FALSE, 'Joanne Stone', NULL, '7051dff0-0a27-49d7-af1f-4494239139e6', FALSE,
103102
'{ "22d11697-edba-4186-b084-793e3b876379": { "text": "USA > Colorado", "state": "USA > Colorado"} }'),
104-
(7, TRUE, -1, '2015-03-27 13:39:43.995812+00', -1, '2015-03-27 13:39:43.995812+00', 2, FALSE, NULL, FALSE, NULL, 'b46f6e18-95b4-4984-9926-dded047f4eb3', FALSE,
103+
(7, TRUE, -1, '2015-03-27 13:39:43.995812+00', -1, '2015-03-27 13:39:43.995812+00', 2, FALSE, NULL, NULL, 'b46f6e18-95b4-4984-9926-dded047f4eb3', FALSE,
105104
'{ "fcab2439-861c-4832-aa54-0c97f38f24ab": { "text": "USA > Washington > King Côunty", "district": "USA > Washington > King Côunty"} }'),
106-
(8, TRUE, -1, '2017-11-10 21:11:59.890662+00', -1, '2017-11-10 21:11:59.890662+00', 2, FALSE, NULL, FALSE, NULL, '9195c8b7-6138-4d84-ac56-5192cc3d8ceb', FALSE,
105+
(8, TRUE, -1, '2017-11-10 21:11:59.890662+00', -1, '2017-11-10 21:11:59.890662+00', 2, FALSE, NULL, NULL, '9195c8b7-6138-4d84-ac56-5192cc3d8ceb', FALSE,
107106
'{ "a551ade4-e5a0-4d83-b185-53b515ad2f2a": { "text": "USA > Washington > King Côunty > Central District", "ward": "USA > Washington > King Côunty > Central District"} }'),
108-
(9, TRUE, -1, '2016-08-22 14:20:05.690311+00', -1, '2016-08-22 14:20:05.690311+00', 2, FALSE, NULL, FALSE, NULL, '2b8bd28d-43e0-4c34-a4bb-0f10b11fdb8a', FALSE,
107+
(9, TRUE, -1, '2016-08-22 14:20:05.690311+00', -1, '2016-08-22 14:20:05.690311+00', 2, FALSE, NULL, NULL, '2b8bd28d-43e0-4c34-a4bb-0f10b11fdb8a', FALSE,
109108
'{ "fcab2439-861c-4832-aa54-0c97f38f24ab": { "text": "USA > Colorado > King", "district": "USA > Colorado > King"} }');
110109

111110
INSERT INTO contacts_contacturn(id, contact_id, scheme, org_id, priority, path, display, identity) VALUES

vendor/github.com/certifi/gocertifi/LICENSE

-3
This file was deleted.

vendor/github.com/certifi/gocertifi/README.md

-60
This file was deleted.

0 commit comments

Comments
 (0)