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

Lint/Prettier + Fixes from #59 (batch cancel + list 100) + Cancel all but latest #35 #62

Closed
wants to merge 13 commits into from

Commits on Apr 1, 2021

  1. chore: add prettier config, format file, add lint workflow

    The prettier config was adapted from the official GitHub Actions repo,
    bent to fit the prevailing style (where possible) already in the project
    
    The intent is not to be controversial or argue about whitespace, it is just
    to have a consistent easy-to-verify style specifically to avoid all arguments
    about whitespace. If anything in here is objectionable, just name the setting
    to alter and I can edit / re-format / re-push
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    96465b6 View commit details
    Browse the repository at this point in the history
  2. chore(lint): add eslint config, check lint in workflow

    Similar to the prettier config, this is adapted from the main GitHub Actions repo,
    and the intent is not to be controversial it is simply to have any consistent / easy
    to check standard. If anything is objectionable, just point out the setting
    
    The config was adapted from the main repo to match what appeared to be prevailing opinion
    on this project (semicolons preferred, bracket spacing preferred, etc)
    
    The following commits will fix the small errors that seemed worth fixing
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    ea3d300 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2b56212 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a4ea60e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bd7ac71 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4af9b79 View commit details
    Browse the repository at this point in the history
  7. chore: add husky and hook build/format/lint checks to pre-commit

    This enforces the same checks locally that will execute in CI
    
    With this, everyone should have a clean / consistent dev environment,
    and it will be clear to contributors if they submit code that is not valid
    typescript
    
    Additionally, after doing the build it adds the dist/index.js output to the
    commit list so contributors can't forget to commit it
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    f6f2733 View commit details
    Browse the repository at this point in the history
  8. fix(ignore_sha): change default from false to 'false'

    This was noted by @Gisleburt here styfle#59 (comment)
    
    According to the spec the parameter should be a string, but if you use false without
    quotes in YAML it is taken as a boolean so the types are not quite correct
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    41ce15d View commit details
    Browse the repository at this point in the history
  9. refactor: extraction of cancel workflow runs method

    this is intended to be completely non-functional, nothing should be different
    here in how this works from before, it is a pure method extraction
    
    testing this change:
    the cancel_self workflow action was updated so it may be run manually, and
    the no-longer-required access_token was removed from it
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    66e9135 View commit details
    Browse the repository at this point in the history
  10. perf: cancel workflow runs in parallel

    This was suggested by @Gisleburt in styfle#59
    
    I quote:
    
    "The next problem we has is that we have multiple jobs starting at once, downloading a list of other jobs and trying to cancel them one at a time. GitHub doesn't wait for the job to be cancelled before returning a 202 response so its possible for two jobs to cancel each other. In order to reduce the chance of this happening we decided to send all of the cancellations in one go, and wait for the 202s in one lump at the end. This change will improve the speed of the task for everyone with more than one workflow to cancel."
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    c4d438d View commit details
    Browse the repository at this point in the history
  11. fix: list maximum (100) workflows possible before paging

    This was suggested by @Gislebert in styfle#59
    
    the default was 30, this widens the number of workflows we scan to
    cancel the most workflows possible, without adding complication by paging
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    a5cd3aa View commit details
    Browse the repository at this point in the history
  12. refactor: break workflow run filter into multiple parts

    this will allow the cancel all but latest feature to be easier to review
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    12fef67 View commit details
    Browse the repository at this point in the history
  13. feat(all_but_latest): add ability to clear every run but latest

    This is an adaptation of styfle#35 from @thomwiggers - the logic is entirely
    from that PR (thank you!)
    
    A new workflow adds a 240-second sleep job on macos (limit 5 concurrent)
    with manual dispatch available for testing
    mikehardy committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    9d0af3b View commit details
    Browse the repository at this point in the history