* add e2e backup-restore integration test
Adds an e2e integration test that starts by backing up
data, and ends with restoring it. Also makes various
amendments to other code where necessary to
facilitate this exercise.
Update the backup operation to create RestorePoint and RestorePointDetails models in the repository
Add modelstore to the operation to allow backup/restore operations to update/query for corso models
Closes#268
* wire selectors up through backup handling
Selectors are implemented enough to add them end-
to-end in some places. This starts with backup
creation, since that's the most stable set of code in
the repo at the moment.
A misuse of variable declaration that overlapped with
var shadowing on 'err' was causing the attachment retry
error to get lost, meaning failures to retrieve attachments
are occurring silently.
* 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
GraphConnector exports 2 error types. Recoverable and NonRecoverable. The package also implements error checks to confirm if errors are one of the exported types.
* 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.
* 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
* 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.
Issue #214: Status of Connector
- Support package contains errors module
- status is updated after backup operation
- test suite added for new features.
* 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.
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.
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.
* Issue #144 Commit adds ability to add message id to errors
Commit related to Issue #140 to find cascading errors associated with
the failures GraphConnector queries.
* Issue 144: Update to go libraries to import multierror
* Reduced error package to include certain multierror interface.
* Issue #144: Added format interface for append. Added additional testing for multiple wrapping of error.
* Issue 133: Tests Failing.
Unable to troubleshoot the iteration error. Reflecting on an object that
is nil. Fundamentally, the code works in so far as the workflow. Initial
query finds the amount of emails, returns... This is where
DataCollection would be created, then the goroutine would have the
information it would need to run asynchronously.
* Issue #133: Populate DataCollection
Bug fix on NewPageIterator: Incorrect MailDiscriminatorValue.
DataCollection implemented. Brute force. However, this does not use the
populate method. The populate method to be added in the next step.
Test Suite: TestMailCount is an end-to-end test. Tests to see if the
amount of values in a mailbox are the amount of messages that are
retrieved. This is false at present. There are several errors from
ParseNodePackage: `unsupported AdditionalData type:
map[string]*jsonserialization.JsonParseNode`. Will have to determine how
errors are to be sent to the DataCollection. Issue #137. Upon
inspection, there are 59 messages on the test account. 7 of them receive
a parsing error and 2 are unaccounted for. Issue #138
* Issue #133: Collection passed into Serialize Message method.
* Issue #133: Changes for PR
Comments have been updated as requested. Additionally, input params have
been updated for clarity.
* Issue #133: Input structure for Options changed to string literal.
* Update src/internal/connector/graph_connector.go
Co-authored-by: Vaibhav Kamra <vkamra@alcion.ai>
* Update src/internal/connector/graph_connector.go
Co-authored-by: Vaibhav Kamra <vkamra@alcion.ai>
* Update src/internal/connector/graph_connector.go
Internal helper function populateCollection() removed as it was commented out anyway.
Co-authored-by: Vaibhav Kamra <vkamra@alcion.ai>
* Update src/internal/connector/graph_connector.go according to suggestion
Consolidate line 193 response.GetValue() into to for loop over folders
Co-authored-by: Vaibhav Kamra <vkamra@alcion.ai>
* Issue #133: Expected item removed
Expected Item can could change between the time that the DataCollection is created. Therefore, the channel will stay open until the object is filled. Definition updated.
* Issue #133: Updates made to graph_connector packages
- Test package updated to test private functions. Results in import
changes and calls to package level items. All tests verified as
operational prior to upload.
- GraphConnector removal of GetCount() for Mail objects.
ExchangeDataCollection call updated in response to definition change.
Small changes to call stack to remove troubleshooting stubs.
* Gofmt applied to exchange_data_collection.go
* Issue #133: Merge resolution
These changese resolves the issues with the merge that caused the testing to fail. Tests all passing and now merging back into trunk.
* PR Suggestion Get Length -> Length()
Co-authored-by: Vaibhav Kamra <vkamra@alcion.ai>
* 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.
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
This commit does the following:
- Renames DataStream to DataCollection since that describes better the interface
- Introduces DataStream as a streamable item within this collection
* 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>