Convection is the application that powers our consignments workflow, enabling users to submit works to consign through Artsy partners. For now, it encapsulates logic from rothko-api and rothko-web-public.
- State: production
- Production: https://convection.artsy.net | Kubernetes
- Staging: https://convection-staging.artsy.net | Kubernetes
- GitHub: https://github.com/artsy/convection
- Point People: @jonallured
- CI/Deploys: CircleCi; PRs merged to
artsy/convection#master
are automatically deployed to staging; PRs fromstaging
torelease
are automatically deployed to production. Create such a PR withdeploy_pr
or this handy link. - Cron Tasks: A daily digest is sent to partners at 10am EST. The production database is exported Sunday mornings at 12am EST, and imported to staging Sunday mornings at 1am EST.
Convection accepts PRs from branches on the main artsy/convection repo. PRs from forks will not be built in the CI environment and cannot be merged directly.
-
Fork the project to your GitHub account
-
Clone your fork:
$ git clone git@github.com:your-github-username/convection.git
-
Read and run setup script:
$ cat bin/setup $ bin/setup
-
Populate environment variables
.env.example
contains the keys you'll need to add to your local.env
file. Consider using thecopy_env
utility to populate the values directly from hokusai:$ copy_env hokusai
Once setup, you can run the tests like this:
$ bundle exec rake spec
# or
$ hokusai test
Note: the default rake task is setup to run tests and RuboCop.
If you have changed Convection GraphQL schema, make sure to run:
$ rake graphql:schema:idl
See docs/schema-stitching.md for more.
$ foreman start
# or
$ hokusai dev start
See the Procfile and Hokusai configuration to understand other services launched.
When running in development, this API has a GraphiQL instance at http://localhost:5000/graphiql
See schema stitching for more info about propagating changes through the Artsy application ecosystem.
Generate a valid JWT token in a Convection console:
payload = { aud: 'app', sub: '<valid user id>', roles: 'user,admin' }
token = JWT.encode payload, Convection.config.jwt_secret, 'HS256'
Use curl
to generate a submission with an artist_id
(emails will appear in
mailtrap).
curl -H 'Authorization: Bearer <token>' -H 'Accept: application/json' -d 'artist_id=5059d82a1fc9fa00020008ff' https://convection-staging.artsy.net/api/submissions
Via Metaphysics:
Be sure a valid X-Access-Token
is set (can be jwt
from above) and submit the following GraphQL mutation:
{
"input": {
"artistID": "5059d82a1fc9fa00020008ff"
}
}
mutation createConsignmentSubmissionMutation(
$input: CreateSubmissionMutationInput!
) {
createConsignmentSubmission(input: $input) {
consignmentSubmission {
id
artist {
id
}
}
}
}