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

Action does not support being run multiple times from the same workflow #1112

Closed
dbjorge opened this issue Mar 28, 2022 · 1 comment · Fixed by #1113
Closed

Action does not support being run multiple times from the same workflow #1112

dbjorge opened this issue Mar 28, 2022 · 1 comment · Fixed by #1113
Assignees
Labels
bug Something isn't working status: ready for triage This issue is ready to be triaged by the Accessibility Insights team.

Comments

@dbjorge
Copy link
Contributor

dbjorge commented Mar 28, 2022

Describe the bug

The root cause of this is a variation of #631, but I wanted to file a separate issue since the symptom/use case is different.

Today, the action unilaterally adds a check run with a specific name ("Accessibility Checks") to report a summary of results, but if you have two different jobs in the same workflow both attempting to report results simultaneously, they can get confused and give you a confusing error when they both try to write to the same check, like in this example.

log output from a task failing in this way
Creating check run with status as in progress
Started local web server. Url: http://localhost:50381 Root directory: D:\a\accessibility-insights-action\accessibility-insights-action/dev/website-root
Scanning URL c:/Program%20Files/Git/
  Error: [Exception]ErrorWithCause: An error occurred while scanning website page c:/Program%20Files/Git/
      at Logger.trackExceptionAny (D:\a\accessibility-insights-action\accessibility-insights-action\packages\gh-action\dist\index.js:73815:29)
      at Scanner.<anonymous> (D:\a\accessibility-insights-action\accessibility-insights-action\packages\gh-action\dist\index.js:74874:29)
      at Generator.next (<anonymous>)
      at fulfilled (D:\a\accessibility-insights-action\accessibility-insights-action\packages\gh-action\dist\index.js:74799:58)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  caused by: TypeError: Cannot read property 'baseUrl' of undefined
      at Scanner.getCombinedReportParameters (D:\a\accessibility-insights-action\accessibility-insights-action\packages\gh-action\dist\index.js:74887:60)
      at Scanner.<anonymous> (D:\a\accessibility-insights-action\accessibility-insights-action\packages\gh-action\dist\index.js:748[66](https://github.com/microsoft/accessibility-insights-action/runs/5726864137?check_suite_focus=true#step:6:66):55)
      at Generator.next (<anonymous>)
      at fulfilled (D:\a\accessibility-insights-action\accessibility-insights-action\packages\gh-action\dist\index.js:[74](https://github.com/microsoft/accessibility-insights-action/runs/5726864137?check_suite_focus=true#step:6:74)[79](https://github.com/microsoft/accessibility-insights-action/runs/5726864137?check_suite_focus=true#step:6:79)9:58)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  Updating check run with status as failed
  Accessibility scanning of URL c:/Program%20Files/Git/ completed
  Error: Process completed with exit code 1.

To Reproduce
Steps to reproduce the behavior:

  1. Create a workflow which runs multiple jobs that each invoke the action. For example, a job with a strategy matrix:
jobs:
  example-job:
    strategy:
      matrix:
        os: ["ubuntu-latest", "windows-latest"]
    runs-on: ${{ matrix.os }}
    steps:
    # ...
    - name: Scan test site
      uses: accessibility-insights-action@v2
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        site-dir: ${{ github.workspace }}/dev/website-root
  1. Run it
  2. Observe the failure above

Expected behavior

Running a scan from within a matrix strategy should "just work" with no special extra work from users.

Screenshots

n/a

Context (please complete the following information)

  • OS Name & Version: n/a
  • AI-Action Version & Environment: Dev build from main as of writing, @b6d3472
  • Browser Version: n/a
  • Target Page: n/a

Are you willing to submit a PR?

sure

Did you search for similar existing issues?

yes

Additional context

This will probably be solved incidentally by the same work that resolves #631

@dbjorge dbjorge added the bug Something isn't working label Mar 28, 2022
@ghost ghost added the status: new This issue is new and requires triage by DRI. label Mar 28, 2022
@ghost ghost assigned sfoslund Mar 28, 2022
@sfoslund sfoslund added the status: ready for triage This issue is ready to be triaged by the Accessibility Insights team. label Mar 28, 2022
@ghost ghost assigned asksep Mar 28, 2022
@ghost
Copy link

ghost commented Mar 28, 2022

This issue has been marked as ready for team triage; we will triage it in our weekly review and update the issue. Thank you for contributing to Accessibility Insights!

@ghost ghost removed the status: new This issue is new and requires triage by DRI. label Mar 28, 2022
dbjorge added a commit that referenced this issue Mar 28, 2022
#### Details

The self test workflow added today in #1110 and #1111 uncovered issue #1112 when I tried to use a matrix strategy to test it across both ubuntu and windows agents. This PR disables the matrix strategy as a workaround until we fix #1112.

##### Motivation

Unblock self-test workflow

##### Context

n/a

#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox -->
- [n/a] Addresses an existing issue: Fixes #0000
- [n/a] Added relevant unit test for your changes. (`yarn test`)
- [n/a] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage`
- [x] Ran precheckin (`yarn precheckin`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: ready for triage This issue is ready to be triaged by the Accessibility Insights team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants