Skip to content

TT-7395: Autosuggest Session #50

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

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ae44f9b
refactor(constants): remove x-w3w-wrapper header
ghermet Apr 20, 2022
f53d6c9
refactor(test): use jest as test runner
ghermet Apr 20, 2022
2194e44
refactor(test): remove sinon / mocha
ghermet Apr 20, 2022
bd0bcd1
test(client): added autosuggest session pacts
ghermet Apr 21, 2022
9dbf37d
ci(circleci): publish pacts before npm package
ghermet Apr 21, 2022
a03b3d8
test(autosuggest-session): updated pact
ghermet Apr 21, 2022
4e90a30
build(package): updated pact:publish
ghermet Apr 21, 2022
5ef667e
ci(circleci): publish dev and prod pacts
ghermet Apr 21, 2022
002f1d4
test(autosuggest-session): added version to body
ghermet Apr 21, 2022
46337b4
test(transport): updated tests
ghermet Apr 22, 2022
809cd9c
refactor(git): updated git ignore
ghermet Apr 22, 2022
b10b24a
[mod] remove pacts from git
c5haw Apr 22, 2022
d382305
test(autosuggest-session): reduced duplication
ghermet Apr 22, 2022
edc8128
Merge branch 'tt-7395' of github.com:what3words/w3w-node-wrapper into…
c5haw Apr 22, 2022
5e3d0f8
[revert] removal of mocha [mod] sessionStart updateSession calls para…
c5haw Apr 22, 2022
91ab4e4
[mod] CI pipeline
c5haw Apr 22, 2022
06e1730
[mod] CI pipeline
c5haw Apr 22, 2022
27f662a
[fix] CI publish to broker
c5haw Apr 22, 2022
9c0cd28
[fix] CI publish to broker
c5haw Apr 22, 2022
4c67f2c
[mod] remove pact publishing from package.json - should only publish …
c5haw Apr 22, 2022
af8cda7
[mod] add .nycrc
c5haw Apr 22, 2022
a95625d
[mod] remove error states that don't make sense
c5haw Apr 22, 2022
45ac51a
[mod] remove unused imports
c5haw Apr 22, 2022
1225f26
[mod] remove correlation ID header from error response
c5haw Apr 22, 2022
25645ba
feat(autosuggest-session): prevent requests with private DNS
ghermet Apr 25, 2022
e9b0a1f
[mod] only fire event for w3w domains
c5haw Apr 25, 2022
c456e91
Merge branch 'tt-7395' of github.com:what3words/w3w-node-wrapper into…
c5haw Apr 25, 2022
b5ce126
[mod] adding sandbox to tests
c5haw Apr 25, 2022
5d6528a
[mod] version bump
c5haw Apr 25, 2022
b38c72d
[mod] fix typo in typeahead_delay
c5haw Apr 25, 2022
331b922
[mod] add void transport and make transport mandatory in service
c5haw Apr 26, 2022
8e20487
[mod] versioning
c5haw Apr 26, 2022
19de43d
test(pact): added pact utils
ghermet May 9, 2022
1b61633
test(pact): set default port
ghermet May 9, 2022
6cd613f
ci(circleci): setup pact can-i-use
ghermet May 19, 2022
577d8c1
refactor(test): use @what3words/pact-utils
ghermet May 19, 2022
490cc2b
ci(circleci): record pact deployment
ghermet May 24, 2022
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
117 changes: 110 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,103 @@ jobs:
- checkout
- setup_environment
- node/install-packages
- run: npm run coverage
- run:
name: Run test coverage
command: npm run coverage
- run:
name: Inject version constant
command: sed -ie "s/__VERSION__/${VERSION}/g" src/lib/constants.ts
- run: npm run compile
- run:
name: Compile project
command: npm run compile
- store_test_results:
path: ./coverage
- persist_to_workspace:
root: .
paths:
- ./pacts
- .npmrc
- ./dist
- ./package-lock.json
- ./package.json
- ./node_modules
# - jobstatus

pact-publish-dev:
executor: build-executor
steps:
- attach_workspace:
at: /tmp/workspace
- setup_environment:
version_path: /tmp/workspace
- run:
name: Publish development pacts to broker
command: cd /tmp/workspace && npx pact-broker publish pacts --consumer-app-version="$VERSION-$(echo $CIRCLE_SHA1 | cut -c -7)" --auto-detect-version-properties --broker-base-url=${PACT_BROKER_BASE_URL}
# - jobstatus

pact-publish-prod:
executor: build-executor
steps:
- attach_workspace:
at: /tmp/workspace
- setup_environment:
version_path: /tmp/workspace
- run:
name: Publish production pacts to broker
command: |
cd /tmp/workspace && \
npx pact-broker publish pacts \
--consumer-app-version=$VERSION \
--auto-detect-version-properties \
--broker-base-url=${PACT_BROKER_BASE_URL}
# - jobstatus

pact-can-i-deploy:
executor: build-executor
steps:
- attach_workspace:
at: /tmp/workspace
- setup_environment:
version_path: /tmp/workspace
- run:
name: Verify pacts
command: |
cd /tmp/workspace && \
npx pact-broker can-i-deploy \
--pacticipant w3w-node-wrapper \
--broker-username ${PACT_BROKER_USERNAME} \
--broker-password ${PACT_BROKER_PASSWORD} \
--broker-base-url ${PACT_BROKER_BASE_URL} \
--version $VERSION \
--to-environment production
# - jobstatus

pact-record-deployment:
executor: build-executor
steps:
- attach_workspace:
at: /tmp/workspace
- setup_environment:
version_path: /tmp/workspace
- run:
name: Record Pact Deployment
command: |
cd /tmp/workspace && \
npx pact-broker record-deployment \
--pacticipant w3w-node-wrapper \
--version $VERSION \
--environment production
# - jobstatus

publish:
npm-publish:
executor: build-executor
steps:
- attach_workspace:
at: /tmp/workspace
- setup_environment:
version_path: /tmp/workspace
- run:
name: "publish npm"
name: Publish package to NPM
command: cd /tmp/workspace && npm publish
# - jobstatus

Expand All @@ -127,14 +199,45 @@ workflows:
build-and-deploy:
jobs:
- build_test
- publish:
context: org-global
- pact-publish-dev:
context:
- org-global
- w3w-pact
requires:
- build_test
filters:
branches:
ignore: master
- pact-publish-prod:
context:
- org-global
- w3w-pact
requires:
- build_test
filters:
branches:
only: master
- pact-can-i-deploy:
context:
- org-global
- w3w-pact
requires:
- pact-publish-prod
filters:
branches:
only: master
- npm-publish:
context:
- org-global
requires:
- pact-can-i-deploy
filters:
branches:
only: master
- tag:
requires:
- publish
- npm-publish
- pact-record-deployment:
requires:
- tag

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,12 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows,visualstudiocode
# VSCode
.idea

# Snyk cacke
.dccache

# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows,visualstudiocode

pacts
Loading