Convection
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.
Contributing Pull Requests
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.
Setup
-
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
Tests
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.
Did You Change the GraphQL Schema?
If you have changed Convection GraphQL schema, make sure to run:
$ rake graphql:schema:idl
See docs/schema-stitching.md for more.
Starting Server
$ foreman start
# or
$ hokusai dev start
See the Procfile and Hokusai configuration to understand other services launched.
GraphQL
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.
Creating a Submission
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'
Via API:
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
Metaphysics:
ViaBe 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
}
}
}
}