store: Improve conflicting root error message#7808
Merged
charlieegan3 merged 1 commit intoopen-policy-agent:mainfrom Jul 31, 2025
Merged
store: Improve conflicting root error message#7808charlieegan3 merged 1 commit intoopen-policy-agent:mainfrom
charlieegan3 merged 1 commit intoopen-policy-agent:mainfrom
Conversation
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
srenatus
approved these changes
Jul 31, 2025
| return fmt.Errorf("detected overlapping roots in bundle manifest with: %s", bundleNames) | ||
|
|
||
| if len(bundlesWithEmptyRoots) > 0 { | ||
| return fmt.Errorf("bundles %s have overlapping roots and cannot be activated simultaneously because bundles %s specify empty root paths ('') which overlap with any other bundle root", strings.Join(bundleNames, ", "), strings.Join(bundlesWithEmptyRoots, ", ")) |
Contributor
There was a problem hiding this comment.
"...bundles %s specify..." 🤔 OK this is 100% pedantry, but let's do a compromise:
Suggested change
| return fmt.Errorf("bundles %s have overlapping roots and cannot be activated simultaneously because bundles %s specify empty root paths ('') which overlap with any other bundle root", strings.Join(bundleNames, ", "), strings.Join(bundlesWithEmptyRoots, ", ")) | |
| return fmt.Errorf("bundles %s have overlapping roots and cannot be activated simultaneously because bundle(s) %s specify empty root paths ('') which overlap with any other bundle root", strings.Join(bundleNames, ", "), strings.Join(bundlesWithEmptyRoots, ", ")) |
Contributor
Author
There was a problem hiding this comment.
I had the same thought, I am making some minor updates to the messages!
Contributor
Author
There was a problem hiding this comment.
Ok, Changed it to:
{
"errors": [
{
"message": "detected overlapping roots in bundle manifest with: [b2.tar.gz b1.tar.gz]"
}
]
}
{
"errors": [
{
"message": "bundles [b1.tar.gz, b2.tar.gz] have overlapping roots and cannot be activated simultaneously because bundle(s) [b1.tar.gz] specify empty root paths ('') which overlap with any other bundle root"
}
]
}
Along with some other edits.
charlieegan3
commented
Jul 31, 2025
| expectedError: "detected overlapping roots manifests for these bundles: [bundle1, bundle2, bundle3]", | ||
| }, | ||
| { | ||
| note: "overlap with empty root bundle - bundle without manifest", |
Contributor
Author
There was a problem hiding this comment.
Let me see if I can get this to show the longer message too.
f0b1520 to
5ae49ca
Compare
Contributor
Author
|
Thanks Stephan! added some fixes to the tests in https://github.com/open-policy-agent/opa/pull/7808/files#diff-2923c292692c11e167d80502ff31fb2c991c92cec3ae3686e1acf756fc02e7d4, but will merge when all passing |
Fixes open-policy-agent#7806 ``` { "errors": [ { "message": "detected overlapping roots in bundle manifest with: [b2.tar.gz b1.tar.gz]" } ] } { "errors": [ { "message": "bundles [b1.tar.gz, b2.tar.gz] have overlapping roots and cannot be activated simultaneously because bundle(s) [b1.tar.gz] specify empty root paths ('') which overlap with any other bundle root" } ] } ``` Signed-off-by: Charlie Egan <charlie@styra.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7806