Giter VIP home page Giter VIP logo

Comments (1)

laughedelic avatar laughedelic commented on June 9, 2024

I tried to run it on the sbt/sbt repo and the current naive implementation (getting files content one by one) takes forever.

Here's an idea of how this should work:

  • every time a check is requested, instead of immediately checking the changed files, first get the check result for the parent commit (or the first ancestor that has a completed check associated)
  • if the parent's check was successful, just check the changed files
  • if the parent's check was unsuccessful, compare the changed files between the two commits and see if the mis-formattings from the parent commit were changed (and fixed), if so, only then proceed with checking the changes from head commit.
    • this could be more advanced, as the check can store annotations (which could be a list of misformatted files) and they can be retrieved. Then only those files have to be re-checked (if they were changed in the subsequent commit).

A simplified version to start with:

  • just find the closest ancestor commit with a successful check (up to the base branch ref, otherwise we'll have to check all files on the first pull-request)
  • compare the head with this ancestor to get all changed files
  • check only them

Other thoughts:

  • there should a time limit for a check run (checks even have timed_out completion status)
  • also a limit for the number of files to be checked at once (cancel the check with a neutral result and a warning message)
  • checks for the head and its parent commits (which may be several) could be triggered as different check runs in the same check suite, this would distribute the effort by queueing the runs (although I don't see an API to request a run, only a check suite)

from scalafmt-probot.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.