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#main
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.
-
Read and run setup script:
$ cat bin/setup $ bin/setup
-
Shared Configuration for Local Development
Convection uses shared configuration to distribute common and sensitive configuration values. The setup script will download .env.shared
and also initialize .env
(from .env.example
). The .env
file is for custom configuration and any overrides.
If a new sensitive (or common) environment variable needs to be added for development, remember to also update the shared configuraton in S3. Find update instructions here. This is only required when expanding shared development environment configuration.
-
Fork the project to your GitHub account
-
Clone your fork:
$ git clone git@github.com:your-github-username/convection.git
- Populate environment variables
See initializer for environment variables that you'll need to add to your local .env
file.
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 Standard Ruby.
If you have changed Convection GraphQL schema, make sure to do the following:
Step 1: In convection, run:
$ rake graphql:schema:idl
Step 2: Copy the generated _schema.graphql
file to the convection.graphql file in metaphysics.
This file is used for stitching. See docs/schema-stitching.md for additional step you might need to do.
$ foreman start # to run web and worker processes
# or
$ foreman start web # to run web process only
# or
$ hokusai dev start # to run via local docker
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
}
}
}
}