* Install buf with go install
This reduces the impact of using buf on our dependency
closure, which was significant. It also avoids potential
issues with building buf given our own internal dependency
constraints. This has caused issues (including crashes!)
in the past.
See https://github.com/cockroachdb/cockroach/issues/67216#issuecomment-874176186
for more discussion on using tool dependencies generally, and
https://github.com/bufbuild/buf/issues/52
for an example of where this sort of thing caused an issue for a user.
* Upgrade buf version
We should migrate to v1 sooner rather than later, as it has some
breaking changes from v0.
* Change buf lint/breaking commands
These commands were moved up one level for v1
* Migrate to buf.yaml to v1
* Remove unused imports
These were uncovered by using "buf lint".
* Use buf v1.3.1
* Depend on googleapis and grpc-gateway via BSR
* Switch to buf for proto generation
* Remove third party dependency
* Remove unused tools and scripts
* Move local protos up one level
* Temporarily don't fail on breaking changes
* Generate CI config
* Fix generation of controller.json
* Replace use of deprecated flag
* Remove unused import, regenerate files
* Remove temporary skipping over breaking check
* Add mechanism for bundling UI assets.
The scripts/uigen.sh script will check out the UI repo, build assets,
create a static assets file, and clean up.
The dev Makefile target has been modified to run this script if no
assets file is found. There is also a build-ui target that will
unilaterally update (the dev target only builds if the file isn't found,
but doesn't update).
The handler has been updated to add the default org ID as a header if
the request path is "/".
Co-authored-by: Randall Morey <randall@randallmorey.com>
* carve out scope into a separate branch for a PR
* refactor getOpts to be private
* narrowed to just the scope proto
* wrap in a transaction
* remove user from scopes PR
* make scope type immutable
* refactored with more referential integrity (thanks mike)
* refactor based on pair programming with Mike
* better VetForWrite that supports db.Options but that requires GetOpts and Options to be exported.
* stop printing out all the db logs
* refactor withScope to be private
* refactor the VetForWrite a bit based on Todd's PR comment
* fix typo
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
* fix ctx propagation and Scope returns
* fix ctx propagation and use a const for std retry count
* change Std to Crud
* fix ctx propagation
* make sure update with field masks doesn't update a field not in the mask and force a read after update.
* add description
* remove comment about future
* clean error strings
* clean up enum string rep
* stdMeta
* fix return value to be just nil
* fix returns and errors
* update test to match new error string
* change len of domain to 24
* provide common function for new public ids
* use common db.NewPublicId() and provide the correct prefix
* move list out of CrudActions and provide a CrudlActions shortcut as well
* some comments about the purpose of VetForWrite()
* move to random 10
* Adding project API interface.
* Creation of Project handler and Tests
* Move to using the iam objects.
* Setting up testify framework for mocking and assertions.
* Fix iam options typo references.
* Adding tests for CreateProject and UpdateProject.
This also adds some additional argument validation.
* Merging in PR 40
* Renamed fakeRepo to mockRepo
* Changing around TODOs to capture current plans with the code.
* Remove the repo interface and use a real DB for tests.
* Fixed a few tests.
* Adding checks for properly formatted identifiers.
* Updating code to account for recent merges. Relaxing some restrictions on what an id can look like.
* Added small comment explaining why RegisterGrpcGatewayer interface exists.
* Move project service up a call level.
Long term I think it would make sense to define these services even higher up the call stack, potentially at the initialization of the controller server, near where the DB is initialized.
* Making these fields align with those in the resources under hosts/...
* Hard code the service initialization in the handler registration code.
* Regenerate project related code proto code.
* Removing type field for project.
* Adds basic project handling in CLI/SDK (#47)
* Adds SDK for creating and reading projects
* Reorganizes a bit
* Adds CLI for creating and reading projects
* Fixes some some generation bugs
* Adds redirect support for default org ID
* Fix protobuf import references being moved.
* Update client test to look for "orgs" and "projects" instead of "org" and "project"
* Update expected segments test
* Fix setAddr handling when default organization is in use
* Set client in target after create or read
* Adding functionality and tests for update masks.
* Additional tests for update. Disable update non existant project test.
* Make not providing an update mask be an invalid argument.
* Make empty update mask paths and no mutable fields in the path an InvalidArgument error.
* Fix get Project test.
* Adding back in the Update a non existant project test case.
* Adding seperate path structured tests.
* Attach an issue id to field mask validation TODO.
* Generate Project Update SDK code (#58)
* Created the UpdateFunction method.
* Regenerate protobuf derived code since pull #50 updated dependencies.
* Special case IDs to not be passed for updates.
* Updated the tools file since imports reordered it.
* Add spaces between each tools import/comment grouping.
Co-authored-by: Jim Lambert <jimlambrt@Jims-MBP-3.home>
Co-authored-by: Jim <jlambert@hashicorp.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
* Setup buf to see and process protos correctly.
This commit adds a proposed directory structure for protos. Included is a rough draft of the Ec2Catalog protos.
* Add host and host_catalog service apis.
This also has for the first time the move away from holding individual ids for resources and instead using the full uri path as the api facing identifier. There are some issues with the swagger generation stripping out the format of the path matching so currently only PATCH uses the approach I would like to move to. In follow up commits I'll try to either get swagger to display the correct expected paths or I'll resolve if that is even needed by our clients.
* Move all protos and generated files to under the internal directory.
This also required updating the buf config to explicitly name the exluded linted proto files under oplog since previously /internal/ was listed as a root in buf. Future commit will move oplog proto files to be with the others.
* Moved oplog related protos to under the proto directory and regenerated.
* Update the oplog protos to be compliant with buf lint.
* Clean up comments in tools.
* Merged in recent changes to oplog protos.
* Add resource result messages to contain the read only fields and separate them from the writable fields.
* Merge the ec2 catalog resources in with the more generic host_catalog resource.
* Cleaning the generated swagger.
This included adding summaries for each proto rpc method, Making the resources be the full fqn, removing the default error, and a few other tweaks.
* Make project plural in the paths.
* Adding the ability to add and remove hosts from a host set.
* Add the ignore result limit for host set request.
* Make size and host lists read only.
* Add documentation about what host references are allowed to be added.
* Remove ignore result limit when listing items. These can be added in later.
* Add handlers and tests for unimplemented services.
* Add bootstrap target and update how tools are built (#13)
* Update tool installation method, add bootstrap target to makefile
* Changing org to orgs in all paths and org param to org_id.
* Adding tests for unimplemented service implementations.
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
* Setup buf to see and process protos correctly.
This commit adds a proposed directory structure for protos. Included is a rough draft of the Ec2Catalog protos.
* Setup buf to see and process protos correctly.
This commit adds a proposed directory structure for protos, but leaves the existing oplog related protos alone. Included is a rough draft of the Ec2Catalog protos.
* Update makefile and add script to generate the appropriate pb.go files.
* Add comment explaining google.golang.org/protobuf vs github.com/golang/protobuf
* Move all protos and generated files to under the internal directory.
This also required updating the buf config to explicitly name the excluded linted proto files under oplog since previously /internal/ was listed as a root in buf. Future commit will move oplog proto files to be with the others.
* Moved oplog related protos to under the proto directory and regenerated.
* Update the oplog protos to be compliant with buf lint.