-
Notifications
You must be signed in to change notification settings - Fork 45
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
Enable RO proposal in case of error #483
Conversation
@read_only_proposals[:hard] << name | ||
when "soft" | ||
@read_only_proposals[:soft] << name | ||
end |
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.
The else
branch is missing, it should at least log the unknown value. It would be better to put it in one of the list otherwise it will be completely lost. Probably the :soft
is a good default as it allows user to fix a possible issue without locking him out.
def read_only?(client) | ||
read_only_proposals.include?(client) | ||
# @return [Boolean] if the client is marked as "hard" read only | ||
def read_only_no_recovery?(client) |
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 think hard_read_only?
and soft_read_only?
names would sound better and better match the description.
Mon Dec 19 13:23:12 UTC 2016 - mfilka@suse.com | ||
|
||
- Made user's interaction possible in case of error in read-only | ||
proposal. |
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.
Add a FATE reference.
This only makes sense when other pieces of the puzzle are present, but there are no references to them
|
# | ||
# @param [String] client | ||
# @return [Boolean] if the client is marked as "hard" read only | ||
def read_only_no_recovery?(client) |
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 think hard_read_only?
and soft_read_only?
names would sound better and better match the description.
In particular, I am missing the logic that says: "an error has in fact occurred so let's make a read-only part modifiable now". |
|
||
case proposal["read_only"] | ||
when "hard" | ||
@read_only_proposals[:hard] << name |
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.
There is an inconsistency with the PR description, it lists <read_only>soft</read_only>
config option (which is a string), here in the code is :hard
symbol.
Either change the code to "hard"
or change the configuration to <read_only config:type="symbol">soft</read_only>
.
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.
No, it's OK. The condition uses a string.
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.
Oh, I overlooked that, OK...
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.
Please add new unit tests and adjust the existing tests (they use the old boolean value), see https://github.com/yast/yast-installation/blob/SLE-12-SP2-CASP/test/proposal_store_test.rb#L566
@@ -807,7 +807,7 @@ def html_header(submod) | |||
title = @store.title_for(submod) | |||
|
|||
# do not add a link if the module is read-only or link is already included | |||
heading = if @store.read_only?(submod) || title.include?("<a") | |||
heading = if @store.hard_read_only?(submod) || title.include?("<a") |
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.
It seems it does not handle the soft read only case correctly. For soft RO the proposal should be RO, RW only when there is an error. The error state for the soft case is not handled at all here.
There is no need to adjust old testsuite. |
I see, then please add new test for the added functionality. And Travis fails because of |
OK, this looks better, thanks! |
expect_any_instance_of(::Installation::ProposalRunner) | ||
.to receive(:submod_descriptions_and_build_menu) | ||
.and_return(false) | ||
expect_any_instance_of(::Installation::ProposalStore) |
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.
The test is OK, but as you mock most (all?) of the ::Installation::ProposalStore
functionality it would be nice to add also some tests to https://github.com/mchf/yast-installation/blob/ae795f1094d361c5db76aace03776951e6923323/test/proposal_store_test.rb#L566, esp. for the soft RO case. TIA!
Almost there... 😉 Please add also a test with soft RO and an error state. (Check that the header is clickable and the client can be called.) |
Related PR: yast/yast-installation-control#33 |
Related PR: yast/skelcd-control-CAASP#16 |
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
} | ||
|
||
it "makes a proposal" do | ||
allow(subject) |
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.
NP: I'd a comment here that this is needed to allow the other calls than the one expect
ed later, otherwise it looks a bit confusing...
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.
Sorry, Travis fails... (A Rubocop issue + 1 test failure)
ok, I'll wait for #485, rebase and then we will see. |
Changes Unknown when pulling 7351a47 on mchf:ro_sw into ** on yast:SLE-12-SP2-CASP**. |
Please remove the last commit ( |
@lslezak thanks, last commit removed. However the build this time failed in jenkins (seems like an accessibility issue) |
We can ignore the Jenkins failure, it tries to build against CASP in IBS which cannot work from the public Jenkins. Moreover after switching to Docker at Travis we do not this Jenkins job anymore |
Thanks for reviews |
https://trello.com/c/sEVjWKcJ/780-3-casp-read-only-software-selection
Proposals in control file currently have format:
this PR changes this to