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

Merge master (v1.18.0) into develop #1921

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

github-actions[bot]
Copy link
Contributor

Merge master (v1.18.0) into develop

Fondryext and others added 2 commits February 26, 2025 10:38
This PR represents the work to add Generative Direct Answers support, both in basic searching functionality and analytics support, along with some vulnerability fixes.

* Add GDA Object Model

Similar to the existing DirectAnswer model, we will take in an
object from search-core (GenerativeDirectAnswerResponse in this
case) and use it to construct a model.

J=WAT-4592
TEST=auto
Ran unit tests

* Update package.json to beta version

* ksearch: Add flow for automatically calling into the GDA endpoint

In this change I added the following functionality:
- at the global config level, there will be a new property named
"useGenerativeDirectAnswers" that must be set to true in order
for GDA to work on the site
- When the universal results or vertical results change, that will
trigger a call into the GDA endpoint.

To accomplish the above, I have added two new storage keys - one
for the GDA itself, and one for the Search ID, which we need for
the request into GDA.

J=WAT-4593
TEST=auto, manual
Auto: Wrote new tests
Manual: Spun up local instance of the answers-search-ui + HH theme
and changed the vars to use a Prod Search config with GDA
configured. Saw the request being fired in the network tab when
the prop was set to true, and not fired when the prop was set to
false

* Automated update to THIRD-PARTY-NOTICES from github action's 3rd party notices check

* Include some results data in the GDA object constructed

* Remove console log

* Filter results in GDA model to only include those with name and matching uid in citations

* Add Result Component for Generative Direct Answers

This change includes the logic necessary to visualize a GDA response in
the UI via the answers-search-ui package. The component styled here
(styled using the Handlebars template and custom CSS) will be used if
there is not a custom card for GDA set (in the theme, we will create a
nearly identical, but still different, card visual).

The actual *logic* for getting the data to the component is entirely
present in this PR. This includes handling the different GDA search
states (pre-search, in progress, complete) and  analytics events
(citation clicks and rich text link clicks).

Here is a demo of it in action: https://drive.google.com/file/d/1KIxTRGBPCDvcUoIICT-jeF-swdXd7Pl6/view?usp=sharing

Some key functionalities to note from the demo video:
- An in-progress GDA call will show just the banner, with text "AI Generating Answer..."
- The GDA answer will be formatted into an HTML string to be used in the snippet (the
response from the endpoint gives a markdown representation)
- If the answer has links, they will be formatted properly and should fire analytics
events in the same way that regular direct answers do
- Citations will display at the bottom of the component in a scrollable list
- Citations have fields name (req), description (opt), and link (opt).
- If a citation has a description, a truncated version will be displayed in the citation
card, below the name
- If a citation has a link, the citation card will become clickable
- Clicking on a citation will fire a CITATION_CLICK analytics event

J=WAT-4594
TEST=auto, manual
Auto: Wrote new tests
Manual: Spun up test-site pointing to Red Dog Prod experience, and verified various
states and edge cases

* Automated update to THIRD-PARTY-NOTICES from github action's 3rd party notices check

* Added code to accomplish WAT-4598 and WAT-4602

* remove console log

* remove console log

* Update custom card handling logic

We were missing some data being passed to the custom card when present
in the search-loading case. The generativeDirectAnswer property is what
contains the data passed to the custom card (as seen in addChild of
generativedirectanswercomponent.js). We now add the searchState to this
object, so that the custom card can have its own loading state logic.

J=WAT-4595
TEST=manual
Spun up test site with custom card in HH theme and saw the card behave
as expected in the loading state.

* Update package version to beta 2

* Add vertical config id to analytics event options for GDA

* Use external entityId for GDA analytics; vertical key for universal now empty string for GDA events

* update to non-beta versions, add vuln fixupdate to non-beta versions, add vuln fixupdate to non-beta versions, add vuln fixupdate to non-beta versions, add vuln fixupdate to non-beta versions, add vuln fixupdate to non-beta versions, add vuln fixupdate to non-beta versions, add vuln fixupdate to non-beta versions, add vuln fixupdate to non-beta versions, add vuln fix

* Automated update to THIRD-PARTY-NOTICES from github action's 3rd party notices check

* Upgrade node version and ubuntu

* up testcafe patch

* Try removing irrelevant line

* Remove unneeded search bar change

---------

Co-authored-by: Kyle Gerner <49618240+k-gerner@users.noreply.github.com>
Co-authored-by: Kyle Gerner <kgerner@yext.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
The acceptance tests have become flaky. This PR
represents work to make them stable.
J=WAT-4606
TEST=manual
@github-actions github-actions bot requested a review from a team as a code owner February 27, 2025 15:19
@coveralls
Copy link

Coverage Status

coverage: 61.773%. remained the same
when pulling 3548f99 on dev/merge-v1.18.0-0cfd321-into-develop
into b9a3a7f on develop.

@Fondryext Fondryext merged commit 79ea2ad into develop Feb 27, 2025
11 of 14 checks passed
@Fondryext Fondryext deleted the dev/merge-v1.18.0-0cfd321-into-develop branch February 27, 2025 15:30
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.

2 participants