-
Notifications
You must be signed in to change notification settings - Fork 199
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
feat: filter proposals by plugins
and strategies
#705
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #705 +/- ##
=========================================
- Coverage 2.41% 2.39% -0.02%
=========================================
Files 39 39
Lines 2032 2042 +10
Branches 37 37
=========================================
Hits 49 49
- Misses 1946 1956 +10
Partials 37 37
☔ View full report in Codecov by Sentry. |
plugins
and strategies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer to #704 (comment)
The following query query Proposals {
proposals(first: 10, where: {strategies_in: ["poap"]}) {
strategies {
name
}
}
} Does return proposals that partial match: {
"data": {
"proposals": [
{
"strategies": [
{
"name": "poap"
},
{
"name": "whitelist"
}
]
},
{
"strategies": [
{
"name": "poap"
},
{
"name": "whitelist"
}
]
},
{
"strategies": [
{
"name": "poap"
},
{
"name": "ticket"
}
]
},
{
"strategies": [
{
"name": "erc20-balance-of"
},
{
"name": "whitelist"
},
{
"name": "poap"
}
]
},
{
"strategies": [
{
"name": "whitelist"
},
{
"name": "erc20-balance-of"
},
{
"name": "poap"
}
]
},
{
"strategies": [
{
"name": "whitelist"
},
{
"name": "erc20-balance-of"
},
{
"name": "poap"
}
]
},
{
"strategies": [
{
"name": "poap"
},
{
"name": "whitelist"
}
]
},
{
"strategies": [
{
"name": "poap"
},
{
"name": "whitelist"
}
]
},
{
"strategies": [
{
"name": "poap"
}
]
},
{
"strategies": [
{
"name": "poap"
}
]
}
]
}
} |
This PR introduces a more robust proposal filtering by strategy and plugin name.
New filter
The current existing
plugins_contains
andstrategies_contains
are just basic string search, and will return false result.The new introduced
strategies_in
andplugins_in
filter will searc the JSON field by key name and value, and will only return exact matches, allowing queries such as:For better performance, adding an index to the JSON objects is recommended:
Fixing existing filter
The existing
validation
filter is using basic string search. It has been updated for a more robust search by JSON value.Proposed index: