Skip to content

Conversation

@sharadsw
Copy link
Contributor

@sharadsw sharadsw commented Apr 30, 2025

Closes #6463
Closes #6459
Closes #6464

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 relevant documentation (Tester - Dev)
  • Add automated tests
  • Add a reverse migration if a migration is present in the PR

Testing instructions

  • Use the shellmuseum20250210 db on version 7.10.0 and the hotfix-7.10.2 branch

  • Run the query 'Specimen Label'

  • Verify the results for the Geography columns are the same on both branches

  • Click on Reports > Specimen Label > Problem Nos

  • Verify results are the same on both branches

  • Use the os_2025_04_30_09_33_44_fix db on both versions

  • Click Reports > OSU Small Label > 1506

  • Verify results are the same on both versions

General test queries:

  • Run queries containing columns for <rank> -> fullName in 7.10.0 and the hotfix-7.10.2 branch
  • Verify results are the same in both branches
  • Edit some rank names to include spaces in the ranks and re-run the queries
  • Verify results are the same in both branches

Test for catalog number cast:

  • Use a database which has Collection -> catalogNumFormatName as CatalogNumberNumeric and ALL CollectionObjectType -> catalogNumberFormatName as CatalogNumberNumeric
  • Run a Report or Label which uses CollectionObject -> catalogNumber and ensure not all catalogNumbers of CollectionObjects occupy all nine digits of the formatter (i.e., make sure catalogNumbers on the report are < 100000000)
  • Ensure the leading zeroes are trimmed for the catalogNumbers in the Report or Label output

sharadsw added 2 commits May 1, 2025 10:36
- Also adds a unit test to ensure this doesn't break again
@sharadsw sharadsw requested a review from a team May 1, 2025 18:00
@sharadsw sharadsw marked this pull request as ready for review May 1, 2025 18:32
@sharadsw sharadsw requested a review from a team May 1, 2025 18:49
…eric

Fixes #6464
See related #5485 and #6245

This handles the most common case.
In the case where there exists both numeric and non-numeric formats for
catalogNumber, the numeric formats will still be cast as a string.
This also ONLY works with formats called CatalogNumberNumeric;
i.e., any other purely numeric format will not be considered as numeric
by the QueryBuilder
@sharadsw sharadsw changed the title Hotfixes: Fullname query hotfixes for 7.10.2 Hotfixes: Fullname query hotfix + catalog number cast hotfix for 7.10.2 May 1, 2025
@sharadsw sharadsw removed the request for review from a team May 1, 2025 19:51
@melton-jason
Copy link
Contributor

melton-jason commented May 1, 2025

Hey everyone! I pushed a fix for #6464! 1e288bc (#6465)

The fix is very simple and not very flexible, but should apply in nearly all cases #6464 is happening.

Now, reports and labels which use CollectionObject -> catalogNumber (and more generally all queries using the Query Builder) will check the formats specified in Collection -> catalogNumFormatName and each of the Collection's Collection Object Types -> catalogNumberFormatName.
If all of the possible formats for CollectionObject -> catalogNumber are CatalogNumberNumeric, then Specify will force the catalogNumber column in the query to be numeric, rather than text.

I can edit the testing instructions to reflect the changes, but generally:

Testing Instructions

  • In a database which has Collection -> catalogNumFormatName= CatalogNumberNumeric and all CollectionObjectType -> catalogNumberFormatName = CatalogNumberNumeric
  • Run a Report or Label which uses CollectionObject -> catalogNumber and ensure not all catalogNumbers of CollectionObjects occupy all nine digits of the formatter (i.e., make sure catalogNumbers on the report are < 100000000)
  • Ensure the leading zeroes are trimmed for the catalogNumbers in the Report or Label output

@sharadsw sharadsw requested a review from a team May 1, 2025 22:41
@emenslin
Copy link
Collaborator

emenslin commented May 2, 2025

The os_2025_04_30_09_33_44_fix db is corrupt on the test panel so it cannot be tested on. Is there a backup of the db that someone can upload or another db that we can test on?

Edit: I reuploaded the db and it is working now

Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • Verify the results for the Geography columns are the same on both branches

  • Verify results are the same on both branches

  • Verify results are the same on both versions

General test queries:

  • Verify results are the same in both branches
  • Verify results are the same in both branches

Test for catalog number cast:

  • Ensure the leading zeroes are trimmed for the catalogNumbers in the Report or Label output

Leading zeroes are not trimmed

Hotfix:
image

7.10.0:
image

@github-project-automation github-project-automation bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board May 2, 2025
@sharadsw sharadsw linked an issue May 2, 2025 that may be closed by this pull request
@sharadsw
Copy link
Contributor Author

sharadsw commented May 2, 2025

@emenslin Which db and collection was this on?

@emenslin
Copy link
Collaborator

emenslin commented May 2, 2025

Sorry I forgot to include that! It's on ojsmnh20250314 in the fossil invertebrates collection (https://ojsmnh20250314-hotfix-7102.test.specifysystems.org/specify/)

@sharadsw
Copy link
Contributor Author

sharadsw commented May 2, 2025

@emenslin Looks like this db has COTs which have catalog number format that aren't CatalogNumberNumeric. The hotfix will only work for dbs that have all COT formatters as CatalogNumberNumeric and the Collection's default formatter is also CatalogNumberNumeric.
image

Copy link
Contributor

@alesan99 alesan99 left a comment

Choose a reason for hiding this comment

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

  • Verify the results for the Geography columns are the same on both branches
  • Verify results are the same on both branches
  • Verify results are the same on both versions
  • Verify results are the same in both branches
  • Edit some rank names to include spaces in the ranks and re-run the queries
  • Verify results are the same in both branches
  • Ensure the leading zeroes are trimmed for the catalogNumbers in the Report or Label output

I tried queries on the Taxon and Geography trees and they seem to be holding up as well 👍
Labels appear to be displaying correctly again.

image

image

@sharadsw sharadsw requested a review from emenslin May 2, 2025 15:57
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • Verify the results for the Geography columns are the same on both branches

  • Verify results are the same on both branches

  • Use the os_2025_04_30_09_33_44_fix db on both versions

  • Verify results are the same on both versions

General test queries:

  • Verify results are the same in both branches
  • Verify results are the same in both branches

Test for catalog number cast:

  • Ensure the leading zeroes are trimmed for the catalogNumbers in the Report or Label output

Looks good!

@sharadsw sharadsw merged commit e7daf1f into branch-7.10.2 May 2, 2025
12 checks passed
@sharadsw sharadsw deleted the hotfix-7.10.2 branch May 2, 2025 16:07
@github-project-automation github-project-automation bot moved this from Dev Attention Needed to ✅Done in General Tester Board May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

7 participants