-
Notifications
You must be signed in to change notification settings - Fork 46
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
version 100: first pass #2332
version 100: first pass #2332
Conversation
normandy/recipes/filters.py
Outdated
smallest_version = versions[0] | ||
largest_version = versions[-1] | ||
|
||
# check whether versions are continuous |
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.
One little thing: this comment talks about checking if the range is contiguous, but then the if statement and the 'then'-block are the non-contiguous case. It works fine, but I think it would read better in the other order (or if the comment was changed to talk about non-contiguous).
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.
Your commit messages and PR title just say "first pass". Do you have other work you're expecting to add here? It would be good to add some details that describe the change being made, at least to the commit messages. (amend and force push would be fine).
[ | ||
f'(env.version|versionCompare("{smallest_version}.!")>=0)', | ||
f'(env.version|versionCompare("{largest_version}.*")<0)', | ||
] | ||
) | ||
|
||
def get_capabilities(self): |
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.
This will need the capability for the versionCompare
filter to be declared.
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.
i took a peek at VersionRange and it had jexl.context.env.version
for capabilities too, I would assume, Versions would need it as well?
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.
Yeah, this seems right. I'm not sure why it wasn't here before.
@mythmon eek, I assumed that I would've missed something considering this is my first time working on filters, therefore the initial commit was a "first pass" or "first attempt". Will be adding the capabilities to the filter. |
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.
You'll need to mark the filter as using non-baseline capabilities so that test passes, but besides that I think this looks good.
bors r= @mythmon |
No description provided.