785 Commits

Author SHA1 Message Date
sophia
b62bdd8efb
Add missing Target states to proto 2022-04-25 12:26:47 -05:00
Paul Hinze
8f9952089a
Fix commands that run without a project
Some commands like `vagrant init` and `vagrant box` should be able to
run successfully without a full Project available in VAGRANT_CWD (in
other words, they don't require that a valid Vagrantfile be available.)

Thus far we've been assuming that a Project is available when
dispatching commands, which mean that commands of this nature weren't
working.

Here we make the Basis available to serve as an alternative client to
Vagrant::Environment::Remote such that it can be instantiated and passed
through to commands. This required some changes to Environment::Remote
to make its interactions with the client more defensive, but we manage
to avoid needing to make any changes to the normal legacy codepaths.
2022-04-25 12:26:47 -05:00
Paul Hinze
61fbd0f622
Move Basis, Project, and Target seeding earlier
Having these objects populate their seeds during `Run` was too late for
those values to show up in command plugins, which would be seeded with
empty args instead.

h/t @chrisroberts for the debugging help and fix suggestion!
2022-04-25 12:26:47 -05:00
sophia
e9e24986bd
Add ability to get metadata associated with a box 2022-04-25 12:26:47 -05:00
sophia
2b4c99aaa0
Don't add destroyed machines to list of active machines when searching for box usage 2022-04-25 12:26:46 -05:00
sophia
c13dcc938c
Only include machines that have been created 2022-04-25 12:26:46 -05:00
sophia
62e049e201
Implement box machines 2022-04-25 12:26:46 -05:00
sophia
ba0bb1d9c6
Add machine tests for boxes 2022-04-25 12:26:45 -05:00
sophia
ac18a1c001
Don't add a box to the db when querying the machine for it's box
If the box does not exist in the db, then a box will be returned
with the name and provider information. All other box information
at that point is unknown.
2022-04-25 12:26:45 -05:00
sophia
7eccedba12
Add test for box with 0 version number 2022-04-25 12:26:45 -05:00
sophia
fc649b0937
Set first match without version constraint 2022-04-25 12:26:45 -05:00
sophia
517c33aacf
Ensure json data is recieved from vagrant cloud 2022-04-25 12:26:45 -05:00
sophia
c60836fc12
Get box provider from target 2022-04-25 12:26:45 -05:00
sophia
e27fb8aa07
Ensure json metadata is retrieved for box 2022-04-25 12:26:45 -05:00
sophia
f97aff623f
Set default log level fwhen launching vagrant ruby 2022-04-25 12:26:45 -05:00
sophia
3516aa7131
Set defailt Vagrant log level 2022-04-25 12:26:44 -05:00
sophia
0904996af1
Set default log level for VAGRANT_LOG 2022-04-25 12:26:44 -05:00
sophia
4a9948c245
Add nested metadata data to box tests 2022-04-25 12:26:44 -05:00
sophia
2d477ed675
Use struct for box metadata 2022-04-25 12:26:44 -05:00
sophia
5d348e66a1
Update box proto to use struct for metadata 2022-04-25 12:26:44 -05:00
Paul Hinze
4b0acfb513
Fix unit tests
The type needs a string pointer now. We may end up wanting a string
pointer making convenience method in the SDK at some point, but for now
I punted on that question and just made one for the test.
2022-04-25 12:26:44 -05:00
Paul Hinze
7c1d2e5368
Use optional fields on Synced Folder instead of empty string checks
Addresses concerns raised in discussion here
https://github.com/hashicorp/vagrant-ruby/pull/219#discussion_r816966056
and makes it so we don't have to change any plugin code to make things
work.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/133
2022-04-25 12:26:44 -05:00
Chris Roberts
6ba7807f7b
Add ClearLine() to UI implementations 2022-04-25 12:26:43 -05:00
sophia
e6c50e3d7e
Add target index tests 2022-04-25 12:26:42 -05:00
sophia
dffa7547e8
Simplify target index to keep track of basis opposed to loading one in from the factory 2022-04-25 12:26:42 -05:00
sophia
8547cb696d
Test project 2022-04-25 12:26:42 -05:00
sophia
9179dd1abc
Use ptypes to generate testing target 2022-04-25 12:26:42 -05:00
sophia
26621c7e0b
Add tests for state bag 2022-04-25 12:26:42 -05:00
sophia
0731b5486a
Add tests for basis 2022-04-25 12:26:42 -05:00
sophia
7f0adfce78
Add tests for synced folders 2022-04-25 12:26:42 -05:00
sophia
13283a0a71
Add tests for setting machine state 2022-04-25 12:26:41 -05:00
sophia
6abbb5e8eb
Check for plugin name correctness 2022-04-25 12:26:41 -05:00
sophia
b33f1a9e01
Test guest plugin with parent 2022-04-25 12:26:41 -05:00
sophia
df0fb642b0
Add ability to get plugin with a particular instance 2022-04-25 12:26:41 -05:00
sophia
06cfbb79bf
Add more tests for guest detection 2022-04-25 12:26:41 -05:00
Paul Hinze
736e080add
Fix version printing to pass vagrant-spec
* Makes all help output showup on stdout like in rubyland
 * Moves verbosity flags to capital Vs to get out of the way of version
 * Passes version down to mitchellh/cli so it handles -v and --version
   flags
 * Tweaks version output to remove the leading `v` which is not output
   in legacy vagrant
2022-04-25 12:26:41 -05:00
sophia
16e415f929
AUse test table to test for multiple configs 2022-04-25 12:26:41 -05:00
sophia
4068760588
Make test for getting guest from machine work 2022-04-25 12:26:41 -05:00
sophia
8f95994a88
Create test dummy plugins 2022-04-25 12:26:41 -05:00
sophia
1117e06e38
Add testing plugin and plugin manager 2022-04-25 12:26:40 -05:00
sophia
83921cf3f9
Add minimal project for tests 2022-04-25 12:26:40 -05:00
sophia
fb642616a8
Add minimal Machine/Target setup 2022-04-25 12:26:40 -05:00
sophia
147d4f3964
Seperate out testing target/project/basis 2022-04-25 12:26:40 -05:00
sophia
dea5156882
Test options for machine 2022-04-25 12:26:40 -05:00
sophia
727bf91b18
Raise error if no guest plugins found 2022-04-25 12:26:40 -05:00
sophia
1cfbea7437
Testing guest detection 2022-04-25 12:26:40 -05:00
sophia
70d0d4dfb8
Allow tests to set target config for test target 2022-04-25 12:26:40 -05:00
Chris Roberts
64751ae8b9
Update machine ID storage to prevent lost ID 2022-04-25 12:26:39 -05:00
sophia
2519b9b6ac
Clear target record when destroying machine 2022-04-25 12:26:38 -05:00
Paul Hinze
ff86d86ac8
Provisioner Plugins 2022-04-25 12:26:37 -05:00