Skip to content

Cross-project deploy fails with 500 once the target project has collections #1606

Open

Description

@midigofrank

Deploying one project into another (e.g. staging to prod) works the first time, then returns a 500 on every later deploy once the target has collections.

Steps to reproduce

  1. Add a collection to the staging project in Lightning
  2. openfn project pull <staging-uuid> --alias staging
  3. openfn project fetch <prod-uuid> --alias prod (staging stays checked out)
  4. openfn project deploy prod --no-checkout --force: succeeds and creates the collections in prod
  5. Edit a job, then run the same deploy again: Failed to deploy project: 500

Lightning logs:

** (RuntimeError) you are attempting to change relation :collections of
Lightning.Projects.Project but the `:on_replace` option of this relation
is set to `:raise`.

Cause

For cross-project deploys, merge uses sandbox mode, which takes the local collections as they are instead of passing them through mergeCollections. Collections from resources.yaml are only names, so each deploy sends new ids for collections prod already has, and Lightning rejects them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    New Issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions