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

Support using sketches reports from local path #5

Merged
merged 5 commits into from
Sep 15, 2020
Merged

Support using sketches reports from local path #5

merged 5 commits into from
Sep 15, 2020

Commits on Sep 15, 2020

  1. Fix slow unit test

    The test was triggering an intentional delay in a function, resulting in this test causing a signficant increase in the time required to run the unit tests.
    
    The solution was to simply fake time.sleep() so it no longer causes a delay.
    per1234 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    a1aa1bc View commit details
    Browse the repository at this point in the history
  2. Rename size-deltas-reports-artifact-name input to sketches-reports-so…

    …urce-name
    
    Preparation to use the input for specifying the source of sketches reports either in a workflow artifact or a local folder.
    
    The old input name is still supported but warning will be displayed in the build log to explain the name change.
    per1234 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    fb464e5 View commit details
    Browse the repository at this point in the history
  3. Support using sketches reports from local path

    The action was previously designed to only run from a scheduled workflow. The
    reason is that it needs a token with write permissions to comment on the PR, but
    due to security restrictions there is no way to have such a token when a
    workflow is triggered by a pull_request event from a fork.
    
    This is problematic for private repos because if the schedule is set to a short
    interval the action will use up the free GitHub actoins minutes allocation
    quickly (public repos have unlimited minutes). If the schedule is set to a long
    interval, then there is a long potential wait time for the report.
    
    A common work flow in private repos is for PRs to be submitted from branches,
    not forks, which makes it possible to trigger the action from the PR.
    
    Running from a pull request triggered workflow should actually work as the
    action was, but the method of finding the artifact is very inefficient and
    unintuitive in that context.
    
    Recently, GitHub added the ability for private repositories to allow write
    permissions for workflows triggered by pull requests, making it even more likely
    this method of using the action will be found useful:
    https://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository#enabling-workflows-for-private-repository-forks
    per1234 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    8a74de0 View commit details
    Browse the repository at this point in the history
  4. Split discrete functionalities of ReportSizeDeltas.report_size_deltas…

    …() into separate functions
    
    The addition of support for sourcing the sketches reports from a local path resulted in the function containing code for two completely separate usages of the script.
    
    Moving each flavor of code to a separate function improves readability, maintainability, and testability.
    per1234 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    30810a6 View commit details
    Browse the repository at this point in the history
  5. Use more concise input name

    I decided the "-name" part of the input name was superfluous.
    
    This is part of a single PR, so no further backwards compatibility measures are necessary. I just don't feel like making the effort to fixup the previous name change commit and deal with all the conflicts while rebasing.
    per1234 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    d4ae92e View commit details
    Browse the repository at this point in the history