Skip to content

Conversation

@acwhite211
Copy link
Member

@acwhite211 acwhite211 commented Jan 20, 2026

Fixes #7662

Fixes the various failing unit tests currently in main. The two groups the unit tests that are fixed in this PR are the tree synonymy and locality update tests.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list

Testing instructions

  • See that all the unit tests are passing in the GitHub Actions.
image

@github-project-automation github-project-automation bot moved this to 📋Back Log in General Tester Board Jan 20, 2026
@acwhite211 acwhite211 marked this pull request as ready for review January 20, 2026 16:58
@acwhite211 acwhite211 requested review from a team January 20, 2026 16:58
@acwhite211 acwhite211 added this to the 7.12.0 milestone Jan 23, 2026
Copy link
Contributor

@melton-jason melton-jason left a comment

Choose a reason for hiding this comment

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

I fixed a bug where the backend was completely ignoring the value of the sp7.allow_adding_child_to_synonymized_parent preferences.

The problem is that we were using a regular expression to fetch the value of the Remote Preference (now Collection Preference) prior to 61cc51b (introduced in #7557), and when we transitioned to a JSON dictionary approach to storing the preference, the regular expression was used as the key in the backend to fetch the preference value-- where it should have been using the string literal.

Below is the code from v7.11.3:

pattern = r'^sp7\.allow_adding_child_to_synonymized_parent\.' + node.specify_model.name + '=(.+)'
override = re.search(pattern, get_remote_prefs(), re.MULTILINE)

Below is the code in main:

synonymized = treeManagement_pref.get('synonymized', {}) \
if isinstance(treeManagement_pref, dict) else {}
add_synonym_enabled = synonymized.get(r'^sp7\.allow_adding_child_to_synonymized_parent\.' + node.specify_model.name + '=(.+)', False) if isinstance(synonymized, dict) else False

We should be using the literal sp7.allow_adding_child_to_synonymized_parent.TREE string rather than the regular expression as the key.

This fix also simplified some of the other changes in this PR, so feel free to give it a once over @acwhite211!

I'm not going to explicitly approve this PR due to the changes I've made (those should probably be reviewed first), but I'll be down to merge once the additional changes are reviewed further!

melton-jason added a commit that referenced this pull request Feb 3, 2026
These will be addressed in #7663
Copy link
Contributor

@melton-jason melton-jason left a comment

Choose a reason for hiding this comment

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

Love the new helper functions for reading preferences! 🥳

@github-project-automation github-project-automation bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Feb 6, 2026
@acwhite211
Copy link
Member Author

There's a front-end issue in main causing lots of failures in the front-end unit testing. It has to do with ajax mocking. I've been looking into a solution, but nothing working yet.

@acwhite211
Copy link
Member Author

I simplified the tree management structure and synonymy changes as to avoid putting too much complexity into this PR. The scope of this PR was starting to get too far away from fixing unit tests related to trees, so these changes are now better scoped to this PR. We can look into doing more structural changes to the tree management data in a future issue.

I was able to fix the failing front-end unit tests related to ajax mocking by making adjustments in the ajax utils index.js file.

@melton-jason ready for re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Dev Attention Needed

Development

Successfully merging this pull request may close these issues.

Fix Failing Unit Tests

3 participants