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

Fix build and make join table sort stable by using DFS #13634

Merged
merged 27 commits into from Dec 3, 2018
Merged

Conversation

diosmosis
Copy link
Member

Changes:

  • Fix original format tests that fail on mysqli due to it returning ints by casting Site properties to int.
  • Make sure table sort in join tables is stable by using DFS instead of weighting tables. Join dependencies are parsed/assumed and dependent table/table-aliases get ordered first.
  • Couple other minor test fixes.

@diosmosis diosmosis added the Needs Review PRs that need a code review label Oct 21, 2018
@diosmosis diosmosis added this to the 3.7.0 milestone Oct 21, 2018
@diosmosis
Copy link
Member Author

Refs #13025

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

Code changes look good to me and tests seem to pass. Would maybe be good if @tsteur would have another look

@sgiehl sgiehl requested a review from tsteur November 11, 2018 17:55
// log_link_visit_action, log_action, log_visit, log_conversion, log_conversion_item
// which means if an array is supplied where log_visit comes before log_link_visitAction, it will
// be moved to after it.
static $implicitTableDependencies = [
Copy link
Member

Choose a reason for hiding this comment

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

is that needed to be static?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, it's just a constant. I can remove the static modifier.

@tsteur
Copy link
Member

tsteur commented Nov 12, 2018

It's a complex PR/topic and don't understand all the code / hard to review so focused on looking at tests. Ran the system tests for most premium features and they seem to pass. Also checked custom reports generates similar queries that still work (some SQLs changed but are still valid). As nothing seems to break I reckon it's good to merge (in 3.8).

@diosmosis
Copy link
Member Author

I'll also go through the code and try to make it more expressive.

@diosmosis
Copy link
Member Author

Tried to make the code a bit clearer.

core/Site.php Outdated

// for serialized format to be predictable across php/mysql/pdo/mysqli versions, make sure the int props stay ints
foreach ($this->site as $key => $value) {
if (is_numeric($value)) {
Copy link
Member

Choose a reason for hiding this comment

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

what about floats etc? It'd be actually better to really specify the properties that should be converted (like we do in other plugins) and not something generic

Copy link
Member Author

Choose a reason for hiding this comment

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

changed

@tsteur
Copy link
Member

tsteur commented Nov 25, 2018

fyi we will need to test this with all premium features again, and especially custom reports to make sure the generated queries are still correct.

@tsteur
Copy link
Member

tsteur commented Dec 3, 2018

ran the custom reports tests @diosmosis and looks all good 👍

@diosmosis diosmosis merged commit ed87785 into 3.x-dev Dec 3, 2018
@diosmosis diosmosis deleted the fix-build2 branch December 3, 2018 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants