Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Improved lint check speed #237

Merged
merged 3 commits into from Sep 28, 2021
Merged

Improved lint check speed #237

merged 3 commits into from Sep 28, 2021

Conversation

himanshu007-creator
Copy link
Contributor

@himanshu007-creator himanshu007-creator commented Sep 23, 2021

Fixes

Fixes Addresses #236

Description

Technical details

Tests

Screenshots

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main or master).
  • 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.

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.

@himanshu007-creator himanshu007-creator requested a review from a team as a code owner September 23, 2021 17:10
@dhruvkb dhruvkb added this to Needs review in Openverse Sep 23, 2021
@zackkrida zackkrida added 🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users labels Sep 23, 2021
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.

Checks are passing so I have reason to believe the changes to the lint check worked.

But the check still took an inordinate amount of time.

@kevholmes
Copy link

kevholmes commented Sep 24, 2021

Looking at the Actions log for this check, I see the linting step is taking over three minutes. Reviewing integration-tests.yml I have a few thoughts:

You are using pipenv here to install pre-commit. I believe pre-commit sets up virtual envs itself. Within the log it says things like "this environment will be reused.." but really that's if you are running it locally. There is a GitHub Action for pre-commit that will set up a environment and cache it for you - reducing a good amount of runtime.

If you really want to use pipenv, it looks like there is also a way to cache it and re-use it per run, which could also save you some execution time by skipping all the downloading and setup cycles.

Within your Tests check you've got a docker caching step that takes over two minutes - I noticed you are using a community provided action to handle image caching in Actions. There is now a caching layer provided to docker actions via the GitHub API that can be used to accomplish this without extra dependencies or steps.

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.

Apart from @kevholmes's fantastic ideas, this might help speed things along.

.github/workflows/integration-tests.yml Outdated Show resolved Hide resolved
.github/workflows/integration-tests.yml Outdated Show resolved Hide resolved
@kevholmes
Copy link

Linter check looks waay better @dhruvkb, 43 seconds - awesome!

@dhruvkb
Copy link
Member

dhruvkb commented Sep 25, 2021

The speed improvements are very welcome @himanshu007-creator! I'm thinking of keeping #236 around to test if @kevholmes's suggestions (#237 (comment)) can improve the state of linting (and testing) further.

Openverse automation moved this from Needs review to Reviewer approved Sep 28, 2021
@zackkrida zackkrida merged commit daa1583 into WordPress:main Sep 28, 2021
Openverse automation moved this from Reviewer approved to Done! Sep 28, 2021
@dhruvkb dhruvkb removed this from Done! in Openverse Oct 3, 2021
@dhruvkb dhruvkb added this to In progress in Openverse PRs via automation Oct 3, 2021
@dhruvkb dhruvkb moved this from In progress to Merged! in Openverse PRs Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users
Projects
No open projects
Openverse PRs
  
Merged!
Development

Successfully merging this pull request may close these issues.

None yet

4 participants