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

New NovaPoshta Adapter 1.0.0 #2294

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

alexbakers
Copy link

Description

NovaPoshta Adapter for tracking parcels.

Steps to Test

$ yarn test packages/sources/novaposhta/test/unit/tracking.test.ts 
 PASS  packages/sources/novaposhta/test/unit/tracking.test.ts

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.672 s
$ yarn test packages/sources/novaposhta/test/integration/tracking.test.ts 
 PASS  packages/sources/novaposhta/test/integration/tracking.test.ts
{"level":"warn","time":1667520302342,"pid":88822,"hostname":"Alex-Baker","msg":"Could not load payload: [{\"instancePath\":\"\",\"schemaPath\":\"#/type\",\"keyword\":\"type\",\"params\":{\"type\":\"object\"},\"message\":\"must be object\"}]"}
{"level":"warn","time":1667520302342,"pid":88822,"hostname":"Alex-Baker","msg":"Falling back to default empty payload"}
{"level":"info","time":1667520302351,"pid":88822,"hostname":"Alex-Baker","msg":"Server listening on http://0.0.0.0:51933!"}

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   1 passed, 1 total
Time:        2.355 s, estimated 3 s

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant <ADAPTER_PACKAGE>/schemas/env.json and <ADAPTER_PACKAGE>/README.md
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Clubhouse/Shortcut
  • This is related to a maximum of one Clubhouse/Shortcut story or GitHub issue
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types)
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2022

⚠️ No Changeset found

Latest commit: ef8ec26

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@boxhock boxhock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this PR! Referring to #2293 for the changeset issues

Comment on lines 143 to 151
"@chainlink/reduce-adapter": "workspace:*",
"@chainlink/renvm-address-set-adapter": "workspace:*",
"@chainlink/rocket-pool-adapter": "workspace:*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are being erroneously removed. Let's add them back.

Comment on lines 346 to 366
{
"path": "../../non-deployable/reduce"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@@ -0,0 +1,43 @@
{
"name": "@chainlink/novaposhta-adapter",
"version": "1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to start it on 0.0.0, and make a changeset with a "major" version bump, which will make this 1.0.0 when released.

@@ -0,0 +1,13 @@
{
"$id": "https://external-adapters.chainlinklabs.com/schemas/example-source-adapter.json",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"$id": "https://external-adapters.chainlinklabs.com/schemas/example-source-adapter.json",
"$id": "https://external-adapters.chainlinklabs.com/schemas/novaposhta-adapter.json",

APIEndpoint,
} from '@chainlink/ea-bootstrap'
import { makeConfig } from './config'
import * as endpoints from './endpoint' // The endpoints must be exported as shown in endpoint/index.ts for README generation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import * as endpoints from './endpoint' // The endpoints must be exported as shown in endpoint/index.ts for README generation.
import * as endpoints from './endpoint'

"number": "59000869676636"
}]
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -0,0 +1 @@
Tests that run the adapter and send an end to end request using live API endpoints.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this file

Comment on lines 1 to 3
Tests that run the adapter and send an end to end request using mocked API endpoints.

See `packages/source/curve/test/integration` and `packages/composite/synth-index/test/integration` for reference. The integration tests are used for the example input/outputs during README generation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

Comment on lines 125 to 127
{
"path": "./scripts/src/generate-readme/test/integration/readme-test-adapter/tsconfig.test.json"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this back in

const customError = (data: ResponseSchema) => data.success === false

export const description =
'Get shipment status by tracking number (https://developers.novaposhta.ua).'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you maybe add a link to where the different tracking status codes are explained?

Copy link
Author

@alexbakers alexbakers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boxhock thank you very much, you showed in great detail what needs to be fixed.
I will take all the changes.
Please, if I merge branches incorrectly, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants