300 Commits

Author SHA1 Message Date
dependabot[bot]
c64dd5f128
⬆️ Bump github.com/spf13/viper from 1.12.0 to 1.13.0 in /src (#1370)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.12.0 to 1.13.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/spf13/viper/releases">github.com/spf13/viper's releases</a>.</em></p>
<blockquote>
<h2>v1.13.0</h2>
<p><strong>Important:</strong> This is the last release supporting Go 1.15.</p>
<h2>What's Changed</h2>
<h3>Exciting New Features 🎉</h3>
<ul>
<li>Add etcd3 to supported remote providers by <a href="https://github.com/franklinkim"><code>@​franklinkim</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1371">spf13/viper#1371</a></li>
</ul>
<h3>Enhancements 🚀</h3>
<ul>
<li>Fix go-staticcheck failures (ST1005) by <a href="https://github.com/mjmaisey"><code>@​mjmaisey</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1373">spf13/viper#1373</a></li>
<li>Use jsonc in markdown codeblocks for better readability by <a href="https://github.com/HurSungYun"><code>@​HurSungYun</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1393">spf13/viper#1393</a></li>
<li>Add Go 1.19 support by <a href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1424">spf13/viper#1424</a></li>
<li>Adds support for uint16 with <code>GetUint16</code> by <a href="https://github.com/oxisto"><code>@​oxisto</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1405">spf13/viper#1405</a></li>
<li>Add a DebugTo convenience funtion by <a href="https://github.com/bcrochet"><code>@​bcrochet</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1414">spf13/viper#1414</a></li>
</ul>
<h3>Bug Fixes 🐛</h3>
<ul>
<li>Recurse into arrays when converting keys to lowercase by <a href="https://github.com/awrichar"><code>@​awrichar</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1387">spf13/viper#1387</a></li>
</ul>
<h3>Dependency Updates ⬆️</h3>
<ul>
<li>build(deps): bump github.com/stretchr/testify from 1.7.1 to 1.7.2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1374">spf13/viper#1374</a></li>
<li>build(deps): bump github.com/subosito/gotenv from 1.3.0 to 1.4.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1375">spf13/viper#1375</a></li>
<li>build(deps): bump github.com/pelletier/go-toml/v2 from 2.0.1 to 2.0.2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1378">spf13/viper#1378</a></li>
<li>build(deps): bump gopkg.in/yaml.v3 from 3.0.0 to 3.0.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1360">spf13/viper#1360</a></li>
<li>build(deps): bump github.com/stretchr/testify from 1.7.2 to 1.7.3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1381">spf13/viper#1381</a></li>
<li>build(deps): bump github.com/stretchr/testify from 1.7.3 to 1.7.4 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1384">spf13/viper#1384</a></li>
<li>build(deps): bump mheap/github-action-required-labels from 1 to 2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1383">spf13/viper#1383</a></li>
<li>build(deps): bump github.com/stretchr/testify from 1.7.4 to 1.8.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1395">spf13/viper#1395</a></li>
<li>build(deps): bump github.com/subosito/gotenv from 1.4.0 to 1.4.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1420">spf13/viper#1420</a></li>
<li>build(deps): bump github.com/pelletier/go-toml/v2 from 2.0.2 to 2.0.5 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1422">spf13/viper#1422</a></li>
<li>build(deps): bump gopkg.in/ini.v1 from 1.66.4 to 1.67.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1412">spf13/viper#1412</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/mjmaisey"><code>@​mjmaisey</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1373">spf13/viper#1373</a></li>
<li><a href="https://github.com/HurSungYun"><code>@​HurSungYun</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1393">spf13/viper#1393</a></li>
<li><a href="https://github.com/franklinkim"><code>@​franklinkim</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1371">spf13/viper#1371</a></li>
<li><a href="https://github.com/awrichar"><code>@​awrichar</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1387">spf13/viper#1387</a></li>
<li><a href="https://github.com/oxisto"><code>@​oxisto</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1405">spf13/viper#1405</a></li>
<li><a href="https://github.com/bcrochet"><code>@​bcrochet</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1414">spf13/viper#1414</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/spf13/viper/compare/v1.12.0...v1.13.0">https://github.com/spf13/viper/compare/v1.12.0...v1.13.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="57cc9a000f"><code>57cc9a0</code></a> test: fix ini tests</li>
<li><a href="8030d5b976"><code>8030d5b</code></a> build(deps): bump gopkg.in/ini.v1 from 1.66.4 to 1.67.0</li>
<li><a href="312417a0c5"><code>312417a</code></a> Add a DebugTo convenience funtion</li>
<li><a href="202060b3a2"><code>202060b</code></a> Adds support for uint16 with <code>GetUint16</code></li>
<li><a href="97591f0083"><code>97591f0</code></a> build: fix lint violations</li>
<li><a href="9af8daeeab"><code>9af8dae</code></a> ci: upgrade golangci-lint</li>
<li><a href="7b4f2b27cd"><code>7b4f2b2</code></a> ci: add Go 1.19 to CI</li>
<li><a href="601ec815ba"><code>601ec81</code></a> test: fix toml tests</li>
<li><a href="d7f4832bd3"><code>d7f4832</code></a> build(deps): bump github.com/pelletier/go-toml/v2 from 2.0.2 to 2.0.5</li>
<li><a href="c2f42f3060"><code>c2f42f3</code></a> build(deps): bump github.com/subosito/gotenv from 1.4.0 to 1.4.1</li>
<li>Additional commits viewable in <a href="https://github.com/spf13/viper/compare/v1.12.0...v1.13.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/spf13/viper&package-manager=go_modules&previous-version=1.12.0&new-version=1.13.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-11-04 02:29:16 +00:00
Keepers
953f038395
Add AWS X-Ray support (#1111)
## Description

Add aws xray observability tooling, plus ways to quickly and
easily run the tools/load tests.  Next steps are 1/ running the
daemon container alongside the load tests within github, and
2/ creating client credentials in aws's xray service so that
gathered trace info is propagated from the daemon proxy
to the xray service.

## Type of change

- [x] 🤖 Test
- [x] 💻 CI/Deployment

## Issue(s)

* #902

## Test Plan

- [x] 💪 Manual
- [x] 💚 E2E
2022-10-27 17:55:50 +00:00
Vaibhav Kamra
562c468a91
Progress bar improvements (#1302)
## Description

This adds the following functionality to the CLI progress output:
- Add a message e.g. to describe a completed stage
- Add a message describing a stage in progress (using a spinner) and trigger completion
- Add a progress tracker (as a counter) for a specified number of items (when the # items is known up front
- Improves `ItemProgress` by aligning the columns a bit better and also removing the progress bar and replacing
  with a byte counter

Finally - the above are used in the `backup` and `backup create onedrive` flows. Follow up PRs will wire these up for
exchange and the restore flows also.
 
## Type of change

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

## Issue(s)

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

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-10-24 19:52:48 +00:00
Keepers
42b9b133af
support multi-line progress display (#1138)
## Description

Extends progress bar display with multi-line support.

## Type of change

- [x] 🌻 Feature

## Issue(s)

* #1112

## Test Plan

- [x] 💪 Manual
- [x]  Unit test
2022-10-14 00:46:05 +00:00
Keepers
2cc9b7bc1d
add progress display handler and api (#1116)
## Description

Adds a new package- Observe- for owning user-
oriented displays like progress bars.  This PR adds
an initial progress bar to onedrive backups as a
proof-of-concept.  The API is more important than
the specific progress bar package at this time.
Future changes may opt for a different pkg.

Display format currently looks like:
```
59% [=============>           ] (6.9/12 kB, 14 MB/s)  |  Item_Name.txt
```

Known Issues:
* the `progressbar` package does not support multiline output, and [the author is not planning to add support](https://github.com/schollz/progressbar/issues/6).  This causes concurrent items to overwrite each other.  We will either need to fork the library, or change to a different one.  

## Type of change

- [x] 🌻 Feature

## Issue(s)

* #1112

## Test Plan

- [x] 💪 Manual
- [x]  Unit test
2022-10-10 22:53:48 +00:00
Vaibhav Kamra
3df3d68a3e
OneDrive details UX improvements (#1034)
## Description

- Rename `LastModified` to `Modified` in OneDrive backup details
- Humanize file size units

## Type of change

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

## Issue(s)

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

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-10-04 15:44:47 +00:00
Danny
c6a9d2feb6
GC Status Progress Detail Extension (#1001)
## Description
Feature to show the number of bytes and additional details for backup / restore progress from GraphConncector
Full description [here](https://www.notion.so/alcion/Corso-Testing-Notes-b9867ac719d8459d8b46dbc7b07b33e0#da3869278b434b0398e7d245554b609b)
<!-- Insert PR description-->

## 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 #559<issue>

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual

Feature Output changed to:

```go
graph_connector_test.go:137: Action: Backup performed on 5 of 5 objects (227.63KB) within 1 directories. Downloaded from Inbox
        
graph_connector_test.go:137: Action: Backup performed on 8 of 8 objects (231.28KB) within 2 directories. Downloaded from Inbox, Contacts

graph_connector_test.go:137: Action: Backup performed on 23 of 23 objects (309.36KB) within 3 directories. Downloaded from Inbox, Contacts, Calendar
```
2022-10-03 23:25:26 +00:00
ashmrtn
1a188ce657
Extra checks for kopia retention policy (#964)
## Description

Add a regression test component to the retention test. This ensures that setting all values to 0 causes it to keep MaxInt latest snapshots.

## Type of change

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

## Issue(s)

* closes #906

pending merge of
* kopia/kopia#2454

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-29 23:55:35 +00:00
Danny
1cc0cf7d1f
Versioning updated for serialization. (#960)
## Description
Abstraction and Seriailiaztion libraries updated
<!-- Insert PR description-->

## 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. -->
*Related to #956 <issue>

## Test Plan


- [x]  Unit test
2022-09-27 00:50:17 +00:00
Keepers
38addfaae8
track bytes written, read in kopia (#944)
## Description

Track the count of bytes read and written in
kopia.  For backups, this means the count of
bytes fed into kopia (hashed bytes), and the
amount written after compression and dedupe
(total file bytes).  For restore, this is the count of bytes in all files read.

## Type of change

- [x] 🌻 Feature

## Issue(s)

* #894

## Test Plan

- [x]  Unit test
- [x] 💚 E2E
2022-09-26 19:18:42 +00:00
Danny
3f3c8217a3
GC: Component: Version 40.0 (#917)
## Description
Upgrades Graph API to the newest version. Breaking change from the previous version, all functionality needs to be inspected to ensure operation.  
<!-- Insert PR description-->

## 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 #828<issue>

## Test Plan

- [x]  Unit test
- [x] 💚 E2E
2022-09-22 18:59:51 +00:00
Vaibhav Kamra
8587e7d1c2
Implement OneDrive item upload (#843)
## Description

This implements helper methods that support creating new items and uploading data from a `io.Reader` to OneDrive.

It includes an integration test that uses mock data.

## Type of change

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

## Issue(s)

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

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [x] 💚 E2E
2022-09-16 01:22:23 +00:00
Keepers
0c8a03a826
add the metrics package (#839)
## Type of change

- [x] 🌻 Feature

## Issue(s)

* #741

## Test Plan

- [ ] 💪 Manual
- [ ]  Unit test
- [x] 💚 E2E
2022-09-15 00:28:02 +00:00
Keepers
25ce11b2c6
deduplicate shared exchange code in cli (#732) 2022-09-09 18:30:15 -06: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
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
ashmrtn
e8e4bf0914
WIP 316 kopia upload errors (#330)
* Update to kopia with required callback

* Support structs for materializing backup details

Kopia will not allow us to pass data to it that should be passed back to
us in the `FinishedFile` callback. To work around this, create a small
thread-safe support struct that handles information about files kopia is
currently processing. Entries are removed from the set when kopia is
done with them and if no error occurred, the item's info will be added
to the BackupDetails.

* Switch to best attempt for iterating through files

Defaulting to "best-attempt" error handling where all data that didn't
result in an error is handed to kopia and then all errors encountered
are returned at the end.

* Test for uploads that have an error

Simple error reading a file. BackupDetails should not contain
information about the file that had the error (needs update to kopia
code and this code to pass). All other files should be present in kopia
and in BackupDetails.

Co-authored-by: Danny <danny@alcion.ai>
2022-08-23 08:18:29 -07:00
ashmrtn
7d057dd2ac
Update to kopia with StreamingFile caching (#617) 2022-08-22 15:31:12 +00:00
Danny
3e1a060f6a
Upgrade msgraph-sdk-go version from 28 to 34 (#612)
Upgrade graph version from 28 to 34. No changes to source code
2022-08-19 15:51:00 +00:00
ashmrtn
ea1cdcf119
Update to current HEAD of kopia's main branch (#534)
Pull in recent patches allowing the use of AWS IAM credentials
instead of tokens.
2022-08-12 13:13:57 -07:00
Keepers
9326690338
autopopulate cli markdown on ci build (#453) 2022-08-04 16:46:14 -06:00
Keepers
babf8b8d95
replace operation Successful with Completed (#426) 2022-07-29 21:25:02 +00:00
Keepers
aca3d856af
add printable backup struct and tabular formatting (#435) 2022-07-28 19:25:16 +00:00
Keepers
105fd7383a
add e2e backup-restore integration test (#311)
* 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.
2022-07-14 09:00:55 -06:00
Keepers
39c85e1a84
add output formatting control to cli (#329)
* add output formatting control to cli

Adds the capacity for the CLI to output either a
text table or a json blob to the terminal.  Table is
the default behavior, json is toggled with the --json
flag.
2022-07-13 14:15:08 -06:00
Vaibhav Kamra
e5f5c38d4e
Add tools dependency (#313)
Adding tools.go allows us to declare a dependency on the stringer package (used for go generate)

Reference: https://play-with-go.dev/tools-as-dependencies_go115_en/
2022-07-11 08:47:15 -07:00
Danny
60ab132960
GC: Create Consistent Snapshot (#292)
GraphConnector: Query consistency feature added
See document for implementation details: [document](https://www.notion.so/alcion/GraphConnector-RestorePoint-Consistency-for-Queries-81cce329c6e84cd79121cda0d511e1f6)
2022-07-08 15:45:25 -04:00
Vaibhav Kamra
0a5aa8ce73
Wire up RestorePoints to backup list (#305)
Currently displays the restorepoints in tablular form. We can add json output in a follow-up using the segment-cli library.

Closes #269
2022-07-08 09:12:43 -06:00
ashmrtn
6bee4e5b41
Use latest kopia version in corso (#274)
newest release includes all changes we currently require
2022-07-05 10:57:23 -07: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
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
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
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
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
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
ashmrtn
33e8e978ba
Use version of kopia with StreamingDirectory (#156)
* Use pseudo-version to pull fork of kopia

Directs to local fork of kopia that has support for
StreamingDirectories.
2022-06-08 09:49:10 -07:00
Vaibhav Kamra
cbbd5ed0bb
Fix AWS access key override logic (#159) 2022-06-08 08:51:32 -06:00
Danny
ddc9cd2c25
Issue #144 Commit adds ability to add message id to errors (#151)
* 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.
2022-06-08 08:59:59 -04:00
Vaibhav Kamra
dbb778c569
Initialize a config file for the CLI (#148)
Initialize a config file
2022-06-07 08:53:58 -06: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
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
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
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
Vaibhav Kamra
d34175bd19
Use testify for repository tests (#88) 2022-05-27 10:25:24 -07: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
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
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
Ashlie Martinez
0734a990d2 Move/update gomode file.
Now reflects the fact that this will be cloned from github. Also place
in source directory so that all packages in the project don't need to be
`src/foo`.
2022-05-03 16:12:30 -07:00