Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update engines to 4.5.0-9.16a2d8471422d7f83674593c14fa70d61bf28414 #15649

Conversation

prisma-bot
Copy link
Contributor

This automatic PR updates the engines to version 4.5.0-9.16a2d8471422d7f83674593c14fa70d61bf28414. This will get automatically merged if all the tests pass.

Packages

Package NPM URL
@prisma/engines-version https://npmjs.com/package/@prisma/engines-version/v/4.5.0-9.16a2d8471422d7f83674593c14fa70d61bf28414
@prisma/prisma-fmt-wasm https://npmjs.com/package/@prisma/prisma-fmt-wasm/v/4.5.0-9.16a2d8471422d7f83674593c14fa70d61bf28414

Engines commit

prisma/prisma-engines@16a2d8471422d7f83674593c14fa70d61bf28414

@prisma-bot prisma-bot requested a review from a team October 4, 2022 09:47
@prisma-bot prisma-bot requested review from danstarns and removed request for a team October 4, 2022 09:47
@Jolg42
Copy link
Member

Jolg42 commented Oct 4, 2022

One test fails. should succeed when schema is invalid and using --force
Test:

it('should succeed when schema is invalid and using --force', async () => {
ctx.fixture('introspect')
const result = DbPull.new().parse(['--schema=./prisma/invalid.prisma', '--force'])
await expect(result).resolves.toMatchInlineSnapshot(``)
expect(ctx.mocked['console.log'].mock.calls.join('\n').replace(/\d{2,3}ms/, 'in XXms')).toMatchInlineSnapshot(``)
expect(ctx.mocked['console.info'].mock.calls.join('\n')).toMatchInlineSnapshot(`
Prisma schema loaded from prisma/invalid.prisma
Datasource "db": SQLite database "dev.db" at "file:dev.db"
`)
expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
expect(ctx.mocked['process.stdout.write'].mock.calls.join('\n')).toMatchInlineSnapshot(`
- Introspecting based on datasource defined in prisma/invalid.prisma
✔ Introspected 3 models and wrote them into prisma/invalid.prisma in XXXms
Run prisma generate to generate Prisma Client.
`)
expect(ctx.mocked['process.stderr.write'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
expect(ctx.fs.read('prisma/invalid.prisma')).toMatchSnapshot()
})
})

Failure: https://github.com/prisma/prisma/actions/runs/3181099950/jobs/5185461756#step:10:780

Error: P1012 Introspection failed as your current Prisma schema file is invalid·
    Please fix your current schema manually, use prisma validate to confirm it is valid and then run this command again.
    Or run this command with the --force flag to ignore your current schema and overwrite it. All local modifications will be lost.

@tomhoule probably related to prisma/prisma-engines#3246

The test was passing before when running prisma introspect --force on the following schema

generator client {
  provider = "prisma-client-js"
  output   = "../generated/client"
}

datasource db {
  provider = "sqlite"
  url      = "file:dev.db"
}

// - This is invalid and shows:
// Error validating model "something": Each model must have at least one unique criteria that has only required fields
// Either mark a single field with `@id`, `@unique` or add a multi field criterion with `@@id([])` or `@@unique([])` to the model.
model something {
  id Int
}

So previously if the schema.prisma was invalid, we could still read the datasource and prisma introspect --force was working, ignoring the invalid schema.

It looks like we should fix this.
As breaking changes in PSL are often invalid, we still want to give people the option to add --force to ignore and introspect from scratch.

@Jolg42
Copy link
Member

Jolg42 commented Oct 5, 2022

Superseded by .12 #15661

@Jolg42 Jolg42 closed this Oct 5, 2022
@Jolg42 Jolg42 deleted the deps/engines-4.5.0-9.16a2d8471422d7f83674593c14fa70d61bf28414 branch October 5, 2022 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants