dataform-co / dataform

Dataform is a framework for managing SQL based data operations in BigQuery
https://cloud.google.com/dataform/docs
Apache License 2.0
853 stars 165 forks source link

Update to v3.0.1 produces "Uncaught Error: Failed to resolve dataform.json" for repo with dependency packages #1800

Closed stevenleggdfe closed 3 months ago

stevenleggdfe commented 3 months ago

Steps to reproduce:

  1. Use a project with a dependency package installed via package.json that is currently using dataform-core v3.0.0
  2. Ensure that dataform-core version and dependency package version(s) are specified in package.json, not workflow_settings.yaml as per https://cloud.google.com/dataform/docs/update#move-json
  3. Update package.json to bump the dataform-core version to 3.0.1
  4. Click 'Install packages'
  5. Error is displayed: "Uncaught Error: Failed to resolve dataform.json"
cwashcraft commented 3 months ago

We are also seeing this error, with the underlying error being related to duplicate operation names:

Error: Duplicate canonical target detected. Canonical targets must be unique across tables, declarations, assertions, and operations: {...}

With the large list of changes i'm curious why this came as an incremented patch version rather than a minor version. We are pinning to 3.0.0 until we can address what is broken.

stevenleggdfe commented 3 months ago

@cwashcraft where did you see that underlying error?

Ekrekr commented 3 months ago

Thanks for the report! I've reproduced the original bug report.

I'll patch it and release a new version.

i'm curious why this came as an incremented patch version rather than a minor version

This is reasonable! We haven't been very consistent with our Semver usage, but we should be.

Ekrekr commented 3 months ago

This is actually caused by an internal issue with our semantic versioning in the sandboxing of running Dataform. This is being fixed, but in the meantime, there isn't a fix that I can patch Dataform open source with - so just stick with 3.0.0 for now.

cwashcraft commented 3 months ago

I see it when running dataform compile with the CLI

On Thu, Aug 8, 2024, 3:12 AM stevenleggdfe @.***> wrote:

@cwashcraft https://github.com/cwashcraft where did you see that underlying error?

— Reply to this email directly, view it on GitHub https://github.com/dataform-co/dataform/issues/1800#issuecomment-2275217228, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEYHEPFCMQ7XE4MIXN7YUDZQMR7HAVCNFSM6AAAAABMEJGB22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZVGIYTOMRSHA . You are receiving this because you were mentioned.Message ID: @.***>

Ekrekr commented 3 months ago

I see it when running dataform compile with the CLI On Thu, Aug 8, 2024, 3:12 AM stevenleggdfe @.> wrote: @cwashcraft https://github.com/cwashcraft where did you see that underlying error? — Reply to this email directly, view it on GitHub <#1800 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEYHEPFCMQ7XE4MIXN7YUDZQMR7HAVCNFSM6AAAAABMEJGB22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZVGIYTOMRSHA . You are receiving this because you were mentioned.Message ID: @.>

I do not! Can you give me a reproducible example please?

cwashcraft commented 3 months ago

I see it when running dataform compile with the CLI On Thu, Aug 8, 2024, 3:12 AM stevenleggdfe @.**> wrote: @cwashcraft https://github.com/cwashcraft where did you see that underlying error? — Reply to this email directly, view it on GitHub <#1800 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEYHEPFCMQ7XE4MIXN7YUDZQMR7HAVCNFSM6AAAAABMEJGB22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZVGIYTOMRSHA . You are receiving this because you were mentioned.Message ID: @.**>

I do not! Can you give me a reproducible example please?

Sure, here is a simple example. Both action_1 and action_2 have a requirement on test.js...

With 3.0.0 this did not result in any error

Screenshot 2024-08-08 at 8 34 43 AM Screenshot 2024-08-08 at 8 36 59 AM

With 3.0.1, the Google Dataform UI will complain about dataform.json

Screenshot 2024-08-08 at 8 33 25 AM

...an the CLI has this error about duplicate operation names

Screenshot 2024-08-08 at 8 34 21 AM

While obviously an issue with our code, this is a breaking change if using the ^ range specifier with semver.

Ekrekr commented 3 months ago

Fix is in 3.0.2, please update! Thanks.

https://github.com/dataform-co/dataform/releases/tag/3.0.2

stevenleggdfe commented 3 months ago

@Ekrekr fix works for me. Thank you for the speedy turnaround!

cwashcraft commented 3 months ago

Fix is in 3.0.2, please update! Thanks.

https://github.com/dataform-co/dataform/releases/tag/3.0.2

@Ekrekr unfortunately the issue I mentioned is persisting with 3.0.2, although the error shown in the Google UI is different now

Screenshot 2024-08-08 at 11 34 34 AM Screenshot 2024-08-08 at 11 34 47 AM
Ekrekr commented 3 months ago

This is a different issue - have moved to a separate issue tracker https://github.com/dataform-co/dataform/issues/1803.