2293 Commits

Author SHA1 Message Date
Keepers
25a1e972e6
update selector to match current design (#266)
* update selector to match current design

The selector design is progressing in the Showdown doc.
This updates the existing structs to match the expectations in that doc.
2022-07-05 10:20:19 -06:00
ashmrtn
cdf368ad20
Implement ModelStore delete functions (#264)
* Implement ModelStore delete functions

* Add tests for ModelStore.Delete()
2022-07-01 14:46:43 -07:00
ashmrtn
5ec6d4f286
Base model revision (#263)
* Update model interface and base struct

* Update code and tests for new Model interface
2022-07-01 14:17:15 -07:00
ashmrtn
99691f46d5
ModelStore Put/Get implmentations (#261)
* Simple Get and Put implementations

Get implementation is currently the one that uses the kopia ID of the
model/manifest.

* Basic tests for ModelStore Get/Put
2022-07-01 11:07:01 -07:00
Keepers
2aeafa36bd
add unit tests for cli command addition (#260)
* add unit tests for cli command addition
2022-07-01 08:37:50 -06:00
Keepers
8c399a6dc1
allow connect to create .corso config file (#256)
* allow connect to create .corso config file

Current bug: if no .corso config file exists, then repo connect
will always fail, even if it has the correct details to build
a new config file.  Solution: allow connect to build a .corso
config file when missing, so long as the operation succeeds
otherwise.

In tandem, return an error whenever a user attempts to
call repo connect with details that do not match the existing
.corso config file.
2022-06-30 13:03:26 -06:00
Keepers
ae778df5ae
rename scope to selector (#257)
* rename scope to selector

per design changes, source is being renamed to selector
for better readability and clarity.
2022-06-30 09:50:24 -06:00
Keepers
ce52cc5f41
Add the backup list command to the cli (#254)
* Add the backup list command to the cli

Adds `corso backup list <service>` to the cli commands.
Currently does nothing, while we're waiting on
downstream implementation.  e2e hookup will arrive later.
2022-06-30 09:30:37 -06:00
Keepers
abc8b44718
add operation results structs (#253)
* add operation results structs

Operations, both backup and restore, need to hold the
results of their operation, and be able to marshal the struct
to json for output.
2022-06-29 13:56:13 -06:00
ashmrtn
ed3844b714
API definition for model store (#249)
Basic API definitions for model store CRUD operations
2022-06-29 10:35:41 -07:00
ashmrtn
1c6f0994e4
Switch DataCollection to return a channel (#244)
* Change DataCollection to return channel directly

Precursor to restoring multiple items from kopia. Allows one to keep a
DataCollection open until all items are processed without blocking
consumers of the DataCollection (they can use a select-block if needed).

* Update tests for new DataCollection interface

* Handle context cancellation with DataCollection
2022-06-28 12:48:24 -07:00
Danny
3ee7ff0c0b
Recoverable and Non-Recoverable errors (#232)
GraphConnector exports 2 error types. Recoverable and NonRecoverable. The package also implements error checks to confirm if errors are one of the exported types.
2022-06-27 20:29:15 -04:00
Keepers
60eb8eec08
refactor cli/config for better local testing (#245) 2022-06-27 15:25:06 -06:00
Keepers
689c5cc1e9
separate tenantID from m365 creds (#231)
* separate tenantID from m365 creds

Now that account.Account is in place, tenant id needs
to get removed from the credential set (it isn't actually
a secret) and placed in the account configuration instead.
2022-06-27 13:54:37 -06:00
Keepers
108065df75
remove repository.Account (#229)
* remove repository.Account

Now that account.Account exists, we can replace the
deprecated repository.Account struct with the account
version.
2022-06-23 16:02:12 -06:00
ashmrtn
902294b70d
S3 test prefix naming (#228)
* Update how S3 storage structs are generated

  * fix bug in printing year of date
  * use the name of the test instead of trying to pull name from runtime
  * always log the time when making the storage struct
  * don't allow user to specify prefix

* Fixup tests for new test storage API

* Update function name and comment
2022-06-23 11:55:26 -07:00
Keepers
0bd23ab2ab
move config unions to common code (#224)
* move config unions to common code

The configuration union handlers in Storage and Account
overlapped significantly in behavior.  Moving those helpers into
a common code folder was requested.  Although the behavior
was similar across the files, the types were not, requiring
the addition of generics to solve the need.
2022-06-23 12:16:20 -06:00
Keepers
2b65ff80f2
hook up restore end-to-end (#226)
* hook up restore end-to-end

Now that GC and KW both provide restore operations for a
single message, we can hook up the end-to-end restore
process.  Integration tests for this change will follow in the
next PR.
2022-06-22 18:17:26 -06:00
Danny
128e9274e9
GraphConnector Status support module (#222)
Issue #214: Status of Connector
- Support package contains errors module
- status is updated after backup operation
- test suite added for new features.
2022-06-22 17:17:36 -04:00
ashmrtn
756b429362
Add public kopia function to restore a single item (#225)
Returns a DataCollection to the caller on success. Also update tests to
use new public function where appropriate.
2022-06-22 13:14:00 -07:00
ashmrtn
622e8eab95
kopia code to translate single item to DataCollection (#216)
* DataCollection and DataStream structs for kopia

* Helper function to get a single item of data

Returns a DataCollection with a single item.

* Test for backing up and restoring a single item
2022-06-22 09:50:17 -07:00
Keepers
0e261fb96a
add /pkg/source skeleton (#198)
* add /pkg/source skeleton

Source acts as an intermediary between the
client and internal packages (GraphConnector, Kopia) to
specify the scope of data in a Backup or Restore
operation request.
2022-06-21 18:26:39 -06:00
Keepers
3a3303a817
add Account pattern to mimic storage (#221)
* add Account pattern to mimic storage

Introduces /pkg/account, which produces a generic Account
struct that can be configured from specific provider
details (such as m365 credentials), and serialized back to
those details as needed.

Next steps include replacing repository.Account with the
new account.  After that, tenantID should get removed from
the m365 credentials handling and placed into the Account
configuration instead.
2022-06-21 16:43:18 -06:00
Keepers
243343c0e9
Replace fmt prints with the logger (#220)
Now that we have the logger in place, we should use it
in place of fmt.Print calls for development and debugging output.
2022-06-17 13:45:22 -06:00
Keepers
ccb3fa46a3
hook up restore cli to repository restore runner (#219)
Introduces a NewRestore method to the Repository struct.
cli/restore/exchange now generates a restoreOperation
and kicks off a Run() when `corso restore exchange` is called.
The restore operation still only accepts the placeholder
Target string slice.
2022-06-17 09:24:44 -06:00
Keepers
64477712c5
add flags to restore exchange (#213)
* add flags to restore exchange

Adds the user, mail, and folder flags to corso restore exchange.
2022-06-16 17:24:10 -06:00
Danny
81bdc69c5a
Attach retry (#202)
Merge of Attach retry branch adds inline retry for attachments. Appropriate tests included.
2022-06-16 07:05:29 -04:00
Keepers
15e7c102a4
add RestoreOperation (#211)
Adds the RestoreOperation to the /internal/operations pkg.
restoreOp.Run() is a no-op at this time since data layer
packages are not prepared to hook up e2e.
2022-06-15 16:10:11 -06:00
Keepers
fcdb42bc89
add restore and restore exchange cli (#210)
Adds the `corso restore` command to the cli (which only displays
a help menu).  And adds the `corso restore exchange`
command (which also only displays a help menu) to the cli.
Further functionality (like the complete flags) will come later.
2022-06-15 15:46:09 -06:00
ashmrtn
bf267a5478
Return io.ReadCloser from interface (#209)
Kopia returns io.ReadCloser which implies that some objects may need to
reclaim resources. Expose that functionality here.
2022-06-15 14:38:28 -07:00
ashmrtn
0e4e9e8fd6
Use upstream kopia as our import (#205)
Still need to use a pseudo-version because no tagged version of kopia
has the features we need.
2022-06-15 12:00:43 -07:00
ashmrtn
4f2ab23fbd
Add "mail" as part of FullPath for dir structure (#201)
* Add "mail" as part of FullPath for dir structure

* Update restore code for new dir structure
2022-06-15 11:59:38 -07:00
Danny
e0199b6b26
Issue 184 Full Path added to DataCollection (#199)
Merge of Branch adds FullPath to the DataCollection() where each DataCollection is based on the folder. Thus, returning a [] DataCollection
2022-06-14 17:09:02 -04:00
Danny
88bc374208
Issue 181: GC Implement restore (#197)
Addition of restoreMessages(dc DataCollection) error for GraphConnector
Merge completes Issue #181. Test suites updated
2022-06-14 14:57:38 -04:00
Keepers
ffdb469cf6
Issue 193 (#194)
* add integration tests to backupop run
2022-06-13 15:45:07 -06:00
Keepers
f39d0ecfc4
add repo connect s3 integration test (#192)
* add repo connect s3 integration test
2022-06-13 08:19:03 -06:00
Danny
1957de09d2
GraphConnector testing expanded (#180)
* GraphConnector testing expanded
setTenantUsers covered and switched the test account for an account with fewer corner cases.
2022-06-10 15:31:20 -04:00
Keepers
f03432e303
read test config from local file (#179)
* read test config from local file

Allows local configuration of the test environment by reading from
a .toml config file.  If no file exists, the file read is a no-op.  Value
prioritization is specified in the readTestConfig() func.
2022-06-10 13:21:03 -06:00
Danny
f713047f95
Testing expansion (#177)
Incremental tests added to project
Functional test added to test package to showcase usage and streamline on GraphConnector test suite.
2022-06-10 10:41:45 -04:00
Danny
8a450c07b5
Error package graph connector (#173)
Merge of this package removes the `errorList` from the Query workflow. Some variable names changed to comply with industry standards.
2022-06-09 17:20:04 -04:00
Keepers
340d875579
use config file for backup create (#171)
* use config file for backup create

Now that corso stores its prior connection details in a config
file, that file should get used to retrieve storage details as needed.
2022-06-09 14:28:26 -06:00
Keepers
9abfb486d8
remove unused repo provider consts (#176) 2022-06-09 13:49:34 -06:00
Keepers
f3866b7283
add pkg/log with zap log library (#155)
Adds a logger pkg using the zap log library.  Generally straight-
forward, though we'll have to watch out for gotchas with the
flush requirements.
2022-06-09 13:17:01 -06:00
ashmrtn
d00f9c856f
Add remainder of BackupCollections code (#170)
Fill in BackupCollection logic for kopia dirs and test

"Rehydrate" the given DataCollections into a hierarchy of kopia
virtualfs directories, allowing kopia to make a single snapshot of them.
Directory structure is extracted from the information returned by
DataCollection.FullPath().
2022-06-09 10:33:00 -07:00
Keepers
875e3cb517
call backup on exchange collection (#172)
Wires up the backupOperation to graphConnector and kopia to
fully run an end-to-end backup.
2022-06-09 00:07:04 -07:00
Vaibhav Kamra
0da0c786b5
Mock ExchangeDataCollection (#166)
Implements a mock exchange data collection that can be used to test without connecting to graph.

Currently returns a "fixed message" but we can extend this to return anything that implements io.Reader
e.g. a file that contains a serialized message.
2022-06-08 16:33:59 -07:00
Keepers
2104e66fea
add graph connector to backupOp (#165)
Adds graph connector to the backup operation implementation.
This includes feeding the account credentials into the
backup as well.
2022-06-08 17:32:14 -06:00
Vaibhav Kamra
9043351716
Implement ExchangeDataCollection iteration (#162)
DataCollection Feature added
In this merge, the DataCollection interface is defined for the GraphConnector. ExchangeDataCollection implements this interface. The subsequent definitions and test suites are included.
2022-06-08 17:59:03 -04:00
ashmrtn
53c7b4a149
Fix kopia test panics if repo is nil (#168) 2022-06-08 13:28:32 -07:00
ashmrtn
042f3eaaee
Add FullPath() to DataCollection interface (#164)
* Add FullPath() to interface

* Simple test for FullPath
2022-06-08 16:24:57 -04:00