212 Commits

Author SHA1 Message Date
Danny
402b3aae06
Exported fields removed (#433)
Exported fields removed.
2022-07-28 15:22:28 +00:00
ashmrtn
dac8c03139
Add tests for path.ExchangeMail (#428)
Tests for path.ExchangeMail were not originally included because
the functionality for them was not implemented yet
2022-07-28 15:17:51 +00:00
Danny
8bfff3c88f
Population Function Moved to Exchange Package (#429)
Functions and interfaces moved to interact properly with connector package. Fields are no longer exported until the required functions are moved to the exchange package.
2022-07-27 19:18:20 -04:00
Danny
665fa21b13
ExchangeDataCollection moved to exchange.ObjectCollection (#423)
Exchange DataCollection moved to the exchange package. Unused fields removed at this time.
2022-07-27 21:22:27 +00:00
Keepers
e35acb79ca
rename stableID to ID (#425)
embedding a baseModel means that objects like backup
have a backup.StableID, but no backup.ID nor backup.
backupID.  This could be confusing for users.  This change
swaps the value and type names, so that baseModels
include an ID value of type StableID.
2022-07-27 20:54:58 +00:00
Keepers
cc810fa3ab
introduce printable version of selectors (#424) 2022-07-27 20:14:53 +00:00
ashmrtn
e50728c0d6
Add function to get unescaped elements for a path segment (#422)
* Function and tests for returned unescaped elements

* Regression test and fix for empty segment bug

If a raw segment had no elements that had length > 0 or just didn't have
any elements it would still create a segment, throwing everything else
off. Explicitly test for that now.
2022-07-27 19:53:15 +00:00
Vaibhav Kamra
5fe9cc51aa
Build linux/amd64 image (#383)
Updates the default build options to build linux/amd64.

Fixes #378
2022-07-27 18:44:39 +00:00
Danny
34a7a1a80c
Data Collection --> Collection refactor (#415)
DataCollection changed to Collection in the repository. All associated imports changed to reflect the change.
2022-07-27 12:04:31 -04:00
ashmrtn
9b28d71705
fill in more path functions (#401)
Segment-based ctor and tests
2022-07-27 15:24:37 +00:00
Danny
3e792e69eb
Move DataCollection to data package (#414)
DataCollection moved to `/src/internal/data` directory and imports changed to recognize the move.
2022-07-27 08:04:35 -04:00
Keepers
587c239dd1
store backup operation results in the backup manifest (#410)
* store backup operation results in the backup manifest

Adds backup operation metadata like the outcome
statistics and selector definitions to the backup manifest
entry.  These additional details will appear when users
call `corso backup list`.
2022-07-26 19:35:14 +00:00
Keepers
1929b2307f
reduce filter selector flags to single strings (#393)
* reduce filter selector flags to single strings

Since it doesn't make sense for many of the filter-type
selector flags to receive multiple input values (ex: what
would --received-after date1,date2 result in?), the filter
flags are getting reduced to single-string values.
2022-07-26 10:31:34 -06:00
Keepers
350d27dcb4
Issue-271-mustfilter: add must-pass filters to selectors (#392)
* add must-pass filters to selectors

Extends the selectors scope set to include Filters.  This
allows users to define all-pass matchers (filters),
separate from any-pass matchers (includes), and global
exclusions.
2022-07-25 22:41:49 +00:00
Keepers
75e8317bf9
split users scope into per-type scopes (#412)
When a caller constructs an Users() exchange scope,
instead of building a single scope that contains all of the
provided users and all of the data beneath, follow the
pattern of the other scopes and generate one scope per
user-category pair.
2022-07-25 16:16:16 -06:00
ashmrtn
ea3c9c035e
Implement and test one path constructor and join (#398)
Implement and test one path constructor and join
2022-07-25 20:31:09 +00:00
Keepers
5a532e808e
fix errant conditional on GC restore success counter (#407) 2022-07-25 13:14:13 -06:00
Sidhartha Mani
6a9ccf2a51
add --succeed-on-exists flag to make s3 repo init idempotent (#324)
* [Minor #323] add --success-on-exists flag to make  idempotent

Co-authored-by: ryanfkeepers <ryanfkeepers@gmail.com>
Co-authored-by: Keepers <104464746+ryanfkeepers@users.noreply.github.com>
2022-07-25 18:42:24 +00:00
Keepers
e4c7538531
exports the exchangeScope selector type (#405) 2022-07-25 12:37:40 -06:00
Danny
25c781eec6
Gc edc extension (#402)
* Extension of ExchangeDataCollection for async population.
2022-07-25 12:46:17 -04:00
Keepers
9e7755cfa7
expand restore flags (#382)
* expand restore flags

Adds support for info filter flags to the restore command.
Also adds (hidden) support for event and contact data
types.  Finally, exchnages single-string flag data types for
multi-value string array support.
2022-07-25 09:43:12 -06:00
Keepers
dcbc149aa7
Build binary test separately (#399)
* refactor ci caching to ensure go test runs without downloading packages
2022-07-25 09:05:40 -06:00
Keepers
df63761537
add helpers to selector/exchange scope creation (#381)
* filter backup details by flags

`backup details` should have its output filtered by the flags provided by
the user.  In addition, the selector's FilterDetails should maintain
information (esp service info) about the entries, rather than slicing them
down to only the path reference.
2022-07-22 14:30:04 -06:00
Keepers
0739ea7e09
add info-based selector flags to backup details (#380)
* filter backup details by flags

`backup details` should have its output filtered by the flags provided by
the user.  In addition, the selector's FilterDetails should maintain
information (esp service info) about the entries, rather than slicing them
down to only the path reference.
2022-07-22 13:23:16 -06:00
ashmrtn
395c7c8525
Add spell check linter and run gofmt in golangci-lint (#396)
* Basic golangci-lint config with gofmt and timeout

Remove corresponding sections from other CI config files.

* Enable comment and string spelling linter

* Fix spelling mistakes for linter

Co-authored-by: Danny <danny@alcion.ai>
2022-07-22 18:28:25 +00:00
ashmrtn
da8ff3c267
Define struct and interface for corso paths (#339)
* Define struct and interface for corso paths
* Add wrapper for ExchangeMail as an example
2022-07-22 10:25:55 -07:00
Keepers
532922f662
introduce exchange info selector support (#379)
* introduce exchange info selector support

Adds support in selectors/exchange for queries based on
backup.ExchangeInfo entries.  This allows the declaration
of selectors based on non-identifier details such as sender,
subject, or receivedAt time.

Changes Exclude scope matching from being an Any-
match comparator to an All-match.  This keeps exclude
and include behavior identical, hopefully making less
confusion for users.
2022-07-21 15:08:03 -06:00
Danny
dfcba3bf0a
Fail-fast option added (#377)
Fail-fast option added.
2022-07-21 14:59:11 +00:00
Danny
fe92d7c9db
Issue #359: create folder enhancement added. (#375)
Issue #359: create folder feature added.
Feature required to finish task #374
2022-07-21 13:32:53 +00:00
Keepers
6224a92e7a
filter backup details by flags (#371)
* filter backup details by flags

`backup details` should have its output filtered by the flags provided by
the user.  In addition, the selector's FilterDetails should maintain
information (esp service info) about the entries, rather than slicing them
down to only the path reference.
2022-07-20 16:25:28 -06:00
Keepers
a823231afd
cache go mod in linter action (#367) 2022-07-20 09:20:22 -06:00
Vaibhav Kamra
1a31a07425
Populate ExchangeInfo correctly (#373)
Message Info added back to package.
2022-07-20 08:30:28 -04:00
Keepers
37f2c44dc7
accept backupID flag, not backupDetailsID (#370) 2022-07-20 00:22:25 +00:00
Vaibhav Kamra
9f8287dc48
Support specifying repo config via env (#363)
This allows the user to specify repo configuration via environment variables when a config file is not available.

This is a temporary fix - ideally we would leverage Viper for this but we currently only use Viper if a config file
is available so that needs to be refactored a bit.

[1]
`TENANT_ID` (already supported)
`BUCKET`
`ENDPOINT`
`PREFIX`
2022-07-19 16:42:28 -07:00
Keepers
43c024f4b2
add per-data type flags to backup details (#355)
* add per-data type flags to backup details

Adds the contacts, contact folders, emails, email folders, events,
and users flag support to `corso backup create exchange`
to enable selector support.
2022-07-19 16:38:48 -06:00
Keepers
746c88a233
refactor selector scopes to accept slices (#352)
* refactor selector scopes to accept slices

Cli flag implementation was showcasing a toil issue: building
selectors required a lot of repetitious code for combining
inputs into sets of scopes.  Since all of these productions
were effectively identical (eg: for each user, then each folder,
create a scope with the ids), the cleaner solution is to pack
that behavior into the scope constructors themselves.
2022-07-19 16:04:07 -06:00
Danny
0422b9ecbe
Restore Policy options added (#350)
* Issue #349:
Added policy for restore to code base.  Policy Items are placed in the `internal/common` directory
2022-07-19 21:28:23 +00:00
Keepers
625cf744a6
adds the onError option to operations (#347)
* adds the onError option to operations

Adds the OnError option to operations.Options.  OnError tells
corso whether to continue despite concurrent processing
errors, or to exit processing on any error.  Also includes flag
support for setting the option.  Only adds the options, does
not assert error handling behavior in corso.
2022-07-19 14:20:12 -06:00
Keepers
6d04c82992
correct count of successful status items (#366)
* correct count of successful status items
2022-07-19 13:53:42 -06:00
Keepers
6c22d5c0ce
adds store package for wrapping model_store (#346)
* adds store package for wrapping model_store

Introduces the pkg/store package, which contains funcs
for wrapping the model_store with common requests.
This package choice was made for its combination
of being in an accessible place, centralizing functionality
and not introducing circular dependencies.
2022-07-19 11:54:53 -06:00
Aarti Jivrajani
7f60c00466
[Minor] Rename cli flag folder to email-folder (#343)
rename cli flag mail to email
2022-07-19 11:21:30 -06:00
Danny
d00332f328
GC async population of m365 objects mail (#332)
-- Changes made to incorporate async population of a DataCollection
2022-07-18 21:01:58 +00:00
Danny
5a9f2e4601
GC custom errors to inherit from internal/common (#337)
Custom error package added and extended to the internal/connector package
2022-07-15 21:21:11 +00:00
Danny
ecdfbbc1a8
CI Cache Implementation (#354)
Caching adding for build and mods. Significantly improves CI `go test -v ./...`.
2022-07-15 16:54:24 -04:00
Keepers
efaa2da1bb
add --all and --data to backup create (#342)
* add --all and --data to backup create

Adds flags for backing up all exchange data, and
for isolating the data in the backup by data type.
Introduces validation and selector creation in
backup create.  Switches the --user flag variable
type from a string to a []string.
2022-07-15 10:27:20 -06:00
Keepers
bd3b2a8096
clean up leftover restorepoint var names (#344) 2022-07-14 11:48:14 -06: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
Danny
76a5d6bba3
Issue #15 adding lint to CI Pipeline. (#325)
Added golangci-lint run check to repo. Currently enables only the defaults.

https://golangci-lint.run/usage/linters
2022-07-13 22:59:58 +00:00
Vaibhav Kamra
c1c9cfe118
Address issues flagged by golangci-lint (#341) 2022-07-13 22:21:04 +00:00
Vaibhav Kamra
6f9fe0dd9e
Fix lint failures: Check return types (#338) 2022-07-13 15:43:42 -06:00