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

Proxy all Nuxt API requests #3673

Closed
wants to merge 32 commits into from
Closed

Proxy all Nuxt API requests #3673

wants to merge 32 commits into from

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Jan 17, 2024

Fixes

Fixes #3473 by @sarayourfriend

Description

This PR uses a Nuxt server route to proxy all of the API requests.

This means that all of the requests from Nuxt will be using the correct user-agent, not only the initial server requests.

TODO:
Figure out the error types now that we've moved away from axios to ofetch (already used by Nuxt internally)

Testing Instructions

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 changed the base branch from main to update/nuxt3-Jan5 January 17, 2024 15:32
@github-actions github-actions bot added the 🧱 stack: frontend Related to the Nuxt frontend label Jan 17, 2024
@openverse-bot openverse-bot added 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🏷 status: label work required Needs proper labelling before it can be worked on labels Jan 17, 2024
@obulat obulat added 🟧 priority: high Stalls work on the project or its dependents 💻 aspect: code Concerns the software code in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users and removed 🏷 status: label work required Needs proper labelling before it can be worked on 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Jan 17, 2024
@obulat obulat force-pushed the nuxt3/api-proxy branch 2 times, most recently from b23b62b to 9fa5927 Compare January 18, 2024 06:48
@obulat obulat force-pushed the update/nuxt3-Jan5 branch 2 times, most recently from 9f888cc to ec27d5b Compare January 18, 2024 11:35
obulat added 17 commits January 18, 2024 14:47
Use har for audio tests to prevent provider requests and flakiness
Convert ui cookies for ease of use
Move analytics tests from unit tests to e2e tests
Disable buttons until hydrated

Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Use har for audio tests to prevent provider requests and flakiness
Convert ui cookies for ease of use
Move analytics tests from unit tests to e2e tests
Disable buttons until hydrated

Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
@obulat obulat force-pushed the update/nuxt3-Jan5 branch from ec27d5b to 99e203d Compare January 18, 2024 11:48
@obulat obulat force-pushed the nuxt3/api-proxy branch 2 times, most recently from 82c9f32 to 46fd0e2 Compare January 18, 2024 12:08
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Use har for audio tests to prevent provider requests and flakiness
Convert ui cookies for ease of use
Move analytics tests from unit tests to e2e tests
Disable buttons until hydrated

Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Copy link

Playwright failure test results: https://github.com/WordPress/openverse/actions/runs/7570607952

It looks like some of the Playwright tests failed. You can download the trace output and image diffs for the failed tests under the "Artifacts" section in the above page.

You can read the docs on how to use this artifact.

If the test is flaky, follow the flaky test triage procedure.

@obulat obulat force-pushed the update/nuxt3-Jan5 branch 6 times, most recently from 3a20750 to f5bead0 Compare January 19, 2024 08:04
@obulat
Copy link
Contributor Author

obulat commented Jan 19, 2024

Closing this PR because I merged these changes into update/nust3-Jan5

@obulat obulat closed this Jan 19, 2024
@obulat obulat deleted the nuxt3/api-proxy branch April 24, 2024 06:56
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: internal improvement Improvement that benefits maintainers, not users 🟧 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.

2 participants