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

Use nuxi typecheck to make the frontend types check in pre-commit faster #5268

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Dec 11, 2024

Fixes

Tiny fix I noticed when testing the ov PR.

Description

This PR replaces several commands we use for type testing with the Nuxt's nuxi typecheck, which generates the types in the .nuxt folder, and then runs the checks.

Previously, we were running nuxi prepare (which runs more steps than simply creating the types) twice in the precommit check.

Testing Instructions

The typecheck in the CI should pass.

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 (ov just catalog/generate-docs for catalog
    PRs) or the media properties generator (ov just catalog/generate-docs media-props
    for the catalog or ov just api/generate-docs for the API) where 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 added 🟩 priority: low Low priority and doesn't need to be rushed 🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🧱 stack: frontend Related to the Nuxt frontend labels Dec 11, 2024
Copy link

github-actions bot commented Dec 11, 2024

Latest k6 run output1

     ✓ status was 200

     checks.........................: 100.00% ✓ 412      ✗ 0   
     data_received..................: 97 MB   401 kB/s
     data_sent......................: 54 kB   224 B/s
     http_req_blocked...............: avg=34.82µs  min=2.45µs   med=4.96µs   max=383.93µs p(90)=146.79µs p(95)=178.87µs
     http_req_connecting............: avg=21.85µs  min=0s       med=0s       max=314.81µs p(90)=99.94µs  p(95)=126.98µs
     http_req_duration..............: avg=213.99ms min=31.96ms  med=172.53ms max=1.4s     p(90)=384.26ms p(95)=427.7ms 
       { expected_response:true }...: avg=213.99ms min=31.96ms  med=172.53ms max=1.4s     p(90)=384.26ms p(95)=427.7ms 
   ✓ http_req_failed................: 0.00%   ✓ 0        ✗ 412 
     http_req_receiving.............: avg=176.84µs min=68.67µs  med=147.26µs max=610.61µs p(90)=294.98µs p(95)=334.01µs
     http_req_sending...............: avg=25.2µs   min=10.7µs   med=23.67µs  max=87.62µs  p(90)=36.65µs  p(95)=42.85µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=213.79ms min=31.83ms  med=172.16ms max=1.4s     p(90)=384.05ms p(95)=427.42ms
     http_reqs......................: 412     1.706944/s
     iteration_duration.............: avg=1.15s    min=562.68ms med=1.28s    max=2.6s     p(90)=1.46s    p(95)=1.88s   
     iterations.....................: 77      0.319016/s
     vus............................: 3       min=0      max=6 
     vus_max........................: 60      min=60     max=60

Footnotes

  1. This comment will automatically update with new output each time k6 runs for this PR

@obulat obulat force-pushed the simplify-types-precommit-check branch from 351769c to 64dd549 Compare December 11, 2024 17:46
@obulat obulat marked this pull request as ready for review December 11, 2024 17:46
@obulat obulat requested review from a team as code owners December 11, 2024 17:46
@obulat obulat requested review from krysal and dhruvkb and removed request for a team December 11, 2024 17:46
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

Nice, as someone who commits frequently, this will save a lot of time.

@@ -109,7 +109,7 @@ repos:
- id: types
name: types
files: ^(frontend|packages/js)/.*$
entry: bash -c 'pnpm run prepare:nuxt && pnpm run -r types'
Copy link
Member

Choose a reason for hiding this comment

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

I don't really get why a lot of language: system hooks have followed the bash -c '' notation so I support this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know that either, but it works without it :)

@obulat obulat merged commit dbc68f5 into main Dec 13, 2024
55 checks passed
@obulat obulat deleted the simplify-types-precommit-check branch December 13, 2024 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants