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

Improve Import Error Message When Failure Originates from a Transitive Import #1653

Open
bmarcaur opened this issue Oct 9, 2024 · 0 comments

Comments

@bmarcaur
Copy link
Member

bmarcaur commented Oct 9, 2024

From an internal slack discussion:

> Task :module-api:rawIr FAILED
Encountered error trying to parse file '/Volumes/git/repo/module-api/build/conjure/Service.yml'
Import not found for namespace: Namespace{name=othernamespace}

the actual import failure was while parsing a file imported by Service.yml, not in Service.yml itself (but it was particularly confusing because othernamespace was imported into Service.yml as well).

Here is a simple example of the issue:

# Service.yaml
types:
  conjure-imports:
    othernamespace: ./other-import.yml
    transitive: ./transitive-import.yml
  definitions:
    objects:
      OtherThing: othernamespace.thing
      TransitiveThing: transitive.thing
# transitive-import.yml
types:
  # intentionally empty for example, but should have:
  # othernamespace: ./other-import.yml
  conjure-imports: []
  definitions:
    objects:
      # references a namespace that is not declared, but is declared in the parent
      OtherThing: othernamespace.thing

The error message should more accurately reflect the enclosing file that failed to import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant