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

#97: Catch Vale runtime errors properly #133

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

rmoff
Copy link
Contributor

@rmoff rmoff commented Oct 2, 2024

Per #97, if the Vale invocation fails, the GitHub action doesn't fail.
This means that linting workflows that are misconfigured (or in which a misconfiguration creeps in subsequently) will fail silently.

Since Vale will return exit code 2 if there is a runtime failure, this PR updates the action to handle exit code 2. At the moment only 1 (a linting error) is handled.

I am no TS/JS expert so please feel free to make suggestions where I've done something stupid :)

@rmoff
Copy link
Contributor Author

rmoff commented Oct 7, 2024

Hi @jdkato, please could you consider this PR for the project. The linked issue #97 describes the reasoning for it. Thank you.

@jdkato
Copy link
Member

jdkato commented Oct 9, 2024

This looks good, thanks.

@jdkato jdkato merged commit f49b46c into errata-ai:reviewdog Oct 9, 2024
@apinnick
Copy link

I am seeing errors in GitHub actions today, which were not occurring earlier. PR.

Is it possible that this PR caused the error?

Run errata-ai/vale-action@reviewdog
with:
filter_mode: diff_context
vale_flags: --no-exit --minAlertLevel=error
reporter: github-pr-review
fail_on_error: true
files: guides/common/
version: latest
debug: false
level: error
token: ***
/usr/bin/pip install docutils
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

@rmoff
Copy link
Contributor Author

rmoff commented Oct 10, 2024

@apinnick is it possible that this was always failing, and this PR is now just correctly catching that failure instead of it passing by silently?

@apinnick
Copy link

@apinnick is it possible that this was always failing, and this PR is now just correctly catching that failure instead of it passing by silently?

@rmoff Good question. I checked an older PR and found this:

/usr/bin/pip install docutils
Defaulting to user installation because normal site-packages is not writeable
Collecting docutils
Downloading docutils-0.21.2-py3-none-any.whl (587 kB)

So it looks like there was a problem before. Any idea how I could fix it? I will start searching for an answer online....

@OrkoHunter
Copy link

Just adding that our actions in Backstage are failing too. e.g. backstage/backstage#27137

@apinnick
Copy link

Just adding that our actions in Backstage are failing too. e.g. backstage/backstage#27137

@OrkoHunter See this issue. I was able to fix the issue by setting the ubuntu version to 22.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants