Skip to content
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

Sync with stable/3.0 part of the rails app for apply_role improvements #18

Open
wants to merge 16 commits into
base: stable/sap/3.0
Choose a base branch
from

Conversation

vuntz
Copy link

@vuntz vuntz commented Mar 1, 2017

There were some logging improvements as well as changes to make the code more solid and deal better with exceptions when clicking on "apply".

@tpatzig with these fixes, the issue with lock files that are blocking chef-client from running on nodes will not be triggered anymore.

@vuntz vuntz requested review from tpatzig and rsalevsky March 1, 2017 08:51
@rsalevsky rsalevsky changed the base branch from staging to stable/sap/3.0 March 9, 2017 09:58
MaximilianMeister and others added 16 commits June 20, 2017 11:40
* log message is misleading when node list is empty
* like this it is easier to see where (on which node) chef-client failed

(cherry picked from commit a5707a8)
(cherry picked from commit e8e721b)
Rename variables, remove unneeded logs.

(cherry picked from commit d4ed8c5)
(cherry picked from commit f33f254)
(cherry picked from commit a130195)
(cherry picked from commit f0b83f3)
Don't be so complicated to build a list of nodes...

(cherry picked from commit 91741e5)
(cherry picked from commit fe8e131)
This includes removing log lines which duplicate data already in the
debug logs.

(cherry picked from commit 8774bb2)
(cherry picked from commit a0d6671)
There was an attempt to fix the internal API so that
ServiceObject.apply_role always returns [int, str], but this actually
breaks the UI-only path in the controller.

So revert this and document with a FIXME that this should eventually be
fixed by moving everything to [int, hash] where we will have more
freedom.

https://bugzilla.suse.com/show_bug.cgi?id=989958
(cherry picked from commit 1ad0664)
(cherry picked from commit ec17274)
We move some code that must always be run before returning in the global
ensure; this helps make sure that code is actually run in all cases.

(cherry picked from commit 7010dc7)
(cherry picked from commit 99d978f)
We catch all exceptions that aren't caught from this method to set the
status of the proposal to "failed", to avoid people being blocked by a
proposal staying forever in "applying".

This helps with https://bugzilla.suse.com/show_bug.cgi?id=840255

(cherry picked from commit 43bc948)
(cherry picked from commit 50ec9c0)
This change makes the code a little bit more readable.

(cherry picked from commit 627e75b)
(cherry picked from commit 2717af2)
We mark it as applied when committing, but then we never reset it to not
applied when we do a change and just save. That results in the code
assuming that the saved proposal is always the latest one.

(cherry picked from commit cefacf6)
(cherry picked from commit 09e3303)
Was part of crowbar#560

(cherry picked from commit 7d12ecb)
(cherry picked from commit 457222b)
In a few cases, we load a node just to look for some attribute that we
could have cached earlier. So let's just do that.

(cherry picked from commit 3374d9f)
(cherry picked from commit 890e720)
We want to have more arguments, and it's going to be confusing.

(cherry picked from commit 6d69e8a)
(cherry picked from commit b31bec1)
It's done once when saving, and another time when applying.

(cherry picked from commit 50e24e2)
(cherry picked from commit 936f2c3)
If the node already has the info, then no need to save, which is
expensive.

(cherry picked from commit 2013a47)
(cherry picked from commit 85cf951)
(cherry picked from commit 1442925)
(cherry picked from commit b6b44c3)
Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some files could not be reviewed due to errors:

.rubocop.yml: Style/AlignHash has the wrong namespace - should be Layout
.rubocop.yml: Style/AlignHash has the wrong namespace - should be Layout
.rubocop.yml: Style/AlignParameters has the wrong namespace - should be Layout
.rubocop.yml: Style/EmptyLinesAroundBlockBody has the wrong namespace - should be Layout
.rubocop.yml: Style/MultilineOperationIndentation has the wrong namespace - should be Layout
Error: obsolete parameter AlignWith (for Lint/EndAlignment) found in .rubocop.yml
AlignWith has been renamed to EnforcedStyleAlignWith

@logger.debug "batches: #{batches.inspect}"

# Cache attributes that are useful later on
pre_cached_nodes.each do |node_name, node|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add the line next if node.nil? here as well, to skip nodes, that no longer exists, but still referenced in chef.

Copy link

@matelakat matelakat Jun 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vuntz created #38 that contains the additional change, you can cherry pick the last commit from that PR. The commit is: b6b8882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants