2514 Commits

Author SHA1 Message Date
Keepers
39a9e0945d
add backup to operations (#132)
* add backup to operations

Extend the operations set with a backupOperation.  New backup
operations are created through an existing repository and, once
created, can be Run synchronously.

Integration tests have a skeleton, but the meat of them is on hold
while dependencies undergo implementation.

* remove operation progress
2022-06-06 14:11:54 -06:00
Keepers
8a9c1acc9e
add cli backup command (#142)
* add cli backup command

adds the `corso backup` command to the cli.  Currently
only displays the backup help.

* add backup to cli cmds, fix verbiage
2022-06-06 14:08:34 -06:00
Keepers
44392ab8b2
adds env-based integration test controls (#128)
* adds env-based integration test controls

Some integration tests were running locally without being told
to do so via env variables.  This adds some controllers for validating
if and when those tests should run, and for ensuring the env
variables necessary to run the test are available.

* testing helper comments, func name change

* add testing timeOf log, skip gc ci tests

* corrected the test skip in GC_test

* update kopia_test with helpers

* rename /testing files to *_test.go

This will ensure these files do not compile into the release binary.

* Revert "rename /testing files to *_test.go"

This reverts commit 04fd2046cc6d11bf3e3eb98d98a3e84b1bba6366.
2022-06-06 13:17:40 -06:00
ashmrtn
ecb894fc17
Struct with information about completed uploads (#121)
POD struct that holds some simple information about a kopia upload. Not
wrapping or returning a handle to a kopia struct to keep upper layers of
corso clear of type dependencies. Struct will help with tests as it can
be returned from public functions in the KopiaWrapper package allowing
more black-box testing. Especially useful since we don't yet have a
restore flow, which means we can't test data == restore(backup(data)).
2022-06-06 10:12:18 -07:00
ashmrtn
f68a4e3f46
Fix pointer receivers for KopiaWrapper handles (#131)
* Fix pointer receivers

* Some basic tests about closing KopiaWrapper

* Return pointers to structs
2022-06-03 16:15:51 -07:00
Vaibhav Kamra
0aa0915adf
Add ExchangeData (#130)
This commit adds ExchangeData which represents a single item in an ExchangeDataCollection.
Also adds a placeholder for a data collection populator that will be implemented later
2022-06-03 15:44:54 -07:00
Keepers
6e71e44024
introduce operations (#114) (#122)
* introduce operations (#114)

Adds the /internal/operations package.  This is a starting point
which only includes the base operation struct and handling.
Per-process (backup/restore) operations to come at a later time.

* adding comments for clarity in op_progress
2022-06-03 15:50:13 -06:00
Vaibhav Kamra
936350b7b4
Embed io.Reader in DataStream (#127)
This allows callers to use DataStream as an io.Reader without the need to call ToReader()
2022-06-03 14:45:48 -07:00
Vaibhav Kamra
b29cedfb34
Introduce DataCollection and DataStream (#125)
This commit does the following:

- Renames DataStream to DataCollection since that describes better the interface
- Introduces DataStream as a streamable item within this collection
2022-06-03 14:44:23 -07:00
Vaibhav Kamra
c33ef8631b
ExchangeDataCollection placeholder (#123)
Introduces ExchangeDataCollection and a method on GraphConnector to instantiate one for a specified user

Refer to https://www.notion.so/alcion/GraphConnector-interfaces-eadd11a49542436cb611da0135dda7cb
2022-06-03 13:43:19 -07:00
ashmrtn
f1550c967b
Add function to open kopia (#111)
* Add function to open kopia and keep handle

* Add kopia handle in Repository

* Have Repository manage lifetime of KopiaWrapper

* Have CLI manage lifetime of Repository
2022-06-03 10:34:28 -07:00
Danny
01c275707a
GraphConnector initialization (#104)
* Issue #68: Updates to dependency files.

* Issue #68: Added GraphConnector module and test suite.

* Issue #68: ErrorList module and test added to package to support GraphConnector.

* Issue #68: Updates made to address comments.

* Issue #68: Added additonal comments to structs and corrected library changes.

* Issue #68: Added additonal comments to structs and corrected library changes.

* Issue #68: Updates made to package.

* Update errorList.go

Fix typo

* Issue #68: ErrorList struct removal required
The structure of the errorList is not required for the first
initialization of the GraphConnector. In the case that this structure or
addtional functionality needs to be added in the future, an issue will
be created.

* Issue #68: Simplification and structure change
The errorList has been changed to []errors. Additionally, the
credentials and authentication have been changed to inline. Provided
early exits for creating NewGraphConnectors. Note, adapter objects can
be created with strings that fail authentication. Reduced the amount of logs.

* Issue #68: Prepend
[errors](https://github.com/alcionai/corso/pull/104#discussion_r887268576)
This fixes the bug that identified in the PR.

* Update src/internal/connector/graphConnector.go

Adjustment for styling.

Co-authored-by: Keepers <104464746+ryanfkeepers@users.noreply.github.com>

* Update src/internal/connector/graphConnector_test.go

Issue #68: PR Resolution
Test environmental value changed to be consistent with the rest of the package.

Co-authored-by: Keepers <104464746+ryanfkeepers@users.noreply.github.com>

* Issue #68: Resolving Open Questions from reviewers
Prior to commit, Issue #116. Additionally, the entire error package was
requested to be removed from the component. GraphConnector tests are
preliminary set-up to investigate the Issue #116. The code will be
redacted after the new functionality is verified. Stashing for merge for
the changes from the reviewers.

* Issue #116: Bug fix. Response verified not to be nil prior to using it in next step.

* Issue #116: Added table structure to verify GraphConnector can handle being given an empty set of parameters.

* Issue #68: PR Changes
List of changes:
- Added check to ensure conversion of user object passed
- setTenant not exported
- TODO added user query during initialization
- Iteration flow adjusted for paging.

Co-authored-by: Keepers <104464746+ryanfkeepers@users.noreply.github.com>
2022-06-03 02:46:15 -04:00
ashmrtn
04d11503a9
Factor out helper functions for testing (#115)
Helper functions do simple validation and initialization for S3 storage
objects.
2022-06-02 16:57:13 -07:00
Keepers
cc3306e5e0
validate required storage props (#85) (#108)
* validate required storage props (#85)

Centralizes validation of required storage config properties within
the storage package.  Requiremens are checked eagerly at
configuration creation, and lazily at config retrieval.

Additionally, updates /pkg/storage tests to use suites
and assert funcs.

* add validation failure tests to storage
2022-06-02 15:33:19 -06:00
Keepers
535cb9e1f5
add common config and encryption passwd (#74) (#99)
* add common config and encryption passwd

Adds a provider-independent configuration handler, and the
the encryption password config property.  The password is used
to encrypt and decrypt the kopia repository properties file.

* fix corso_password in ci.yml

* actually use the corso password in testing

* replace passwd in ci.yml with a secret

* ci.yml secret typo fix
2022-06-01 16:00:41 -06:00
Keepers
f368c596b5
add readme to corso/src (#101) (#102)
Additional documentation to help guide new developers through the
repository layout and design decisions backing that layout.
2022-06-01 12:05:26 -06:00
Keepers
596a4cc37b
initial repo init integration test (#90) (#96)
Implements an integration test in the repository that runs an end-
to-end test of an s3 repo initialization through kopia.
2022-05-31 18:32:26 -06:00
Keepers
eaf6018996
add prefix flag for s3 (#94)
* add prefix flag for s3

Adds the flag --prefix for s3 repo init and creation.

* fix missing prefix flag in repo s3 cli
2022-05-27 17:22:50 -06:00
Vaibhav Kamra
d34175bd19
Use testify for repository tests (#88) 2022-05-27 10:25:24 -07:00
Keepers
d923c4072b
expose s3 endpoint as flag (#87)
Exposes the s3 endpoint option as a cli flag and storage config
property.  Uses the kopia default s3.amazonaws.com as a fallback.
2022-05-27 09:11:26 -06:00
Keepers
e6663fd0f1
changes requried for manual repo init (#25) (#80)
A small collection of changes and code cleanup to successfully run
'corso repo init s3' manually.  Adds a default s3 url (might want
this configurable for local testing) and aws session token support.
2022-05-25 17:27:23 -06:00
Keepers
548eb1be72
add e2e wiring of cli to kopia (#77)
* add e2e wiring of cli to kopia

Now that pkg/storage and internal/kopia are in place, we
can wire up the init flow from the cli all the way to kopia.  Testing
harness for this functionality still needs investigation afterward.

* factor out awsVars struct for s3Cfg
2022-05-25 14:06:05 -06:00
Keepers
569ba524ac
adds kopia pkg to handle integration (#25) (#76)
* adds kopia pkg to handle integration (#25)

internal/kopia will be used to abstract all kopia integration in a
central location.

* defer blob.Storage closure in kopia

blob.Storage objects must get closed at the end of their usage.
This currently isn't getting called.
2022-05-25 13:08:47 -06:00
Keepers
99358c5d6e
introduces storage pkg (#25) (#73)
* introduces storage pkg (#25)

Adds a new package /pkg/storage.  Storage is used to
communicate storage provider information throughout the corso
app.  In particular, it allows per-provider data to cross interface
boundaries without slicing their details.

* use consts for s3 config keys
2022-05-25 09:50:52 -06:00
Niraj Tolia
06608be38e
Minor docs tweaks (#71)
- Better broken link error checking
- Link to Mermaid
2022-05-24 12:39:08 -07:00
Niraj Tolia
5739f903ff
Docs changes for GitHub Actions (#69) (#70) 2022-05-24 12:38:48 -07:00
Keepers
f2d5c878a3
adds s3 repo commands to the cli (#67)
Adds the s3 provider set to the repo cli commands.  Flag, env
vars, and other configuration is still incomplete and will require
iteration.  But this sets us up for quick testing of the commands.
2022-05-20 15:20:15 -06:00
Niraj Tolia
7f82dd5837
Catch typos in docs-related JSON (#66) 2022-05-20 13:22:48 -07:00
Niraj Tolia
2564b32841
Add Mermaid support to the Corso documentation platform (#64)
* Add MDX and Mermaid
* Configure Docusaurus for Mermaid
2022-05-20 13:13:21 -07:00
Niraj Tolia
df23d2238a
Add support for dark mode for Corso docs (#63) 2022-05-20 12:52:58 -07:00
Niraj Tolia
533a9ebb09
Add edit ability (via GitHub) to Corso docs (#55) 2022-05-20 11:02:28 -07:00
Niraj Tolia
965d4fae36
Add git to the docs Docker image (#53) 2022-05-20 11:02:20 -07:00
Niraj Tolia
85a06d2409
Corso documentation platform changes (#62)
* Add tools requirements for Corso docs

* Add README.md to Vale checks and ensure a clean run

* Swap from Discord to GH discussions
2022-05-20 11:00:44 -07:00
Niraj Tolia
cab6a515d9
Separate internal and user-facing docs (#60)
* Move CLI proposal to internal docs/design location
* Add previously-used headers to CLI design doc
2022-05-20 10:44:39 -07:00
Niraj Tolia
71f04fa8d0
Tweak config settings and apply Corso docs fixes (#59)
- Disable the readability style checker for now
- Remove all errors and warnings with the fixed Vale globbing
- Rename template directory
2022-05-20 10:28:40 -07:00
Niraj Tolia
930d9bd132
Internal docs (#58)
* Move CLI abstract
* Add docs index for Corso dev resources
* Tweak CLI proposal title
2022-05-19 16:27:01 -07:00
Keepers
5f8d040b40
adds docs/CLI.md (#28)
* adds docs/CLI.md

Introduces the cli command documentation.

* extending cli.md with design discussion

* migrate cli.md into docusaurus docs (#11)

Move the CLI.md file into docusaurus so that it appears
as part of the documentation page.

* remove cli version, settings.json (#11)

Remove /.vscode/settings.json and the versioning info from
/docs/cli.md.
2022-05-19 16:08:01 -06:00
Keepers
2ae4f4cdcb
introduce repository api scaffold with s3 (#6) (#54)
* introduce repository api scaffold with s3 (#6)

introduces the public repository package in /pkg, with a
skeleton implementation for generating the s3 provider config
and boilerplate for where that usage gets centralized.

* condense init/connect to single action

A double-pass NewRepo() && Connect() allows Repository structs
to exist independent guarantees that their usage will be successful.
This hides the struct generation within the Connect and Initialize
funcs so that the construction and guarantees can occur as
a single process.
2022-05-19 16:05:33 -06:00
Niraj Tolia
c3c3613a71
Docs: Allow for a clean run of make check (#57) 2022-05-19 14:32:30 -07:00
Niraj Tolia
49aa63c349
Remove sample docs (#56) 2022-05-19 13:32:03 -07:00
Niraj Tolia
b903d962d3
Add Markdown linting (#52)
- Also renames `make vale` to `make check`
- Addresses a part of #15
2022-05-19 10:45:31 -07:00
Niraj Tolia
5f7f5736ed
Add docs and commands to setup the container image (#49) 2022-05-19 10:29:25 -07:00
Niraj Tolia
038d94b818
Add Vale linting to docs (#47)
* Add vale to docs build image

* Add Vale config and style guides

* Add Vale to Makefile
2022-05-18 14:45:25 -07:00
Niraj Tolia
8812f4bc9b
Customize options for Corso (#48)
Uses a Noun project icon for now. Color #776A60 used with
https://thenounproject.com/icon/cane-corso-4559376/

Co-authored-by: Vaibhav Kamra <vkamra@alcion.ai>
2022-05-18 14:22:38 -07:00
Vaibhav Kamra
1e65e2f120
Add go-licenses check to CI (#50)
Runs github.com/google/go-licenses
2022-05-18 14:19:53 -07:00
Niraj Tolia
ad15968837
Add docs template (#40)
* Add Dockerfile and Makefile for docs

* New Docusaurus project

* Remove blog from docs

* Add missing package-lock.json

* .PHONY
2022-05-16 22:44:49 -07:00
ashmrtn
4ac3aa08f0
Fix building base image on Mac. (#22)
Mac uses low group IDs for the default user, which would cause groupadd
to fail as the group already existed. Only make a new group if it
doesn't already exist.

This does raise other questions though as now we are technically having
the container run with a "services" group.
2022-05-09 17:20:03 -07:00
Keepers
82c9a1f182
Add 'repo' cli command set (#31)
Adds the 'repo' command and its primary subcommands to the
Corso cli command list.
2022-05-09 16:15:07 -06:00
Keepers
a352ddf8a1
add coba and cli to corso (#30)
Adds the spf13/cobra cli handling package.  Main() now
processes cli commands defined by the /cli package.
2022-05-09 13:36:44 -06:00
Vaibhav Kamra
ee37e62927
Add gofmt to ci steps (#16)
This commit has the following changes:

- Rename unitTests.yml to ci.yml
- Add a step to run gofmt
2022-05-09 10:47:43 -07:00