15436 Commits

Author SHA1 Message Date
sophia
b62bdd8efb
Add missing Target states to proto 2022-04-25 12:26:47 -05:00
Paul Hinze
0803b026b3
Bump sdk 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
Paul Hinze
80ba98cefb
Add debug target to Makefile
The default target gets a `-gcflags=""` arg added, but that should be
neutral.
2022-04-25 12:26:47 -05:00
sophia
c26d627e5a
Bump sdk 2022-04-25 12:26:47 -05:00
sophia
725f7a3b6e
go generate 2022-04-25 12:26:47 -05:00
sophia
128599ab68
Get local box metadata in remote box 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
4af9e4166d
Bumo sdk 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
b6d42d0695
Clean up machine client 2022-04-25 12:26:46 -05:00
sophia
29d5b3627d
Always assume machine entry is valid on the ruby side 2022-04-25 12:26:46 -05:00
sophia
f55da8168a
Check if a box is in use using the machines endpoint
This returns a list of machine index entries that use the box. This
is what is expected from the Ruby side.
2022-04-25 12:26:46 -05:00
sophia
4dcd120448
Load machine from machine ref 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
30c75b4d4d
go generate 2022-04-25 12:26:46 -05:00
sophia
a39747cc59
go generate 2022-04-25 12:26:46 -05:00
sophia
62e049e201
Implement box machines 2022-04-25 12:26:46 -05:00
sophia
f1aec2c1c2
Return machine name as sym 2022-04-25 12:26:46 -05:00
sophia
bc641209e8
Check for box version 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
18f3dc62c5
Bump sdk 2022-04-25 12:26:45 -05:00
sophia
8b5bc0cd1c
Set box metadata url 2022-04-25 12:26:45 -05:00
sophia
d9bcdba830
go generate 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
e600d6e4a8
GH Actions: Remove architecture from inputs
Should clean up warnings like this:

> Unexpected input(s) 'architecture', valid inputs are ['ruby-version',
> 'rubygems', 'bundler', 'bundler-cache', 'working-directory',
> 'cache-version']
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
e3444f40bc
bump sdk 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
Paul Hinze
6585cd55af
Add unit tests covering the new rspec helper behavior 2022-04-25 12:26:44 -05:00
Paul Hinze
2906d2c7df
Populate default when synced folder guest type is not set
This helps fix the unit tests that were failing. Also adding a test for
the new behavior
2022-04-25 12:26:44 -05:00
Paul Hinze
0fc068822a
Fix rsync ownership settings in synced folders
When the opts are being pass through the go side, we get back empty
string values instead of nil values, so the `||=` assignment was not
working to populate the default owner and group. This was causing the
rsync_post hook to fail on linux guests.
2022-04-25 12:26:43 -05:00
sophia
1441ea74d2
Get sf type from folders 2022-04-25 12:26:43 -05:00
Paul Hinze
edc0e67851
nix: Add protoc-gen-go-grpc package
This command is used in `go generate` but hadn't been pulled into the
nix dependencies yet. Previously I was installing the binary via `go
get` but this is cleaner and more nix-y.

Also includes a `nix flake update` for good measure.
2022-04-25 12:26:43 -05:00
Chris Roberts
116ad81ce0
Update SDK ref 2022-04-25 12:26:43 -05:00
Chris Roberts
6fe6ee3221
Generated proto update 2022-04-25 12:26:43 -05:00
Chris Roberts
f457cbb72b
Use machine UI when processing actions 2022-04-25 12:26:43 -05:00
Chris Roberts
535f82e192
Update remote UI implementation to retain formatting 2022-04-25 12:26:43 -05:00