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

Iqss/7349 1 truncate description #9085

Merged

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Oct 19, 2022

What this PR does / why we need it: Per issue #7349, Google rejects descriptions in the schema.org page metadata. Further, it expects description to be a string rather than a JsonArray which we were sending. This PR joins descriptions with a linefeed and then truncates the result to <5000 characters, sending the description up to the last word boundary before 4997 characters and appending a '...' to indicate there's more content.

Which issue(s) this PR closes:

Closes #7349

Special notes for your reviewer: This is one of ~3 PRs to close the issue

Suggestions on how to test this: Just verify the unit tests run. Can confirm manually by adding a long description and verifying it is truncated as described above (and that shorter ones aren't, and that two descriptions that total more than 5K chars are truncated together, etc.). That said, the unit tests do verify that two descriptions are joined, and there's a separate test for truncation.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?: included

Additional documentation:

@coveralls
Copy link

coveralls commented Oct 19, 2022

Coverage Status

Coverage: 19.999% (-0.001%) from 20.0% when pulling 6a8ca45 on QualitativeDataRepository:IQSS/7349-1_truncate_description into ecc23c0 on IQSS:develop.

@qqmyers qqmyers added the GDCC: QDR of interest to QDR label Oct 27, 2022
@mreekie mreekie added the bk2211 label Nov 1, 2022
@qqmyers qqmyers added the Size: 3 A percentage of a sprint. 2.1 hours. label Dec 14, 2022
IQSS/8840-Improve_guestbook_estimate
@mreekie
Copy link

mreekie commented Jan 10, 2023

Prio meeting with Stefano.

  • Moved from External Commitments Backlog to ordered backlog

@mreekie mreekie removed the bk2211 label Jan 11, 2023
IQSS/7349-1_truncate_description
@mreekie mreekie added this to the 5.13 milestone Jan 25, 2023
@mreekie mreekie added this to Ready for Review ⏩ in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) via automation Jan 26, 2023
IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) automation moved this from Ready for Review ⏩ to Ready for QA ⏩ Jan 26, 2023
@kcondon kcondon self-assigned this Jan 30, 2023
@kcondon
Copy link
Contributor

kcondon commented Jan 30, 2023

Screen Shot 2023-01-30 at 3 10 49 PM

Got an error when publishing 6k in 6, 1k descript: [descripTruncErr.txt](https://github.com/IQSS/dataverse/files/10539523/descripTruncErr.txt)

Dataset did publish but schema.org export was blank.

When tried 1, 6k description, it worked in the UI but schema.org export still blank and a single warning was posted to server.log:
[2023-01-30T20:15:39.494+0000] [Payara 5.2022.3] [WARNING] [] [edu.harvard.iq.dataverse.engine.command.impl.FinalizeDatasetPublicationCommand] [tid: _ThreadID=251 _ThreadName=__ejb-thread-pool10] [timeMillis: 1675109739494] [levelValue: 900] [[
Finalization: exception caught while exporting: Unknown runtime exception exporting metadata. begin 0, end -1, length 6000]]

@kcondon kcondon merged commit 97a832e into IQSS:develop Jan 30, 2023
IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) automation moved this from QA ✅ to Done 🚀 Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GDCC: QDR of interest to QDR Size: 3 A percentage of a sprint. 2.1 hours.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Improve/update Schema.org JSON-LD export
5 participants