Skip to content

Overlapping roots are not always detected #18

Open
@dev-rice

Description

@dev-rice

I made some bundles (test_bundles.tar.gz) for debugging purposes, and found that the detection for overlapping roots isn't working as expected. Here's the layout:

$ tree -a .
├── main_root_0
│   ├── .manifest
│   └── main
│       └── data.json
├── main_root_1
│   ├── .manifest
│   └── main
│       └── data.json
└── other_root
    ├── .manifest
    └── other
        └── data.json

And the manifests for main_root_0 and main_root_1 have "roots":["main"], and other_root has "roots":["other"].

With the opa CLI, trying to load and evaluate the two overlapping bundles gives an error:

$ opa eval \
    -b main_root_0 \
    -b main_root_1 \
    -b other_root \
    data
{
  "errors": [
    {
      "message": "detected overlapping roots in bundle manifest with: [main_root_0 main_root_1]"
    }
  ]
}

However, with the Swift version, these bundles are able to be loaded into the engine. There is a failure, but it's just because the bundles don't have any IR plans but it should have failed before that, while checking for overlaps:

$ swift run swift-opa-cli eval \
    -b main_root_0 \
    -b main_root_1 \
    -b other_root \
    data
Error: RegoError(code: Rego.RegoError.Code(internalCode: Rego.RegoError.Code.InternalCode.unknownQuery), message: "query not found in plan: data", cause: nil)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions