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

Rer 5 - Dataset env filtering #9

Open
wants to merge 331 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
331 commits
Select commit Hold shift + click to select a range
85ed5cf
Bump nock from 10.0.6 to 11.3.4
dependabot-preview[bot] Sep 18, 2019
f789f54
Bump cron-parser from 2.12.0 to 2.13.0
dependabot-preview[bot] Sep 18, 2019
1ce97f3
Bump load-grunt-tasks from 5.0.0 to 5.1.0
dependabot-preview[bot] Sep 18, 2019
0655a46
Merge pull request #60 from resource-watch/dependabot/npm_and_yarn/no…
tiagojsag Sep 18, 2019
f9a4052
Merge pull request #58 from resource-watch/dependabot/npm_and_yarn/es…
tiagojsag Sep 18, 2019
360207e
Merge pull request #59 from resource-watch/dependabot/npm_and_yarn/es…
tiagojsag Sep 18, 2019
d93e2c5
Merge pull request #62 from resource-watch/dependabot/npm_and_yarn/lo…
tiagojsag Sep 18, 2019
e2b13d0
Merge pull request #61 from resource-watch/dependabot/npm_and_yarn/cr…
tiagojsag Sep 18, 2019
708aac2
Add test for include=user and eslint fix test folder
tiagojsag Sep 26, 2019
19d6e8b
Merge pull request #64 from resource-watch/add-test-for-include=user-…
tiagojsag Sep 26, 2019
406b45b
added tests for a DELETE dataset of each dataset type
stanislav-halyn Oct 2, 2019
099948d
added tests for endpoint get all with filter 'user.role'
stanislav-halyn Oct 2, 2019
b9149db
Merge pull request #66 from resource-watch/test/missing_tests
tiagojsag Oct 2, 2019
45dc780
Limit filter by role to admin users
tiagojsag Oct 2, 2019
d5f8317
Merge pull request #67 from resource-watch/limit-filter-by-role-to-ad…
tiagojsag Oct 2, 2019
224bc42
added test log
stanislav-halyn Oct 4, 2019
5c76b08
added test log
stanislav-halyn Oct 4, 2019
e0d1b66
Add additional tests around deleting datasets
tiagojsag Oct 4, 2019
53b68d4
Merge pull request #69 from resource-watch/add-additional-tests-aroun…
tiagojsag Oct 4, 2019
43eebfa
Merge pull request #68 from resource-watch/test/log
tiagojsag Oct 4, 2019
b7c14e2
Fix issue where GET datasets with user role filter and includes would…
tiagojsag Oct 7, 2019
9b8d7a2
Add support for updating sources field on dataset update
tiagojsag Oct 11, 2019
c61d98d
Bump node version and update dev dependencies based on npm audit
tiagojsag Oct 14, 2019
d46d532
Move dataset creation inside the test on clone dataset test
tiagojsag Oct 14, 2019
214ecb4
Make improvements to clone test structure
tiagojsag Oct 14, 2019
8bc3731
Update author info on package.json
tiagojsag Oct 14, 2019
c23ca9a
Bump eslint-plugin-jsx-a11y from 6.2.1 to 6.2.3
dependabot-preview[bot] Sep 18, 2019
99edb27
[Security] Bump eslint-utils from 1.3.1 to 1.4.2
dependabot-preview[bot] Sep 18, 2019
dbd2fb6
Bump nock from 10.0.6 to 11.3.4
dependabot-preview[bot] Sep 18, 2019
5669196
Bump cron-parser from 2.12.0 to 2.13.0
dependabot-preview[bot] Sep 18, 2019
bb24ec0
Bump load-grunt-tasks from 5.0.0 to 5.1.0
dependabot-preview[bot] Sep 18, 2019
81698aa
Add test for include=user and eslint fix test folder
tiagojsag Sep 26, 2019
71857ca
added tests for a DELETE dataset of each dataset type
stanislav-halyn Oct 2, 2019
ab37960
added tests for endpoint get all with filter 'user.role'
stanislav-halyn Oct 2, 2019
531a9ea
Limit filter by role to admin users
tiagojsag Oct 2, 2019
919c2b9
added test log
stanislav-halyn Oct 4, 2019
4e983db
added test log
stanislav-halyn Oct 4, 2019
c2b28ab
Add additional tests around deleting datasets
tiagojsag Oct 4, 2019
3abbaae
Fix issue where GET datasets with user role filter and includes would…
tiagojsag Oct 7, 2019
c22e306
Add support for updating sources field on dataset update
tiagojsag Oct 11, 2019
90798e6
Bump node version and update dev dependencies based on npm audit
tiagojsag Oct 14, 2019
61e6002
Move dataset creation inside the test on clone dataset test
tiagojsag Oct 14, 2019
01f7f3f
Make improvements to clone test structure
tiagojsag Oct 14, 2019
15a8bf4
Update author info on package.json
tiagojsag Oct 14, 2019
cd0bf67
Simplify get with includes test
tiagojsag Oct 17, 2019
3a56c97
Fix issue where users with no email or name would not be included in …
tiagojsag Oct 18, 2019
c6052cc
Migrate npm to yarn; update node; update dev deps
tiagojsag Nov 10, 2019
08f0842
Add eslint shared rules; add husky and eslint hooks; fix cs
tiagojsag Nov 10, 2019
0d52251
Update eslint hook config
tiagojsag Nov 10, 2019
ee82431
[Security] Bump mongoose from 4.13.18 to 5.7.5
dependabot-preview[bot] Oct 22, 2019
54a6513
healthcheck endpoint and k8s checks and resource limits config
tiagojsag Nov 11, 2019
433c886
Fix typo in memory allocation
tiagojsag Nov 12, 2019
8f8ea1e
Bump eslint-plugin-mocha
tiagojsag Nov 13, 2019
9abc111
Add test for ensuring dataset applications' array patching is successful
Nov 18, 2019
2dcbe68
fix broken env vars link in README
Nov 13, 2019
40b0b4a
Fix potential issue with async nock destruction that may cause tests …
tiagojsag Nov 18, 2019
86ec287
Add async/await to test cleanup hooks
tiagojsag Nov 18, 2019
02ab31e
Update mongoose usage to replace deprecated calls and warnings
tiagojsag Nov 18, 2019
9d6e806
Merge branch 'master' into develop
tiagojsag Nov 18, 2019
c068c61
Fix ports on k8s probes
tiagojsag Nov 18, 2019
e02cba9
Add test specifying the behaviour of the subscribable filter
Nov 25, 2019
6b6178e
Add filter for querying subscribable datasets
Nov 25, 2019
107a0ad
Improve filter behaviour to allow filtering for non subscribable data…
Nov 25, 2019
47164e8
Add CHANGELOG file
Nov 26, 2019
9d9927e
Allow microservices to update the datasets errorMessage field
tiagojsag Dec 4, 2019
eea6b00
Add feature for sorting datasets taking user fields into account
Dec 30, 2019
fc37fee
Remove sort from find-by-ids, simplify mocks
tiagojsag Jan 3, 2020
cd55ff8
Make travis and docker tests register on CT
tiagojsag Jan 3, 2020
ec7439c
Remove legacy handling and sorting ids before requesting user info
Jan 3, 2020
8e16c80
Remove redundant if clauses when processing sort param
Jan 3, 2020
c3aa0d9
Duplicate id keys for users in test constant files
Jan 3, 2020
10b7950
Add user with no information to sort by user field tests
Jan 3, 2020
3c709c3
Undo change in body matching condition in find-by-ids mock
Jan 3, 2020
f810416
Using lower case name and role for case insensitive sorting
Jan 3, 2020
af52c38
Add implicit sort by id to ensure deterministic results when sorting …
Jan 3, 2020
cdc0500
Add check for preventing large page sizes
Jan 3, 2020
88e6f2b
Remove unnecessary _id fields from user mocks
tiagojsag Jan 7, 2020
7042ed1
Add failing test for problem updating dataset applications
Dec 19, 2019
372c62e
Fix problem removing dataset applications by admins who can manage th…
Dec 23, 2019
2a052fb
Add test for ensuring an admin cannot update the applications of data…
Dec 23, 2019
e33002b
Minor improvements in validation of dataset application permissions
Jan 2, 2020
fbcab4c
Add test cases covering other user roles (ADMIN and MANAGER)
Jan 7, 2020
b79e1c2
Remove page size limit
Jan 8, 2020
d6c39a4
Code-doc page size limit
tiagojsag Jan 14, 2020
00b42fe
Update changelog for production release v1.0.0
Jan 14, 2020
fef5e84
Add test specifying the behaviour of the subscribable filter
Nov 25, 2019
9dbc49d
Add filter for querying subscribable datasets
Nov 25, 2019
87cae46
Improve filter behaviour to allow filtering for non subscribable data…
Nov 25, 2019
daa3b4d
Add CHANGELOG file
Nov 26, 2019
fdd8aa0
Allow microservices to update the datasets errorMessage field
tiagojsag Dec 4, 2019
cc844d9
Add failing test for problem updating dataset applications
Dec 19, 2019
b893b1d
Fix problem removing dataset applications by admins who can manage th…
Dec 23, 2019
1db2f26
Add test for ensuring an admin cannot update the applications of data…
Dec 23, 2019
530e853
Minor improvements in validation of dataset application permissions
Jan 2, 2020
5b4e2b5
Add test cases covering other user roles (ADMIN and MANAGER)
Jan 7, 2020
129172d
Update changelog for production release v1.0.0
Jan 14, 2020
e1a8bff
Failing test reproducing the problem
Jan 24, 2020
8787004
Fix problem when patching dataset without changing the applications
Jan 24, 2020
f0ac66e
Update CHANGELOG
Jan 24, 2020
798b71d
Send datasets without user associated to the bottom when sorting by u…
Jan 27, 2020
77e777d
Merge branch 'develop' into feature/sort-user-fields
Jan 27, 2020
45f4327
Merge branch 'feature/sort-user-fields' into develop
Jan 27, 2020
f935bea
Update CHANGELOG for production release v1.1.0
Jan 27, 2020
b142d69
Simplify k8s files and update jenkinsfile for flexible deployment
tiagojsag Feb 4, 2020
b132d8a
Update jenkinsfile for flexible deployment - fix missing replacement
tiagojsag Feb 4, 2020
8d64a4c
Merge branch 'master' into release/v1.0.0
Feb 6, 2020
502c51a
Merge branch 'release/v1.0.0'
Feb 6, 2020
38a571c
Test folder utils reorg
tiagojsag Feb 15, 2020
d499a59
Minor refactor in test source code
tiagojsag Feb 15, 2020
f8e222d
Add missing import on test
tiagojsag Feb 15, 2020
f407d93
Update readme badge
tiagojsag Feb 15, 2020
03e9cc3
Remove added query param usersRole which generated huge pagination links
Mar 9, 2020
8b72f07
Update CHANGELOG
Mar 9, 2020
0ff93cf
Add support for nested filters inside applicationConfig object
Mar 16, 2020
3de1b2f
Update CHANGELOG
Mar 16, 2020
6c7747e
WIP - developing swagger for the dataset endpoint
EnriqueCornejo Jun 28, 2017
16714a4
Swagger rewrite - less nested definitions
EnriqueCornejo Jun 28, 2017
9c19165
WIP Updated dataset swagger
EnriqueCornejo Jun 29, 2017
bc482be
[Security] Bump acorn from 7.1.0 to 7.1.1
dependabot-preview[bot] Mar 13, 2020
14c5fa7
Refactor to use lodash set
Mar 17, 2020
9b1f522
CS improvement
tiagojsag Feb 18, 2020
797a138
Fix issue when sorting for ascending order
tiagojsag Mar 17, 2020
5f74af7
Add test for filtering applicationConfig together with other filters
Mar 18, 2020
9706e51
Merge branch 'develop' into feat/nested-filters-application-config
Mar 18, 2020
b18e9d1
Merge branch 'feat/nested-filters-application-config' into develop
Mar 18, 2020
04a38a3
Fix issue where dataset upload would fail
tiagojsag Mar 20, 2020
87cb3ad
Remove temporary commented test code
tiagojsag Mar 20, 2020
ab23e37
Remove blockchain and verified fields and associated blockchain signa…
tiagojsag Mar 20, 2020
6134bf9
Update CHANGELOG for production release v1.2.0
Mar 20, 2020
c6b5490
Fix issue where deleting wms datasets would fail
tiagojsag Mar 21, 2020
a6f5ed1
Merge branch 'master' into develop
tiagojsag Mar 21, 2020
115f247
format changelog
tiagojsag Mar 21, 2020
50c015b
Update dev deps; minor QoL improvements
tiagojsag Mar 25, 2020
6a6369c
Update yarn.lock
tiagojsag Mar 25, 2020
c5ee29b
CS improvements
tiagojsag Mar 25, 2020
64b8fcd
Merge branch 'master' into release/v1.2.0
Mar 26, 2020
25808cf
Merge branch 'release/v1.2.0'
Mar 26, 2020
8f9a43f
Merge branch 'develop'
Mar 26, 2020
799c8b3
Merge branch 'master' into develop
Mar 26, 2020
793e7da
Add node afinity to k8s config
tiagojsag Apr 9, 2020
9fd99f8
v1.3.0 release
tiagojsag Apr 9, 2020
a03c902
Add node afinity to k8s config
tiagojsag Apr 9, 2020
2086a36
v1.3.0 release
tiagojsag Apr 9, 2020
47ad8b9
Eslint CS improvements to tests
tiagojsag Apr 20, 2020
aab253c
Add a few more tests for dataset update endpoint
tiagojsag Apr 28, 2020
ab71ada
Additional test for dataset delete; CS improvement
tiagojsag May 4, 2020
8830497
Additional tests for dataset cloning
tiagojsag May 4, 2020
73d3870
Basic tests for dataset sync
tiagojsag May 4, 2020
4939f14
Improve logging
tiagojsag May 13, 2020
34d4b00
v1.3.1 - Update mongoose; prefer mongo replicas for reads; disable mo…
tiagojsag May 19, 2020
7aaa548
Merge branch 'master' into develop
tiagojsag May 19, 2020
9df19e3
Logging and test CS improvements
tiagojsag Jul 13, 2020
1e6670e
Identify MS dependencies on README
tiagojsag Jul 13, 2020
df17dc0
[Security] Bump handlebars from 4.5.1 to 4.7.6
dependabot-preview[bot] May 14, 2020
014a64e
[Security] Bump websocket-extensions from 0.1.3 to 0.1.4
dependabot-preview[bot] Jun 5, 2020
bdc4fcd
Logging and test CS improvements
tiagojsag Jul 13, 2020
aba820a
Identify MS dependencies on README
tiagojsag Jul 13, 2020
8c039fd
[Security] Bump handlebars from 4.5.1 to 4.7.6
dependabot-preview[bot] May 14, 2020
ad3ec34
[Security] Bump websocket-extensions from 0.1.3 to 0.1.4
dependabot-preview[bot] Jun 5, 2020
afa60bd
Update CHANGELOG for release
Jul 14, 2020
4173151
Update requested CPU capacity
Aug 21, 2020
434269a
Update requested CPU capacity
Aug 21, 2020
b8ae291
Add yarn to dependency list
tiagojsag Sep 2, 2020
7f37225
Updated branch structure; simplified jenkinsfile
tiagojsag Sep 7, 2020
0df236f
Merge branch 'master' into develop
tiagojsag Sep 7, 2020
98cfec6
Update staging deployment for k8s 1.16
tiagojsag Sep 7, 2020
2f7169e
Update staging deployment for k8s 1.16
tiagojsag Sep 7, 2020
4eb26eb
Remove unnecessary jenkinsfile variable
tiagojsag Nov 6, 2020
76a8208
Additional test
tiagojsag Nov 6, 2020
afd5461
update husky package.json config
tiagojsag Nov 6, 2020
19910e5
[Security] Bump lodash from 4.17.15 to 4.17.20
dependabot-preview[bot] Oct 29, 2020
c6140c0
[Security] Bump yargs-parser from 13.1.1 to 13.1.2
dependabot-preview[bot] Sep 5, 2020
7dd13e7
[Security] Bump bl from 2.2.0 to 2.2.1
dependabot-preview[bot] Sep 3, 2020
b60968e
Update CHANGELOG for production release v1.3.3
Nov 17, 2020
6ba79ec
Update staging deployment for k8s 1.16
tiagojsag Sep 7, 2020
241ad8a
Add new auth middleware for /flush
ethanroday Nov 16, 2020
88320ff
Fix typo
ethanroday Nov 16, 2020
8c6c6cc
Add new auth middleware for /flush
ethanroday Nov 16, 2020
d7bdf8e
Fix typo
ethanroday Nov 16, 2020
0b22835
Fix tests
Nov 17, 2020
34c23e2
Update changelog
ethanroday Nov 17, 2020
4053728
Merge pull request #110 from resource-watch/flush-error-message
ethanroday Nov 17, 2020
74a7b29
Revert "Add informative error message for /:dataset/flush"
ethanroday Nov 17, 2020
41ac564
Replace CT integration library
tiagojsag Dec 4, 2020
ed6bbde
Extract mock for getting user data on tests
tiagojsag Dec 5, 2020
9a37239
Update RW API integration lib to v2.0
tiagojsag Dec 5, 2020
d9196be
Add optional CT connection depending on env var
tiagojsag Dec 7, 2020
58d235b
Add ct token to docker compose test run
tiagojsag Dec 7, 2020
cd7d590
Update RW API registration lib
tiagojsag Dec 9, 2020
1b1bce0
Modify dockehub account credentials
tiagojsag Dec 9, 2020
8e9ce49
Add missing env var to docker test
tiagojsag Dec 9, 2020
74686d1
Escape dockerhub password in jenkinsfile
tiagojsag Dec 9, 2020
a6a737e
Use WRI account on dockerhub interactions
tiagojsag Dec 10, 2020
bffe586
Merge branch 'production' into staging
tiagojsag Dec 10, 2020
34aa759
Merge branch 'staging' into dev
tiagojsag Dec 10, 2020
bfc38cb
added enpoint /lastUpdated to the dataset microservice
logoul Dec 10, 2020
a4b12da
Merge pull request #116 from resource-watch/testing-developer-docs
logoul Dec 11, 2020
9e62b70
Update RW integration lib
tiagojsag Dec 14, 2020
ee2f0b2
Update RW API integration MS to add fastly integration
tiagojsag Jan 12, 2021
7364b2a
[Security] Bump ini from 1.3.5 to 1.3.8
dependabot-preview[bot] Dec 14, 2020
92ad6c9
[Security] Bump urijs from 1.19.2 to 1.19.5
dependabot-preview[bot] Dec 30, 2020
65df2a6
Initial migration to typescript
tiagojsag Dec 18, 2020
3fc8d58
Add tslint ignore on mongoose connection apps
tiagojsag Jan 12, 2021
eaa416a
Update RW API integration lib
tiagojsag Jan 12, 2021
9e79ef0
Fix dockerfile for ts
tiagojsag Jan 12, 2021
82189af
Update RW API integration MS to add fastly integration
tiagojsag Jan 13, 2021
9c3fb02
Fix docker compose test
tiagojsag Jan 13, 2021
ede2869
Add missing var to docker-compose-test
tiagojsag Jan 15, 2021
a0fa517
Update dockerhub repo
tiagojsag Feb 5, 2021
29ddebf
Merge branch 'production' into staging
tiagojsag Feb 5, 2021
09c3239
Merge branch 'staging' into dev
tiagojsag Feb 5, 2021
cf2ce59
Update RW API integration lib
tiagojsag Feb 10, 2021
44e3dba
Remove k8s service
tiagojsag Feb 10, 2021
c7083f7
Remove dependency on CTs `authenticated` functionality
tiagojsag Feb 12, 2021
79105ea
Remove references to grunt since it was removed when migrating to TS.…
Feb 12, 2021
857d67f
Update local docker setup so it builds and registers with the Control…
Feb 19, 2021
de12c11
Update `rw-api-microservice-node` to fix issue with Fastly headers
tiagojsag Feb 22, 2021
431a0d3
Fix issue when handling invalid/outdated token
tiagojsag Feb 24, 2021
c287c24
Add SKIP_DEPLOYMENT_CONFIRMATION to jenkinsfile
tiagojsag Feb 24, 2021
553144a
Add SKIP_DEPLOYMENT_CONFIRMATION to jenkinsfile
tiagojsag Feb 24, 2021
fb4799e
Add SKIP_DEPLOYMENT_CONFIRMATION to jenkinsfile
tiagojsag Feb 24, 2021
c9bc7ef
Add SKIP_DEPLOYMENT_CONFIRMATION to jenkinsfile
tiagojsag Feb 24, 2021
c816383
Add SKIP_DEPLOYMENT_CONFIRMATION to jenkinsfile
tiagojsag Feb 24, 2021
ac96de1
Add SKIP_DEPLOYMENT_CONFIRMATION to jenkinsfile; update rw api integr…
tiagojsag Feb 25, 2021
109758b
Merge branch 'staging' into dev
tiagojsag Feb 25, 2021
ca3ad5d
Merge pull request #124 from resource-watch/feature/fix-local-docker-…
samdavidge Mar 1, 2021
39c8e57
Fix issue preventing updating `dataLastUpdated` with `null`
tiagojsag May 3, 2021
11a5001
Merge branch 'staging' into dev
tiagojsag May 3, 2021
216696c
Temporary log request
tiagojsag May 21, 2021
df4cb9b
Add support for hosts from `referer` header when generating paginatio…
tiagojsag May 21, 2021
b81141a
Add additional validation on pagination links tests
tiagojsag May 21, 2021
ace6319
Revert "added enpoint /lastUpdated to the dataset microservice"
tiagojsag May 21, 2021
6db90b0
Remove body from `DELETE` requests to other microservices
tiagojsag May 25, 2021
f27b579
Fix issue in DELETE requests to other microservices
tiagojsag May 25, 2021
eeac761
Update `rw-api-microservice-node` to add CORS support
tiagojsag May 28, 2021
fa9e502
Update `rw-api-microservice-node` to add CORS support
tiagojsag May 28, 2021
3320d5c
[Security] Bump glob-parent from 5.1.1 to 5.1.2
dependabot-preview[bot] Jun 8, 2021
ec33ab1
[Security] Bump hosted-git-info from 2.8.8 to 2.8.9
dependabot-preview[bot] May 7, 2021
e864052
[Security] Bump urijs from 1.19.5 to 1.19.6
dependabot-preview[bot] Mar 1, 2021
edcf426
[Security] Bump lodash from 4.17.20 to 4.17.21
dependabot-preview[bot] May 6, 2021
78d65ca
debug request headers for referer
tiagojsag Jun 9, 2021
eeb2364
debug request headers for referer
tiagojsag Jun 9, 2021
9d4df6a
Add support for hosts from `x-rw-domain` header when generating pagin…
tiagojsag Jun 9, 2021
84d8316
Update `rw-api-microservice-node` to remove CT support
tiagojsag Jun 17, 2021
469d058
Fix issue in docker image building
tiagojsag Jun 17, 2021
2784698
Restructure tests
tiagojsag Jul 1, 2021
ca39763
Restructure tests
tiagojsag Jul 1, 2021
b7610aa
Add tests for env functionality consolidation
tiagojsag Jul 1, 2021
a70343b
WIP Added filterIncludesByEnv implementation and uncomment tests
KalinichenkoP Jul 15, 2021
04ce6c4
Finalize filterIncludesByEnv implementation
tiagojsag Jul 15, 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
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

49 changes: 0 additions & 49 deletions .eslintrc.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ npm-debug.*
coverage
.nyc_output
/dev.env
dist
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ language: node_js
services:
- mongodb
node_js:
- "11.8"
- "11"
- "12"
cache:
directories:
- "node_modules"
Expand All @@ -12,18 +11,19 @@ env:
- CC_TEST_REPORTER_ID=dabdd92208e41ebbec13b01f5e943a0dcf7ec40f4a98d6d0a8f811e8cca9b443
- NODE_ENV=test
- PORT=5037
- API_VERSION=v1
- LOCAL_URL=http://127.0.0.1:3001
- CT_URL=http://127.0.0.1:9000
- GATEWAY_URL=http://127.0.0.1:9000
- MONGO_PORT_27017_TCP_ADDR=127.0.0.1
- CT_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im1pY3Jvc2VydmljZSIsImNyZWF0ZWRBdCI6IjIwMTYtMDktMTQifQ.IRCIRm1nfIQTfda_Wb6Pg-341zhV8soAgzw7dd5HxxQ
- MICROSERVICE_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im1pY3Jvc2VydmljZSIsImNyZWF0ZWRBdCI6IjIwMTYtMDktMTQifQ.IRCIRm1nfIQTfda_Wb6Pg-341zhV8soAgzw7dd5HxxQ
- S3_ACCESS_KEY_ID=foo
- S3_SECRET_ACCESS_KEY=bar
- FASTLY_ENABLED=false

before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- npm test
- npm run coverage
- yarn test
- yarn run coverage
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
99 changes: 99 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
## 17/06/2021

- Update `rw-api-microservice-node` to remove CT support.

## 09/06/2021

- Add support for hosts from `x-rw-domain` header when generating pagination links.

## 28/05/2021

- Update `rw-api-microservice-node` to add CORS support.

## 25/05/2021

- Remove body from `DELETE` requests to other microservices

## 21/05/2021

- Add support for hosts from `referer` header when generating pagination links.

## 03/05/2021

- Fix issue preventing updating `dataLastUpdated` with `null`.

## 22/02/2021

- Update `rw-api-microservice-node` to fix issue with Fastly headers.

## 12/02/2021

- Remove dependency on CT's `authenticated` functionality

## 18/12/2020

- Initial migration to Typescript

## 04/12/2020

- Replace CT integration library

# v1.3.3

## 17/11/2020

- Security update of NPM package `lodash` from 4.17.15 to 4.17.20.
- Security update of NPM package `yargs-parser` from 13.1.1 to 13.1.2.
- Security update of NPM package `bl` from 2.2.0 to 2.2.1.

# v1.3.2

## 13/07/2020

- Minor logging improvements.
- Security updates to the `handlebars` and `websocket-extensions` NPM packages.

# v1.3.1

## 19/05/2020

- Use secondary mongo nodes for read operations.
- Disable mongo unified topology.

# v1.3.0

## 09/04/2020

- Add node affinity to kubernetes configuration.

## 24/03/2020

- Remove blockchain and verified fields and associated blockchain signature logic.

# v1.2.0

## 23/03/2020

- Fix issue where deleting wms datasets would fail
- Fix issue where dataset upload would fail.
- Add support for nested filters in applicationConfig object.
- Fix issue with sorting for ascending order.
- Remove `usersRole` query param which generated huge pagination links.

# v1.1.0

## 27/01/2020

- Add possibility of sorting datasets by user fields (such as name or role).
- Fix bug patching dataset without changing dataset apps.

# v1.0.0

## 14/01/2020

- Add filter for querying subscribable datasets.
- Fix bug removing dataset applications by admins who can manage the removed applications.

# Previous

- Allow microservices to update the dataset's `errorMessage` field.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
FROM mhart/alpine-node:11.8
MAINTAINER sergio.gordillo@vizzuality.com
FROM node:12-alpine
MAINTAINER info@vizzuality.com

ENV NAME dataset
ENV USER microservice
ENV USER dataset

RUN apk update && apk upgrade && \
apk add --no-cache --update bash git openssh python alpine-sdk

