-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix cached osrelease_info grain type #55796
Fix cached osrelease_info grain type #55796
Conversation
This seems to fix an effect, but not the root cause of the problem. Also, if it's a general mechanism that 'flattens' the tuples, are there other cases that needs to be fixed? |
I think it is, because we have the common func which process loaded cache. We can fix it in another way, but it seems to be more complex, because (if I understand problem correctly) it will require to change the store cache engine (from msgpack to something else).
I looked through |
Although it might not be the root cause of the problem, when performing an implicit operation that can have different semantics between sets, lists, or tuples, it's much safer to impose the type at the time of use rather than let the type pass through a callstack without knowing what else that type might taint. Nonetheless, I think it's a maybe good idea to assert the type during development, and impose the type w/ a warning during production to help reduce and track down these sorts of issues. That mis-typing symptom occurs in a few of my other bug reports (#54882 come to mind). Just my 2cents, and thanks for tracking this down to a caching issue. I literally thought I was crazy when I couldn't repro. |
@srg91 Thanks for the contribution. This change needs to be made against |
Thanks for noticing, I just followed the contribution docs. Could you tell, please, the best way to do this? Is it will be enough if I just force replace my branch and change this pull request or I should create the new one? |
55413cb
to
fc9d374
Compare
I've replaced commit with force push and switched destination branch to master, but forgot to update master before, sorry. I've updated branch to master with merge, but maybe I should do this with rebase? |
@srg91, not sure if you'll get a response from the maintainers as I asked questions similar to yours before and didn't get an answer to my questin for like a year. But yeah, once you change the branch compare for your PR to master, the commits are a lot cleaner w/ a rebase. For now though, just wait for the tests to complete before doing the rebase and I think you should be good. |
Before fix the module `loader._load_cached_grains` loaded `osrelease_info` grain as list. But everythere it expects `tuple`. Now we force `osrelease_info` type and it works as expected. Fixes saltstack#54908
9d24dea
to
2fc84f4
Compare
@arizvisa thanks for your comment. All checks are done instead one - |
@dwoz, if you guys make tags for prioritizing the PRs your community can likely help with some of the small or submitted ones. Maybe something simple like "PR low-priority", "PR high-priority", "PR medium-priority", etc. Like I didn't know that you guys were going through the huge process of phasing out the But again, I hope I'm not speaking out-of-turn for others, but please let us know if you guys need help with porting one of our PRs. Silence makes us contributors feel hopeless and also whiny. |
What does this PR do?
This pull-request fixes problems with operating on
osrelease_info
grain if it was loaded from cache. Now it loads correctly astuple
.What issues does this PR fix or reference?
I found the one: #54908
Previous Behavior
loader.py
loads grainosrelease_info
aslist
.It broke modules like
aptpkg.info_installed
and similar.New Behavior
Now
osrelease_info
loads as tupleTests written?
Yes,
unit.test_loader.LoaderLoadCachedGrainsTest
Commits signed with GPG?
No