101 Commits

Author SHA1 Message Date
Chris Roberts
6d88f3a54f Fix up some of the testing 2023-06-05 14:18:53 -07:00
Chris Roberts
b6192eba0d Fixup scoping usage to properly validate 2023-06-05 14:18:05 -07:00
Paul Hinze
7c56c74bb6
Support and honor the "primary" option for Command plugins 2022-07-27 11:36:04 -05:00
Chris Roberts
766b951040 Ensure config is set on basis/project during init 2022-07-08 16:38:03 -07:00
Chris Roberts
a3b32bdf60 Default configuration data, only store if vagrantfile defined 2022-07-08 16:38:02 -07:00
Chris Roberts
51d8c84740 Refactor how scopes are created and initialized 2022-07-08 16:38:02 -07:00
Chris Roberts
f5d778d51a Revert "Merge pull request #300 from hashicorp/optimize-ruby-command-list"
This reverts commit 1c26a4abb0c9e095b3f6ec9944c4b15f6f1cd064, reversing
changes made to 186824a568583d8f6f2a50501d940ed71608fa0b.

The changes broke plugin loading when using subcommands so these
changes will be reverted until the underlying issue can be
investigated and resolved.
2022-07-07 14:03:56 -07:00
Chris Roberts
1c26a4abb0
Merge pull request #300 from hashicorp/optimize-ruby-command-list
Optimize command list generation
2022-07-07 09:29:15 -07:00
Paul Hinze
fb2a102c71
Fix init and other commands that run without a project
The Basis needs to be able to respond to Vagrantfile() and
DefaultProvider() to make it through Vagrant::Environment
initialization.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/178
2022-07-01 11:56:08 -05:00
Chris Roberts
a146f3beac Fetch all ruby commands in single request 2022-06-29 16:14:19 -07:00
Chris Roberts
8c40214d61 Update project to use cleanup, not shutdown targets 2022-06-29 11:46:41 -07:00
Chris Roberts
139349b136 Remove vagrantfiles from default arguments in call 2022-06-24 18:25:50 -07:00
Chris Roberts
1bd6e4d946 Always init all known targets 2022-06-21 14:41:05 -07:00
Chris Roberts
16d4145091 Only store a project after it has been fully initialized 2022-06-20 12:56:10 -07:00
Chris Roberts
7e387b6d10 Update core scopes to use Vagrantfile 2022-06-15 11:13:40 -07:00
Paul Hinze
8b5d4b8631
Update and address protobuf package deprecations
These changes address the following warning showing up on `go get`
operations:

    go: module github.com/golang/protobuf is deprecated: Use the
    "google.golang.org/protobuf" module instead.

All changes are made using the recommendations in the per-function
deprecation notices from the docs at
https://pkg.go.dev/github.com/golang/protobuf/ptypes
2022-06-08 11:51:19 -05:00
Chris Roberts
7c93e6b0f1 Update plugin related functions for manager changes 2022-04-25 16:12:38 -07:00
Chris Roberts
eef7eca1c5 Use dedicated function to check for legacy 2022-04-25 16:12:38 -07:00
Chris Roberts
813963cb7b Update log level for trace type message 2022-04-25 16:12:38 -07:00
Chris Roberts
32807020af Update basis to use cleanup 2022-04-25 16:12:38 -07:00
Chris Roberts
6c7e154a92 Only register managers if legacy is loaded. Close core manager. 2022-04-25 16:01:10 -07:00
Chris Roberts
287268635a Update basis ResourceId() function to match core signature 2022-04-25 16:01:10 -07:00
sophia
25dfcd039f Update paths to use Path type instead of string 2022-04-25 14:12:28 -05:00
Chris Roberts
341dabcebd
Log seeding as trace level messages 2022-04-25 12:26:54 -05:00
Paul Hinze
ae58d787a0
Fix leaking basis log lines 2022-04-25 12:26:54 -05:00
sophia
77a06e83d0
Close core plugins 2022-04-25 12:26:50 -05:00
sophia
68ffb3a8cf
Inject core plugin manager into context when running plugins 2022-04-25 12:26:50 -05:00
sophia
c2c784a295
Seed basis with core plugin manager 2022-04-25 12:26:49 -05:00
sophia
0d38ccf20c
Create boxes dir if it does not exist 2022-04-25 12:26:49 -05:00
sophia
82fa38f5e0
Check for consistency between db/boxes dir when creating box collection 2022-04-25 12:26:48 -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
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
Chris Roberts
14fa44a449
Update to use command info from sdk 2022-04-25 12:26:32 -05:00
Chris Roberts
1155e7be21
Configure plugins and use plugin local functions 2022-04-25 12:26:14 -05:00
sophia
3a43cd35cb
Don't use config if it doesn't exist yet 2022-04-25 12:26:06 -05:00
sophia
04591646a3
Use host from vagrantfile if defined 2022-04-25 12:26:06 -05:00
sophia
36dbd73945
Add endpoint for accessing basis/project/target config 2022-04-25 12:26:06 -05:00
sophia
01bc9a8430
Remove unused config from basis 2022-04-25 12:26:06 -05:00
Chris Roberts
6b37b7ba55
Add seed functions and seed before running 2022-04-25 12:26:05 -05:00
Chris Roberts
bd2d399951
Use function to get component type 2022-04-25 12:26:05 -05:00
sophia
f1dc606d11
Get plugins from basis 2022-04-25 12:26:04 -05:00
sophia
d49944a25d
Only init targets when running a job scoped at the project or target 2022-04-25 12:26:01 -05:00
Chris Roberts
a2147ed27f
Update basis ResourceId to match interface 2022-04-25 12:25:59 -05:00
Chris Roberts
22de22e199
Update parent counting when loading plugins 2022-04-25 12:25:59 -05:00
sophia
d786649e03
Add box if not found in box collection 2022-04-25 12:25:55 -05:00
sophia
2dfb9b933e
Get boxes from project 2022-04-25 12:25:55 -05:00
sophia
c4cd5c599b
Add mappers to component at component creation phase 2022-04-25 12:25:51 -05:00
sophia
63c71b0a20
Append mappers to a plugin component 2022-04-25 12:25:51 -05:00
Chris Roberts
7595f1533f
Enable plugin mappers 2022-04-25 12:25:50 -05:00