RUN addgroup $USER && adduser -s /bin/bash -D -G $USER $USER

RUN npm install -g grunt-cli bunyan

RUN mkdir -p /opt/$NAME
COPY package.json /opt/$NAME/package.json
RUN cd /opt/$NAME && npm install
COPY yarn.lock /opt/$NAME/yarn.lock
RUN cd /opt/$NAME && yarn

COPY entrypoint.sh /opt/$NAME/entrypoint.sh
COPY tsconfig.json /opt/$NAME/tsconfig.json
COPY config /opt/$NAME/config
COPY ./src /opt/$NAME/src
COPY ./test opt/$NAME/test

WORKDIR /opt/$NAME

COPY ./app /opt/$NAME/app
RUN chown -R $USER:$USER /opt/$NAME

# Tell Docker we are going to use this ports
Expand Down
104 changes: 35 additions & 69 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,10 @@

node {

// Actions
def forceCompleteDeploy = false
try {
timeout(time: 15, unit: 'SECONDS') {
forceCompleteDeploy = input(
id: 'Proceed0', message: 'Force COMPLETE Deployment', parameters: [
[$class: 'BooleanParameterDefinition', defaultValue: true, description: '', name: 'Please confirm you want to recreate services and deployments']
])
}
}
catch(err) { // timeout reached or input false
// nothing
}

// Variables
def tokens = "${env.JOB_NAME}".tokenize('/')
def appName = tokens[0]
def dockerUsername = "${DOCKER_USERNAME}"
def dockerUsername = "${DOCKER_WRI_USERNAME}"
def imageTag = "${dockerUsername}/${appName}:${env.BRANCH_NAME}.${env.BUILD_NUMBER}"

currentBuild.result = "SUCCESS"
Expand All @@ -41,8 +27,8 @@ node {
}

stage('Push Docker') {
withCredentials([usernamePassword(credentialsId: 'Vizzuality Docker Hub', usernameVariable: 'DOCKER_HUB_USERNAME', passwordVariable: 'DOCKER_HUB_PASSWORD')]) {
sh("docker -H :2375 login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD}")
withCredentials([usernamePassword(credentialsId: 'WRI Docker Hub', usernameVariable: 'DOCKER_HUB_USERNAME', passwordVariable: 'DOCKER_HUB_PASSWORD')]) {
sh("docker -H :2375 login -u ${DOCKER_HUB_USERNAME} -p '${DOCKER_HUB_PASSWORD}'")
sh("docker -H :2375 push ${imageTag}")
sh("docker -H :2375 push ${dockerUsername}/${appName}:latest")
sh("docker -H :2375 rmi ${imageTag}")
Expand All @@ -52,50 +38,49 @@ node {
stage ("Deploy Application") {
switch ("${env.BRANCH_NAME}") {

// Roll out to dev
case "dev":
sh("echo Deploying to DEV cluster")
sh("kubectl config use-context ${KUBECTL_CONTEXT_PREFIX}_${CLOUD_PROJECT_NAME}_${CLOUD_PROJECT_ZONE}_${KUBE_DEV_CLUSTER}")
sh("kubectl apply -f k8s/dev/")
sh("kubectl set image deployment ${appName} ${appName}=${imageTag} --record")
break

// Roll out to staging
case "develop":
case "staging":
sh("echo Deploying to STAGING cluster")
sh("kubectl config use-context gke_${GCLOUD_PROJECT}_${GCLOUD_GCE_ZONE}_${KUBE_STAGING_CLUSTER}")
def service = sh([returnStdout: true, script: "kubectl get deploy ${appName} || echo NotFound"]).trim()
if ((service && service.indexOf("NotFound") > -1) || (forceCompleteDeploy)){
sh("sed -i -e 's/{name}/${appName}/g' k8s/services/*.yaml")
sh("sed -i -e 's/{name}/${appName}/g' k8s/staging/*.yaml")
sh("kubectl apply -f k8s/services/")
sh("kubectl apply -f k8s/staging/")
}
sh("kubectl config use-context ${KUBECTL_CONTEXT_PREFIX}_${CLOUD_PROJECT_NAME}_${CLOUD_PROJECT_ZONE}_${KUBE_STAGING_CLUSTER}")
sh("kubectl apply -f k8s/staging/")
sh("kubectl set image deployment ${appName} ${appName}=${imageTag} --record")
break

// Roll out to production
case "master":
case "production":
def userInput = true
def didTimeout = false
try {
timeout(time: 60, unit: 'SECONDS') {
userInput = input(
id: 'Proceed1', message: 'Confirm deployment', parameters: [
[$class: 'BooleanParameterDefinition', defaultValue: true, description: '', name: 'Please confirm you agree with this deployment']
])
}
}
catch(err) { // timeout reached or input false
sh("echo Aborted by user or timeout")
if('SYSTEM' == user.toString()) { // SYSTEM means timeout.
didTimeout = true
} else {
userInput = false

if ("${SKIP_DEPLOYMENT_CONFIRMATION}" != "true") {
try {
timeout(time: 60, unit: 'SECONDS') {
userInput = input(
id: 'Proceed1', message: 'Confirm deployment', parameters: [
[$class: 'BooleanParameterDefinition', defaultValue: true, description: '', name: 'Please confirm you agree with this deployment']
])
}
}
catch(err) { // timeout reached or input false
sh("echo Aborted by user or timeout")
if('SYSTEM' == user.toString()) { // SYSTEM means timeout.
didTimeout = true
} else {
userInput = false
}
}
}
if (userInput == true && !didTimeout){
if ((userInput == true && !didTimeout) || "${SKIP_DEPLOYMENT_CONFIRMATION}" != "true") {
sh("echo Deploying to PROD cluster")
sh("kubectl config use-context gke_${GCLOUD_PROJECT}_${GCLOUD_GCE_ZONE}_${KUBE_PROD_CLUSTER}")
def service = sh([returnStdout: true, script: "kubectl get deploy ${appName} || echo NotFound"]).trim()
if ((service && service.indexOf("NotFound") > -1) || (forceCompleteDeploy)){
sh("sed -i -e 's/{name}/${appName}/g' k8s/services/*.yaml")
sh("sed -i -e 's/{name}/${appName}/g' k8s/production/*.yaml")
sh("kubectl apply -f k8s/services/")
sh("kubectl apply -f k8s/production/")
}
sh("kubectl config use-context ${KUBECTL_CONTEXT_PREFIX}_${CLOUD_PROJECT_NAME}_${CLOUD_PROJECT_ZONE}_${KUBE_PROD_CLUSTER}")
sh("kubectl apply -f k8s/production/")
sh("kubectl set image deployment ${appName} ${appName}=${imageTag} --record")
} else {
sh("echo NOT DEPLOYED")
Expand All @@ -109,28 +94,9 @@ node {
currentBuild.result = "SUCCESS"
}
}

// Notify Success
slackSend (color: '#00FF00', channel: '#the-new-api', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
emailext (
subject: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """<p>SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)


} catch (err) {

currentBuild.result = "FAILURE"
// Notify Error
slackSend (color: '#FF0000', channel: '#the-new-api', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
emailext (
subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
throw err
}

Expand Down
Loading