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

Fail more clearly if the file program is not installed on the runner #2234

Merged
merged 10 commits into from
Apr 15, 2024

Conversation

mbg
Copy link
Member

@mbg mbg commented Apr 11, 2024

This PR checks more clearly whether we can successfully find the location of the file program and emits a clearer message in the build log as well as a warning-level diagnostic if it cannot be found. There is also a new integration test which checks that this works as intended.

Since the check for whether the Go workaround is needed takes place before the database gets initialised, this PR also modifies the code for diagnostics to:

  • Check if the database exists yet before writing a diagnostic.
  • If it does not exist, the diagnostic is added to an array and flushed to disk later once the database is presumed to exist (init Action only)

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@mbg mbg self-assigned this Apr 11, 2024
@mbg mbg force-pushed the mbg/clearer-file-command-failure branch from 9f15e90 to cc356e1 Compare April 11, 2024 13:19
@mbg mbg force-pushed the mbg/clearer-file-command-failure branch from 944c14e to 4b0172d Compare April 11, 2024 16:21
@mbg mbg marked this pull request as ready for review April 11, 2024 16:21
@mbg mbg requested a review from a team as a code owner April 11, 2024 16:21
src/actions-util.ts Outdated Show resolved Hide resolved
src/diagnostics.ts Show resolved Hide resolved
src/init-action.ts Outdated Show resolved Hide resolved
henrymercer
henrymercer previously approved these changes Apr 12, 2024
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, I expect the functionality for writing diagnostics before the database has been initialized will come in handy elsewhere too.

You might want to consider adding a changelog note, otherwise LGTM!

@mbg
Copy link
Member Author

mbg commented Apr 12, 2024

Added a changelog entry

@mbg mbg enabled auto-merge April 12, 2024 20:43
@mbg mbg requested a review from henrymercer April 12, 2024 20:43
auto-merge was automatically disabled April 12, 2024 20:46

Pull Request is not mergeable

@mbg mbg merged commit 2b2cee5 into main Apr 15, 2024
316 checks passed
@mbg mbg deleted the mbg/clearer-file-command-failure branch April 15, 2024 09:30
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.

None yet

2 participants