-
Notifications
You must be signed in to change notification settings - Fork 348
Refactor-and-deprecation preview dumping ground #3845
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
Draft
nrwahl2
wants to merge
186
commits into
ClusterLabs:main
Choose a base branch
from
nrwahl2:nrwahl2-xml_refactors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+17,258
−14,341
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
02c3484
to
b36e366
Compare
Alright, I'm finally back to where I was last spring :) It took a lot of cleanup to get things to fit into the current main. And I took different approaches and made some other improvements in places. As I write this, all but two of the public API functions from xml.h are deprecated on this branch, and we're starting on formatted output for |
d480e04
to
cd819b7
Compare
b59102e
to
b6bf99c
Compare
To replace xml_accept_changes(). For now we basically mimic the logic in xml_accept_changes(), but perhaps we should be less aggressive or rename the function to reflect that it's clearing so many things. In particular, I'm not sure I like that this disables tracking, and I don't think I like that ACLs are so tightly coupled to change tracking (in many ways, not just here). Change tracking is required for ACLs but not vice-versa. Perhaps operations and flags should be kept a bit more... separate, though. Still, it's probably wise to throw away any unpacked ACLs when committing changes, as we're doing now and as we've been doing. ACLs themselves may have been added, modified, or removed as part of the changes. We want to get a current view of them before any further changes. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
And add doxygen. The doxygen is a bit hand-wavy for a few of them, because I don't yet understand everything they're doing. The wide spacing before the equal sign is to allow room to do a planned rename of pcmk__xf_lazy later, without having to change the other lines again. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
xml_calculate{,_significant}_changes() already takes care of this, provided the node's document doesn't have the pcmk__xf_tracking flag set yet. That is true here, since these are all new documents. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
In all of these cases, what we really care about is whether ACLs are enabled for the user in the original CIB (*current_cib). The differences come from the aliases (cib_ro and scratch) that we use for *current_cib, and whether scratch is a copy of *current_cib (in which case the return value of cib_acl_enabled() would be the same). Also add a couple of TODO comments. This is a very convoluted and confusing function and likely has some corner case bugs. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
If we simply assume that pcmk__xml_new_doc() returns non-NULL (as it currently must because it asserts on allocation error), then it's simple to make assert_comment() more self-contained. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
The only remaining uses were in cib_perform_op() and in the unit tests for pcmk__xc_create(). For cib_perform_op(), this introduces some duplication. We could functionize the duplicated code, but that entire function is a huge mess anyway, so I'm simply leaving it for now until we can revisit it as a whole. Note that pcmk__enable_acl() is equivalent to the three calls that xml_track_changes() was making. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace crm_notice() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
b6bf99c
to
c06f701
Compare
To replace crm_info() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
My understanding was that this was always Ken's intent, so I'm not sure why it hasn't been consistently done. Everything still builds and test-headers.sh still passes. The only ones I excluded were the xml_X_internal.h and xpath_internal.h files. xml_internal.h is meant to be a wrapper for all of those. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
And add new includes to files that broke as a result. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace crm_debug() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace LOG_STDOUT. We can't even deprecate LOG_STDOUT until the public macros that use it are deprecated. The goal here is to get internal constants for LOG_STDOUT, LOG_NEVER, and ultimately LOG_TRACE. The prefix will be rather cumbersome for PCMK__LOG_TRACE. However, I want to make it clear that these log levels are custom extensions and are not broadly supported symbols. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace LOG_NEVER. We can't even deprecate LOG_NEVER until the public macros that use it are deprecated. The goal here is to get internal constants for LOG_STDOUT, LOG_NEVER, and ultimately LOG_TRACE. The prefix will be rather cumbersome for PCMK__LOG_TRACE. However, I want to make it clear that these log levels are custom extensions and are not broadly supported symbols. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Just came to mind Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace LOG_TRACE. We can't even deprecate LOG_NEVER until the public macros that use it are deprecated. The goal here is to get internal constants for LOG_STDOUT, LOG_NEVER, and LOG_TRACE. I want to make it clear that these log levels are custom extensions and are not broadly supported symbols. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace crm_trace() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
746daf6
to
f026af7
Compare
To replace crm_log_xml_err() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace crm_log_xml_warn() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace crm_log_xml_notice() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace crm_log_xml_info() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace crm_log_xml_debug() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace crm_log_xml_trace() Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Pacemaker should not be used for general-purpose logging. Ref T622 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a place to view the commits that are next in line from whatever PR I have currently active, for anyone curious.