-
Notifications
You must be signed in to change notification settings - Fork 131
SAT-28731 - Do not assign taxonomies to filters #19899
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
Conversation
|
trigger: test-robottelo |
c289a4c to
163c364
Compare
|
trigger: test-robottelo |
|
PRT Result |
|
PRT Result |
163c364 to
869c123
Compare
|
trigger: test-robottelo |
|
PRT Result |
869c123 to
81071b7
Compare
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.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `tests/foreman/cli/test_filter.py:53` </location>
<code_context>
assert set(filter_['permissions'].split(", ")) == set(module_perms)
-def test_positive_create_with_org(module_perms, function_role, target_sat):
- """Create a filter and assign it some permissions.
-
</code_context>
<issue_to_address>
**suggestion (testing):** Test for creating a filter with organization assignment has been removed.
Consider adding a negative test to verify that the CLI correctly rejects organization assignments to filters, ensuring the new behavior is covered.
Suggested implementation:
```python
import pytest
```
```python
def test_negative_create_with_org(cli_runner, module_perms, function_role, target_sat):
"""
Negative test: Attempt to create a filter with organization assignment.
The CLI should reject this and return an error.
"""
org_id = "test-org"
filter_name = "test-filter-with-org"
permissions = ",".join(module_perms)
# Attempt to create filter with organization assignment
result = cli_runner.invoke(
[
"filter", "create",
"--name", filter_name,
"--permissions", permissions,
"--organization", org_id
]
)
# Assert that the CLI returns a non-zero exit code or error message
assert result.exit_code != 0
assert "organization assignment is not allowed" in result.output.lower()
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
trigger: test-robottelo |
|
PRT Result |
|
trigger: test-robottelo |
|
PRT Result |
|
The ui test failure is unrelated to the changes introduced here and is being fixed elsewhere |
| target_sat.api.HostCollection(server_config=cfg).create() | ||
|
|
||
|
|
||
| def test_negative_non_readonly_user_actions(target_sat, content_view, function_role, module_org): |
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.
@adamruzicka if you are removing the fixture use in the test body, there's no need to include it here, this way I think the function_role still gets created for no use. otoh you could consider creating a different fixture function_role_with_org for a bit of a code reuse. Not sure how much the function_role gets used outside the tests you are touching, if it doesn't, you could add the org in that fixture as well I suppose
81071b7 to
875ea1e
Compare
|
trigger: test-robottelo |
|
PRT Result |
A recent change in Foreman dropped the option to assign (and override) organizations and locations on filters as well as the unlimited and override fields from api responses.
875ea1e to
a98c1f5
Compare
|
trigger: test-robottelo |
|
PRT Result |
|
Guess theforeman/foreman#10717 hasn't landed in stream yet |
pnovotny
left a comment
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.
LGTM
|
The one failure in PRT in |
A recent change in Foreman dropped the option to assign (and override) organizations and locations on filters as well as the unlimited and override fields from api responses.
Problem Statement
Some tests use no-longer-available code paths, some tests don't make sense anymore.
Solution
Change the tests that make sense to the new way (aka orgs/locs on roles only), drop the ones that aren't relevant anymore.
Related Issues
https://issues.redhat.com/browse/SAT-28731
theforeman/foreman#10370
theforeman/hammer-cli-foreman#645
Requires SatelliteQE/nailgun#1363 and SatelliteQE/airgun#2141