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

Turn on additional search views frontend #4043

Merged
merged 2 commits into from Apr 9, 2024

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Apr 5, 2024

Fixes

Fixes #4035 by @obulat

Description

This PR makes the additional_search_views flag switchable in prod, and turns it on by default, effectively launching the additional search views.
The test setup and checks had to be updated because the single result pages have slightly changed.

Testing Instructions

Build and run the app using just frontend/run build and just frontend/run start
Go to https://localhost:8443/search?q=cat and select a search result (image/audio). The new page with link buttons and tags as links should be displayed by default.
You should also be able to open the source/creator/tag pages, without setting the preferences previously.
If you go to https://localhost:8443/preferences, you can turn additional_search_views off to view the site without the additional views.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (if applicable).

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@obulat obulat requested a review from a team as a code owner April 5, 2024 06:33
@obulat obulat self-assigned this Apr 5, 2024
@github-actions github-actions bot added the 🧱 stack: frontend Related to the Nuxt frontend label Apr 5, 2024
@openverse-bot openverse-bot added 🟧 priority: high Stalls work on the project or its dependents 🌟 goal: addition Addition of new feature 💻 aspect: code Concerns the software code in the repository labels Apr 5, 2024
@obulat obulat force-pushed the turn-on-additional-search-views-frontend branch from fb04a93 to 2c7db67 Compare April 5, 2024 06:36
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
@obulat obulat force-pushed the turn-on-additional-search-views-frontend branch from 2c7db67 to 6e24866 Compare April 8, 2024 09:50
Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

Very nice. LGTM!

},
"description": "Toggle additional search views for tag/creator/source.",
"defaultState": "off",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused about what the "right" way to toggle the flag on in production is.

We set it to switchable, but default it to on. That means it's basically on in all environments, but an individual could switch it off by visiting /preferences, right? In practice that's irrelevant to everyone except devs because /preferences isn't linked anywhere.

So this feature flag setting could be simpified by: replacing the staging entry with a single production entry, set to enabled, and removing defaultState altogether. Thinking of this in stages, should we do this in two steps, first set production to switchable, default state off, and staging to enabled? And then confirm it in staging as a globally enabled preference (rather than a toggled one), and then update production to enabled? It would be nice if we could control these using environment variables so that it doesn't take an entire new release for each stage to take effect.

Copy link
Member

Choose a reason for hiding this comment

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

In production it seems that "switchable" is essentially "enabled" but with a convenience method for devs to see the disabled state.

Abstractly, I think the flow for launching frontend features should be:

  • Enable the feature by default in staging, switchable but off by default in prod
  • Test it in both of those contexts
  • Enable it in prod

I think we could use a doc outlining how to prep and ship user-facing frontend (or API, for that matter) features. I'll create issues this week.

Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

This LGTM, I've just left a suggestion for how to either simplify the feature flag state, or an alternative staged deployment of the globally enabled feature (i.e., enable it globally in staging first, confirm it, then globally in production).

This is all well tested in e2e tests so I'm not too worried about it, and the consequence of a small bug in this feature that we haven't caught is a non-issue, from my perspective, but it's something we should consider for future features.

@obulat obulat merged commit d25fa3a into main Apr 9, 2024
46 checks passed
@obulat obulat deleted the turn-on-additional-search-views-frontend branch April 9, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🌟 goal: addition Addition of new feature 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Switch the additional_search_views flag on in staging and prod
5 participants