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

annotations: package level scope should carry over across files #5251

Closed
anderseknert opened this issue Oct 14, 2022 · 0 comments · Fixed by #5627
Closed

annotations: package level scope should carry over across files #5251

anderseknert opened this issue Oct 14, 2022 · 0 comments · Fixed by #5627
Assignees
Labels

Comments

@anderseknert
Copy link
Member

policy1.rego

# METADATA
# scope: package
# description: this is the policy.foo package!
package policy.foo

policy2.rego

package policy.foo

baz := rego.metadata.chain()
❯ opa eval -f pretty -d . data.policy.foo
{
  "baz": [
    {
      "path": [
        "policy",
        "foo",
        "baz"
      ]
    }
  ]
}

Expected Behavior

The package level annotation provided in policy1.rego should be picked up by rego.metadata.chain() in policy2.rego

Actual Behavior

It doesn't.

Other Notes

The subpackages scope does work as expected here.

johanfylling added a commit to johanfylling/opa that referenced this issue Feb 3, 2023
Fixes: open-policy-agent#5251

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
johanfylling added a commit that referenced this issue Feb 16, 2023
Fixes: #5251

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants