Conversation
The Vagrantfile had no automated check, so a Ruby or environment-handling mistake only surfaced when someone ran `vagrant up`. Check the Ruby syntax, load the configuration under each accepted combination of `LEARN_VM_HOST_IO_CACHE` and `LEARN_VM_STORAGE_CONTROLLER`, and assert that an unrecognized cache value is refused. Without that negative case, deleting the guard would leave the workflow green. No provider is installed on the runner, so `--ignore-provider` is used and the scope is the Vagrantfile itself rather than VirtualBox: a wrong storage controller name still passes and needs a real boot to catch. Runs only on changes to `Vagrantfile` or to the workflow. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Ubuntu's archive carries no `vagrant` package, so the workflow failed at `apt-get install -y vagrant` with "Package 'vagrant' has no installation candidate" before reaching any validation. Fetch the release from HashiCorp and pin the version, the way the box version is pinned, rather than depending on the distribution archive or on HashiCorp publishing an apt suite for each Ubuntu codename. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The negative case accepted any non-zero exit from `vagrant validate`, so it would have passed even with the guard deleted: validation can fail for unrelated reasons and the test could not tell the difference. Capture the output and require the Vagrantfile's own message, reporting the unexpected output when something else fails. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Installing Vagrant costs an 87 MB download, which is disproportionate on every push to a branch: changes to the `Vagrantfile` arrive in bursts, so an active month ran it around twenty times. Split the workflow into a `syntax` job, which only parses and needs nothing beyond the Ruby already on the runner, and a `validate` job carrying the download. The syntax check still runs on every push and reports within seconds; validation runs on pull requests, so broken configuration cannot reach `main` either way. `validate` also depends on `syntax`, so a file that does not parse never triggers the download. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Vagrantfile had no automated check, so a Ruby or environment-handling mistake only surfaced when someone ran
vagrant up.Check the Ruby syntax, load the configuration under each accepted combination of
LEARN_VM_HOST_IO_CACHEandLEARN_VM_STORAGE_CONTROLLER, and assert that an unrecognized cache value is refused. Without that negative case, deleting the guard would leave the workflow green.No provider is installed on the runner, so
--ignore-provideris used and the scope is the Vagrantfile itself rather than VirtualBox: a wrong storage controller name still passes and needs a real boot to catch.Runs only on changes to
Vagrantfileor to the workflow.