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

update my fork.. #1

Merged
merged 346 commits into from
Apr 12, 2016
Merged

Conversation

bpothier
Copy link
Owner

update my fork..

infrastation and others added 30 commits January 8, 2016 22:22
* renderPortsForObject()
* renderNATv4ForObject()
* renderSNMPPortFinder()
Throw an exception on invalid argument as that is a plain error
condition. Don't explain the point already discussed in the code style
guide. Rename a variable for clarity.
To omit $level from the list of arguments at the top level, give it a
default value and move it to the end of the argument list like it is
done in similar recursive functions. Update getLocationSelectAJAX() and
renderLocationSelectTree() respectively.
Accept SELECT name as an argument to keep both tags of the element in
the same function. Update renderRackspaceLocationEditor() and
renderRackspaceRowEditor() respectively.
The function has not been in use since release 0.20.0.
* renderTagRowForViewer()
* renderTagRowForEditor()
(as recommended in the code guide)

* updateObjectAllocation()
* groupTriplets()
* treeFromList()
Commit 3a94b7a made it unnecessary to call treeFromList() to have the
'trace' key calculated for $taglist elements, though the trace
calculation code it introduced into getTagList() had no graph cycles
detection and would OOM on inconsistent input. That change made the
pre-existing similar code in treeFromList(), which did have such
detection, effectively useless and doing duplicate work.

Another issue was, the database consistency report used its own
procedure to detect the same anomalies using a series of SELECTs and
an exception.

This change leaves only the exact original version of the procedure in
the code, now as a standalone function, and amends associated code to
interface with it properly.

* class GetChildrenListTest
  * setUpBeforeClass(): amend to re-process the modified data
  * testGetTagChildrenList(): use the in-memory function
* class TagTreeCircularReferenceTest
  * testCreateCircularReference(): use a more specific exception class
* getTagSelectAJAX(): ignore any odd tags to suppress a PHP warning
* getTagChildrenList(): mark as deprecated
* getTagList(): return the original data only and allow for extra SQL
* commitUpdateTag(): use a transaction, let a dedicated function verify
  consistency and add some comments
* addTraceToNodes(): a new function with the code from treeFromList()
* treeFromList(): do exactly one job: don't trace the nodes and always
  return the forest structure; update comments
* getOrphanedTags(): filtering is now simpler and can be done in place
* assertValidParentId(): new constraint validation function based on the
  checks previously performed in commitUpdateTag()
* getTagDescendents(): skip odd nodes
* init.php: call addTraceToNodes() explicitly
* renderTagTreeEditor(): use the same terminology as in the report
* renderDataIntegrityReport(): use getOrphanedTags()
* updateTag(): add exception conversion and repack more uniformly
usePreparedDeleteBlade() and usePreparedUpdateBlade() would fail the
query when given an empty WHERE (SET) column list, though as late as
when attempting to execute the query. Assert the requirement right in
the functions and provide a relevant error message. Add a unit test
for this behaviour.
Make these functions use addTraceToNodes() before treeFromList() as the
latter doesn't imply the former anymore:

* getLocationSelectAJAX()
* makeIPTree()
* renderLocationFilterPortlet()
* renderLocationSelectTree()
* renderRackspaceLocationEditor()
Amend nullEmptyStr() to test against an empty string as that's what it
is interested in. Replace a number of equivalent constructs with a call
to nullEmptyStr() in the following functions:

* commitAddObject()
* commitRenameObject()
* commitUpdateObject()
* commitUpdatePort()
* commitUpdatePortComment()
* linkPorts()
* commitUpdatePortLink()
* addVService()
* addRStoRSPool()
* addLBtoRSPool()
* commitUpdateRS()
* commitUpdateVS()
* commitCreateRSPool()
* getSelectOptions(): new function with the code from getSelect()
* getSelect(): use getSelectOptions()
* getTagSelectAJAX(): use getSelectOptions()
* getVSTOptions(): simplify as it doesn't have to call stringForOption()
  anymore
Some of the code that used to be in renderEditAttrMapForm() doesn't
quite belong there and can be reused elsewhere. Switch to getSelect()
while at it.
The method is assertEquals ($expected, $actual), the other way around
it would generate a misleading message on mismatch.
* navigation: replace "get-tag-select" with "get-parent-node-options"
* renderTagRowForEditor(): rename AJAX request parameters
* renderTagTreeEditor(): idem
* getTagSelectAJAX(): replace with the two new generic functions below
* getParentNodeOptions(): new function to produce the list of options
* getParentNodeOptionsAJAX(): new function to interface with AJAX
  clients (with the existing "node_type=tag" case now using a security
  context)
Do not traverse entire node list multiple times.

This change reduces the function runtime in my environment from 6ms to
1ms.
Recognize the two different use cases: one where parent node filtering
is done for an existing node in a forest of rooted trees and another
when it is done for a potential new node or a node that is currently
based on a circular reference.

* getParentNodeOptionsNew(): new function
* getParentNodeOptions(): rename to getParentNodeOptionsExisting()
* getParentNodeOptionsAJAX(): amend the AJAX request format and handling
  respectively
* renderTagTreeEditor(): make use of those changes and extend the
  "circular references" block to suggest the parent node options that
  link the nodes back into the valid structure
infrastation and others added 28 commits March 18, 2016 17:46
Assign $self at top and dismiss a variable.
This change prevents unexpected side effects, that, for instance, used
to require two workarounds in iptree_markup_collapsion() and one in
transformRequestData(). The root cause of the problem is that "and" and
"or" are standalone operators: though their associativity is the same as
that of "&&" and "||", the order of precedence is not just different but
is lower than that of "=". The code style article now explains this.

* syncdomain.php
* getNetUsageAJAX()
* authenticate()
* permitted()
* gotClearanceForTagChain()
* authenticated_via_ldap()
* queryLDAPServer()
* RackCodeParser::accept()
* RackCodeParser::un_expr()
* checkAutotagName()
* findCtxModWarnings()
* listCells()
* fillNetKids()
* amplifyCell()
* commitLinkEntities()
* commitUpdateEntityLink()
* updateAddress()
* generateEntityAutoTags()
* createIPv4Prefix()
* newPortForwarding()
* getDomainVLANs()
* getDomainVLANList()
* upd8021QPort()
* setConfigVar()
* setUserConfigVar()
* xos12ReadLLDPStatus()
* xos12ReadInterfaceStatus()
* vrpReadLLDPStatus()
* ftos8ReadLLDPStatus()
* eos4ReadLLDPStatus()
* ros11ReadLLDPStatus()
* jun10TranslatePushQueue()
* jun10Read8021QConfig()
* ftos8ReadInterfaceStatus()
* eos4ReadInterfaceStatus()
* ucsReadInventory()
* isInnoDBSupported()
* platform_is_ok()
* stringTrace()
* assertUIntArg()
* assertStringArg()
* assertBoolArg()
* genericAssertion()
* rectHeight()
* highlightObject()
* ip4_mask()
* ip6_mask()
* l2addressForDatabase()
* sortTokenize()
* pokeNode()
* peekNode()
* addTraceToNodes()
* redirectIfNecessary()
* getObjectiveTagTree()
* getCellFilter()
* IPNetworkCmp()
* iptree_fill()
* ip_next()
* ip_prev()
* treeApplyFunc()
* getTerminalNetworks()
* iptree_markup_collapsion()
* getPortListPrefs()
* getUnlinkedPortTypeOptions()
* groupIntsToRanges()
* array_values_same()
* buildVLANFilter()
* matchVLANFilter()
* generate8021QDeployOps()
* filter8021QChangeRequests()
* getEmployedVlans()
* get8021QSyncOptions()
* exec8021QDeploy()
* saveDownlinksReverb()
* initiateUplinksReverb()
* recalc8021QPorts()
* authorize8021QChangeRequests()
* compareDecomposedPortNames()
* searchEntitiesByText()
* buildSearchRedirectURL()
* setMessage()
* isEthernetPort()
* getConfigVar()
* getObjectTypeChangeOptions()
* apply8021qChangeRequest()
* fillIPNetsCorrelation()
* fillIPSpareListBstr()
* isIPNetworkEmpty()
* listConstraint()
* checkTypeAndAttribute()
* init.php
* install.php
* not_already_installed()
* init_config()
* get_process_owner()
* check_config_access()
* init_database_dynamic()
* render8021QOrderForm()
* renderVLANDomainListEditor()
* renderVLANDomainVLANList()
* renderObject8021QPorts()
* getAccessPortControlCode()
* renderTrunkPortControls()
* renderVLANInfo()
* renderObject8021QSync()
* renderObject8021QSyncPreview()
* renderConfigMainpage()
* renderTagRowForEditor()
* printNiftySelect()
* transformRequestData()
* getRenderedIPv4NetCapacity()
* serializeTags()
* printTagTRs()
* renderEntitySummary()
* niftyString()
* showLogoutURL()
* renderRackspace()
* renderRow()
* printObjectDetailsForRenderRack()
* renderEditRackForm()
* renderObject()
* showMessageOrError()
* renderRackSpaceForObject()
* renderIPSpaceRecords()
* renderIPSpace()
* renderIPNetwork()
* renderIPAddress()
* renderIPAddressProperties()
* renderNATv4ForObject()
* renderLocationPage()
* renderEditLocationForm()
* renderLivePTR()
* buildTagCheckboxRows()
* renderCellFilterPortlet()
* renderFile()
* renderFilesPortlet()
* printIPNetInfoTDs()
* renderCell()
* getFilePreviewCode()
* renderDiscoveredNeighbors()
* switchportInfoJS()
* addIPAllocation()
* processGridForm()
* updateObjectAttributes()
* addLotOfObjects()
* save8021QPorts()
* updVSTRule()
* importDPData()
* cleanupUCS()
* getOpspec()
* buildOpspecColumns()
* findSparePorts()
* handlePopupPortLink()
* detectDeviceBreed()
* prepareRealServersTable()
* SLBTriplet::getTriplets()
* MacroParser::addMacro()
* addRStoRSPool()
* commitUpdateRS()
* doSwitchSNMPmining()
* createTrueColorOrThrow()
* renderProgressBar4Image()
* renderImagePreview()
* proxyStaticURI()
* trigger_liveports()
* trigger_object_8021qorder()
* trigger_8021q_configured()
* trigger_anyDP()
* triggerCactiGraphs()
* triggerMuninGraphs()
* getDBUpgradePath()
* renderUpgraderHTML()
* index.php
To test for an empty string it does not require a function.

* updateIPNameAJAX()
* commitAddPort()
* commitUpdatePort()
* getConfiguredQuickLinks()
* formatPortLink()
Since get_pseudo_file() was switched to return an array instead of plain
text there should normally be no empty elements in the array. But if
there is a bug, don't hide it and just let PDO fail the normal way.
Use count() to clarify the argument is an array.

* renderVLANInfo()
* formatVLANPackDiff()
* renderIPForObject()
This reverts commit 27ed118.
Those functions are IPv6-aware.
* addJS()
* getOpLink()
* getPopupLink()
* renderRackMultiSelect()
* renderIPv4NetworkAddresses()
* renderSNMPPortFinder()
* showPathAndSearch()
Also update usePreparedUpdateBlade() and add some tests.
* getPortInfo()
* ftos8ReadInterfaceStatus()
* eos4ReadInterfaceStatus()
* jun10TranslatePushQueue()
* ftos8TranslatePushQueue()
* generate8021QDeployOps()
* makeIPTree()
* renderPortsInfo()
* renderPopupPortSelector()
@bpothier bpothier self-assigned this Apr 12, 2016
@bpothier bpothier merged commit 1347304 into bpothier:maintenance-0.20.x Apr 12, 2016
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.

7 participants