Package: airbyte-source-fauna
New ReadersIf you know how Airbyte works, readbootstrap.mdfor a quick introduction to this source. If you haven't
used airbyte before, readoverview.mdfor a longer overview about what this connector is and how to use
it.First, start a local fauna container:docker run --rm --name faunadb -p 8443:8443 fauna/faunadbIn another terminal, cd into the connector directory:cd airbyte-integrations/connectors/source-faunaOnce started the container is up, setup the database:fauna eval "$(cat examples/setup_database.fql)" --domain localhost --port 8443 --scheme http --secret secretFinally, run the connector:python main.py spec
python main.py check --config examples/config_localhost.json
python main.py discover --config examples/config_localhost.json
python main.py read --config examples/config_localhost.json --catalog examples/configured_catalog.jsonTo pick up a partial failure you need to pass in a state file. To test via example induce a crash via bad data (e.g. a missing required field), updateexamples/sample_state_full_sync.jsonto contain your emitted state and then run:python main.py read --config examples/config_localhost.json --catalog examples/configured_catalog.json --state examples/sample_state_full_sync.jsonFirst, cd into the connector directory:cd airbyte-integrations/connectors/source-faunaThe integration tests require a secret config.json. Ping me on slack to get this file.
Once you have this file, put it insecrets/config.json. A sample of this file can be
found atexamples/secret_config.json. Once the file is created, build the connector:docker build . -t airbyte/source-fauna:devNow, run the integration tests:python -m pytest -p integration_tests.acceptanceThis is the repository for the Fauna source connector, written in Python.
For information about how to use this connector within Airbyte, seethe documentation.To iterate on this connector, make sure to complete this prerequisites section.From this connector directory, create a virtual environment:python -m venv .venvThis will generate a virtualenv for this module in.venv/. Make sure this venv is active in your
development environment of choice. To activate it from the terminal, run:source .venv/bin/activate
pip install -r requirements.txtIf you are in an IDE, follow your IDE's instructions to activate the virtualenv.Note that while we are installing dependencies fromrequirements.txt, you should only editsetup.pyfor your dependencies.requirements.txtis
used for editable installs (pip install -e) to pull in Python dependencies from the monorepo and will callsetup.py.
If this is mumbo jumbo to you, don't worry about it, just put your deps insetup.pybut install usingpip install -r requirements.txtand everything
should work as you expect.If you are a community contributor, follow the instructions in thedocumentationto generate the necessary credentials. Then create a filesecrets/config.jsonconforming to thesource_fauna/spec.yamlfile.
Note that thesecretsdirectory is gitignored by default, so there is no danger of accidentally checking in sensitive information.
Seeexamples/secret_config.jsonfor a sample config file.If you are an Airbyte core member, copy the credentials in Lastpass under the secret namesource fauna test credsand place them intosecrets/config.json.python main.py spec
python main.py check --config secrets/config.json
python main.py discover --config secrets/config.json
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.jsonViaairbyte-ci(recommended):airbyte-ciconnectors--name=source-faunabuildAn image will be built with the tagairbyte/source-fauna:dev.Viadocker build:dockerbuild-tairbyte/source-fauna:dev.Then run any of the connector commands as follows:docker run --rm airbyte/source-fauna:dev spec
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-fauna:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-fauna:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-fauna:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.jsonYou can run our full test suite locally usingairbyte-ci:airbyte-ciconnectors--name=source-faunatestCustomizeacceptance-test-config.ymlfile to configure tests. SeeConnector Acceptance Testsfor more information.
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.All of your dependencies should go insetup.py, NOTrequirements.txt. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
We split dependencies between two groups, dependencies that are:required for your connector to work need to go toMAIN_REQUIREMENTSlist.required for the testing need to go toTEST_REQUIREMENTSlistYou've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?Make sure your changes are passing our test suite:airbyte-ci connectors --name=source-fauna testBump the connector version inmetadata.yaml: increment thedockerImageTagvalue. Please followsemantic versioning for connectors.Make sure themetadata.yamlcontent is up to date.Make the connector documentation and its changelog is up to date (docs/integrations/sources/fauna.md).Create a Pull Request: useour PR naming conventions.Pat yourself on the back for being an awesome contributor.Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.