335 Commits

Author SHA1 Message Date
Danny
432f984e61
GC: Backup:Event Feature to incorporate event ids for all calendars (#808)
Feature enhancement to include all Calendars in the event `restore-all` feature.
2022-09-12 08:17:04 -04:00
Keepers
964a2fc39e
new format for tabular display of timestamps (#793) 2022-09-09 20:43:18 -06:00
Keepers
a226035c23
clean out scope value chaff (#731) 2022-09-09 19:21:31 -06:00
Keepers
25ce11b2c6
deduplicate shared exchange code in cli (#732) 2022-09-09 18:30:15 -06:00
Keepers
57ddf26007
kill the e2e event restore test (#816) 2022-09-09 17:48:44 -06:00
Keepers
cb467a3e46
correct the transformer used for contact folders (#814) 2022-09-09 15:34:28 -06:00
Danny
697701afeb
Reduce the amount of folders that are checked for serialization checks. (#807) 2022-09-09 14:23:01 -06:00
Keepers
6f7cf00188
add cli integration tests for event/contact (#760)
## Description

Adds foundational cli integration tests for backup/restore
of events and calendars

## Type of change

- [x] 🤖 Test

## Issue(s)

#501 

## Test Plan

- [ ] 💪 Manual
- [ ]  Unit test
- [x] 💚 E2E
2022-09-09 14:15:36 +00:00
Danny
2e3ee15fd4
Sent / Receive DateTime Stamp Incorrect (#792)
## Description
Single Legacy Policies added to allow the values for sent / receive times to correspond to the original content for `exchange.Mail` objects

## Type of change
- [x] 🐛 Bugfix


## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

*closes  #645

## Test Plan

<!-- How will this be tested prior to merging.-->

- [x] 💪 Manual
Values can be inspected using e2e restore pipelines.
2022-09-09 03:39:52 +00:00
Georgi Matev
f509543856
Custom output template for auto-generated docs (#785)
## Description

Introduces a Corso specific (more desirable) formatting for the auto generated documentation. 

More or less an adaptation or https://github.com/spf13/cobra/blob/main/doc/md_docs.go. Unfortunately the original 
package does not have sufficient hooks to allow for plugging in a new renderer. 

Other approaches considered: 
* [Override the UsageTemplate ](https://github.com/spf13/cobra/blob/main/user_guide.md#defining-your-own-help) - unfortunately does not apply to Markdown generation
* Use a golang template for the docs output - unfortunately the `pflags` package does not have a suitable way of iterating over the flags that can be easily fed into a template. 

Follow on work:
* ~~Styling of flags tables as part of docs rendering - Done~~
* Opens up possibility for flag ordering - need to set `pflags.SortFlags = false` before parsing the flags - https://github.com/alcionai/corso/issues/783
* Can simplify sidebar command maintenance by naming the rendered docs files line similar to `<Num>_corso_command1_command2` where `<Num>` can be set as annotation on the commands. Order in the navbar can be set as part of command authoring - https://github.com/alcionai/corso/issues/784

## Type of change

Please check the type of change your PR introduces:
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [x] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

* https://github.com/alcionai/corso/issues/536
* https://github.com/alcionai/corso/issues/528

## Test Plan

<!-- How will this be tested prior to merging.-->

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
2022-09-09 03:15:24 +00:00
Danny
ca6331b66e
[Fix] Issue #801: Error during Paging (#802)
## Description
Pagination fix for nill pointer

## Type of change

- [x] 🐛 Bugfix## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* closes #801

## Test Plan

- [x]  Unit test
2022-09-09 02:27:47 +00:00
Danny
c02817ac86
CI: Bug Fix Iterator Tests (#800)
## Description

Fixes mapping alignment during iterator tests

## Type of change


- [x] 🐛 Bugfix
- [x] 💻 CI/Deployment


## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* closes #797
## Test Plan

- [x]  Unit test
2022-09-09 01:59:46 +00:00
Vaibhav Kamra
57bb229f35
Implement a logging middleware to log Graph requests (#791)
## Description

Enables a logging middleware that will log the Graph http calls if the `LOG_GRAPH_REQUESTS` environment variable
is set

## Type of change

Please check the type of change your PR introduces:
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 🐹 Trivial/Minor

## Test Plan

<!-- How will this be tested prior to merging.-->

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E

```$ LOG_GRAPH_REQUESTS=true CORSO_CI_TESTS=true go test -v .
...
=== RUN   TestGraphConnectorIntegrationSuite
2022-09-08T13:39:25.556-0700	INFO	graph/service_helper.go:61	REQUEST: GET /v1.0/users?%24select=id%2CuserPrincipalName HTTP/1.1
Host: graph.microsoft.com
Accept: application/json
Authorization: Bearer <REDACTED>


    integration_runners.go:58: TestGraphConnectorIntegrationSuite run at 2022-09-08T20:39:25.967824Z
=== RUN   TestGraphConnectorIntegrationSuite/TestAccessOfInboxAllUsers
2022-09-08T13:39:26.398-0700	INFO	graph/service_helper.go:61	REQUEST: GET /v1.0/users?%24select=id%2CuserPrincipalName HTTP/1.1
Host: graph.microsoft.com
Accept: application/json
Authorization: Bearer <REDACTED>
```
2022-09-08 21:12:13 +00:00
Vaibhav Kamra
1246f51b22
OneDrive Backup Operation (#738)
## Description

Wires up the OneDrive collection logic to `operation.Backup`

Includes an integration test that runs against the test domain

Two bug fixes:
- Skip the "root" item that is returned by the delta query
- Fix incorrect usage of the `filepath.SplitList` function which does
  not split a path into components. Instead use `strings.Split`. This
  is ok because the paths returned here are not OS specific.
  Regardless - this logic will be refactored when we use the `path` pkg.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)
#548 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [x] 💚 E2E
2022-09-07 23:47:12 +00:00
Keepers
6cdc691c6f
correct the corso module (#749)
swaps the corso go module from github.com/
alcionai/corso to github.com/alcionai/corso/src
to align with the location of the go.mod and
go.sum files inside the repo.

All other changes in the repository update the
package imports to the new module path.
2022-09-07 15:50:54 -06:00
Danny
6640d42aac
GC Restore: Event pipeline not working [FIX] (#780)
Bug Fix to ensure E2E testing. Test suite expanded.
2022-09-07 17:14:40 -04:00
Keepers
c73ca6a4e5
correct paths in selectors (#789)
The path package changed the standard format
of fullPath and repoRef design.  This should have
failed tests before being pushed to main, but was
able to slip in falsely while github actions were
configured to pass all tests until failed.
2022-09-07 14:14:51 -06:00
ashmrtn
d707c22205
Resolve mail exchange folders to their real path in the hierarchy (#752)
## Description

Creates and uses a `ContainerResolver` interface to fetch container paths for items of different categories (when other resolvers are implemented). If the resolver is not available or fails to resolve a folder, defaults to the old implementation of using the folder's ID as its path.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

* #456 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-02 23:18:49 +00:00
ashmrtn
897a21ef0b
Add path constructor that takes a category (#743)
## Description

Will be useful for parts of graph connector code that are abstracted to
take a category and return collections. Does not work for exchange
events or contacts yet as those paths haven't been defined.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

part of:
* #671 
* #456 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-02 20:18:05 +00:00
ashmrtn
12f61dd71c
Switch to using path categories in graph connector (#734)
Will help make later PRs easier as the category will already be known.

## Description

<!-- Insert PR description-->

## Type of change

Please check the type of change your PR introduces:
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
on path to:
* #456 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-02 20:12:22 +00:00
Vaibhav Kamra
b1cd472483
Remove AWS credentials initialization (#610)
## Description

Instead of initializing static AWS credentials, we rely on the 
credential provider chain in [Kopia](https://github.com/kopia/kopia/pull/2213) to discover and initialize credentials.

This currently supports the following in this order:
- Static credentials
- Environment variables (what Corso used to implement)
- IAM

Going forward, this will also allow us to support shared credentials (cred file) once that is
added to the credential provider chain.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)
- #384 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [x] 💪 Manual (see test output below)
- [ ]  Unit test
- [x] 💚 E2E
2022-09-02 18:38:01 +00:00
Vaibhav Kamra
ed1a4bebce
Use a WaitGroup for AwaitStatus (#716)
## Description

This builds on the `MergeStatus` proposal and `WaitGroup` discussion proposed in #494 
Required for OneDrive where we are operating on multiple collections

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)
#494 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-02 17:17:17 +00:00
ashmrtn
21c2e4af14
Make exchange mail path ctor a bit easier to use (#735)
## Description

Turn into single constructor with bool instead of separate item and
folder constructors.

## Type of change

Please check the type of change your PR introduces:
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

#671 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-02 16:52:00 +00:00
Keepers
af9dfe6654
expose event info flags in cli (#727)
## Description

Adds the new event filter selectors to the CLI for
backup detail and restore commands.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature

## Issue(s)

#501

## Test Plan

- [x] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-02 16:25:58 +00:00
ashmrtn
e325e36c04
Expand available path categories (#733)
## Description

Add events and contacts. Still cannot create paths of these types
though.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

#671 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-02 00:55:53 +00:00
ashmrtn
61ce920972
Cleanup parameters to functions to appease linters (#730)
## Description

Group like parameters to graph functions so SonarCloud is happier

## Type of change

Please check the type of change your PR introduces:
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
on the path to:
* #456 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [x] 💚 E2E
2022-09-02 00:26:31 +00:00
ashmrtn
ae28971be3
Thread contexts through some GC functions (#728)
## Description

Will be used later and just generally useful if we ever add tracing or
such to these functions.

## Type of change

Please check the type of change your PR introduces:
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [x] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

#456 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-01 23:31:43 +00:00
ashmrtn
4a96f2571d
Second attempt at directory cache/resolver for a user (#724)
## Description

Directory cache capable of converting a folder ID to a complete path to the folder

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

#456 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-01 23:03:35 +00:00
Keepers
784f006da5
don't split json output by type (#725)
## Description

Prevents output printing of detail entries from splitting into
multiple json arrays when the entries contains multiple item
type.s

## Type of change

Please check the type of change your PR introduces:
- [x] 🐛 Bugfix

## Issue(s)

#501 

## Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
2022-09-01 22:06:35 +00:00
Keepers
da6288cb8b
minor value fixes in mail consts/types (#722)
- [x] 🐹 Trivial/Minor
- [x] 🐛 Bug

closes #726
2022-09-01 21:34:57 +00:00
Keepers
a043304e0b
add eventOrganizer selector (#720)
## Description
Adds the eventOrganizer exchange filter, wraps
up the addition of eventRecurs filtering, and fixes
a couple improperly designed filter constructors.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature

## Issue(s)
#501

## Test Plan

- [x] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-01 19:56:17 +00:00
Danny
4398a67a5a
Bug fix: Addresses (#717)
## Description
When a mock event is created the event is sent to personnel. Requires that personnel have valid email addresses.
Addresses created and updated in the mockconnector package. 
## Type of change

Please check the type of change your PR introduces:
- [x] 🐛 Bugfix


## Test Plan

- [x] 💪 Manual
No emails populate when `TestRestoreEvents` completes
2022-09-01 16:11:08 +00:00
Keepers
c29d93e655
adds calendars as a folder structure to events (#714)
## Description

Exchange events were amended to use calendars
as a folder structure.  This updates the selector
to treat events as having folders similar to mail and
contacts.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature

## Issue(s)

#501

## Test Plan

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-01 15:39:14 +00:00
Danny
7a25a7b70e
GC: Restore Event to M365 user account feature (#711)
## Description
logic and orchestration to take byte representation of M365 event, create a Corso calendar, and place the event and calendar into the M365 user's account. 
## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
closes #599 
closes #710
Requires PR #708 to ensure test folder is where events are created. 
## Test Plan

<!-- How will this be tested prior to merging.-->

- [x]  Unit test
2022-09-01 00:02:36 +00:00
Keepers
f0edf7b081
add the event-calendar flag to the cli (#712)
## Description

Adds the event-calendar flag to the cli to prepare
for selectors including the calendar as the events'
"folder" structure.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature

## Issue(s)

#501 

## Test Plan

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-08-31 23:18:15 +00:00
Georgi Matev
dcbfed15df
Prepend Docusorus front matter to auto-gen CLI commands (#713)
* Pre-pend dark to auto-gen CLI commands

* After `gofmt -s`

* Update src/cmd/mdgen/mdgen.go

Co-authored-by: Keepers <ryanfkeepers@gmail.com>

* More gofmt

Co-authored-by: Keepers <ryanfkeepers@gmail.com>
2022-08-31 22:56:05 +00:00
Danny
8ead744e9f
GC: Restore: Create / Delete Calendar Feature (#708)
Feature creation: Create/Delete Calendar for aM365 user added to main branch
2022-08-31 22:03:54 +00:00
Keepers
5c59522fc2
print separate tables per entry type (#709)
## Description

Since a backup can encapsulate multiple data
types (ex: mail, contacts, and events), it doesn't
make sense to print one table with all disjoint
values.  This change splits up the print output
so that each data type in the details gets its
own table.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature

## Issue(s)

#501 

## Test Plan

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-08-31 21:10:10 +00:00
Keepers
6de326a2c4
add event selector info filters (#703)
## Description

Adds filtering support for exchnage events in
the exchange selector.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature

## Issue(s)

#501

## Test Plan

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-08-31 20:44:03 +00:00
ashmrtn
9fe6ca7f56
Logic to create Path structs from strings (#691)
## Description

* logic to split escaped path strings into elements
* wire up validity checks/struct construction
* tests for both invalid and valid path strings

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->

part of #671 
merge after:
* #648
* #689 
* #690 

## Test Plan

<!-- How will this be tested prior to merging.-->

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-08-31 20:21:46 +00:00
Keepers
cfda6ff643
add contactName filter in ExchangeSelector (#697) 2022-08-31 19:31:53 +00:00
Vaibhav Kamra
8634b1b1ac
Helpers to create OneDrive Collections (#692)
## Description

This adds the logic that materializes collections for a specified user

The collection paths are currently derived from OneDrive metadata but a future
PR will introduce `paths` pkg support to create these.

## Type of change

Please check the type of change your PR introduces:
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 🐹 Trivial/Minor

## Issue(s)

#388 

## Test Plan

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-08-31 18:39:18 +00:00
Danny
305de77188
Iterate-Test Suite Move (#701)
Test suite move of iterator functions from `exchange-service-test.go` to `iterators_test.go`
2022-08-31 17:55:36 +00:00
Danny
b5a5378113
GC: Restore: Retrieve CalendarID Feature (#687)
Feature added to be able to retrieve containerID for `exchange.Event` types.
2022-08-31 17:28:57 +00:00
Keepers
7a8c6eaf78
clean up/simplify filter packagee (#695) 2022-08-31 16:43:54 +00:00
Danny
068f0560e4
Issue #501: Event support (#704)
Added EventRecurs as option for backup details.
2022-08-31 10:04:13 -06:00
ashmrtn
34697efbeb
Logic to validate service/category pairs for paths (#689)
* Logic to validate service/category pairs for paths

* convert string to service or category const
* check that a given service/category pair is a valid resource type

* Add basic tests for validateServiceAndCategory
2022-08-30 23:23:55 +00:00
ashmrtn
d1bf2b90a6
Re-add logic for getting Exchange mail paths (#648)
* Re-add logic for getting Exchange mail paths

Paths can either be for an item (email) or a folder. Returned struct
provides safe access to underlying information in the path once it is
created.

* Refine tests, add struct comment

Add test to make sure Item() and Folder() work properly for a resource
that has no parent folder, just the prefix stuff.

* Rework resource-specific paths based on comments

* use a single type to represent resource specific paths
* use service/category enums to denote the resource the path represents
* update tests to check for service/category of the path
* rename exchange_path*.go -> resource_path*.go
2022-08-30 22:45:47 +00:00
Danny
67bc038c55
GC: Add WSL Linting Formatting src/internal/connector (#694)
Lint remaining of `internal/connector` package for wsl
2022-08-30 22:12:38 +00:00
Keepers
6f04321a60
replace scope values with filters (#674)
The filters package allows callers to specify both a target
to match on, and behavior of the comparison.  While data-
type scopes always equate to "equals", the control over
different comparison behavior is useful for info-type
filters.  This change integrates filters into scopes for
built-in control of those comparisons.
2022-08-30 21:29:24 +00:00