273 Commits

Author SHA1 Message Date
Julio Lopez
3619aacb46 chore(ci): remove GOEXPERIMENT=coverageredesign (#4988) 2025-11-13 21:58:56 -08:00
Julio Lopez
b7f811cfc9 chore(ci): build kopia with -trimpath (#4983)
Rationale: move towards reproducible (hermetic) builds.

The `-trimpath` flag removes absolute file system paths
from the resulting executables.

- add `-trimpath` to `KOPIA_BUILD_FLAGS`
- add `-trimpath` to `goreleaser` config
- move `KOPIA_BUILD_*` var defs to `Makefile`
2025-11-13 10:31:28 -08:00
Jarek Kowalski
2e16917518 chore(ci): enforce consistent formatting of KopiaUI code (#4586)
* chore(ci): enforce consistent formatting of KopiaUI code

* fix htmlui_changelog.sh

* fix
2025-05-20 22:33:54 -07:00
Jarek Kowalski
c4f38ea728 chore(ci): auto-generate clean htmlui changelog (#4578) 2025-05-17 18:17:34 -07:00
Jarek Kowalski
c1757a0c67 feat(general): misc notifications improvements (#4319)
* feat(general): various notifications improvements

* added API to test notification profiles
* added --http-header to webhook notification configuration
* refactored configuration to always apply defaults before persisting options in the repository
* added 'notification profile show --profile-name=X' command

* more tests

* more test coverage

* report notification code coverage
2024-12-29 09:50:20 -08:00
Jarek Kowalski
8adf978a98 feat(kopiaui): support for AppArmor on Ubuntu 24.04 (#4318) 2024-12-28 15:44:53 -08:00
Jarek Kowalski
b60cac4860 fix(cli): fixed v0.18.0 failures using v0.17.0-generated config (#4255)
This was caused by the client using key derivation algorithm
from a config file (which did not have it when it was generated
using old version of Kopia).

Fixes #4254
2024-11-17 10:15:00 -08:00
Julio López
42de08bb4e chore(ci): silence TestIndexBlobManagerStress output on failure (#4036)
Try again:

Partially reverts commit 2d2e0314d1.

Changes the approach slightly:
- Use pkgname format for gotestsum
- Test index blob v0 separately

Ref:
- #4028
- #4035
2024-08-07 14:52:21 -07:00
Julio López
2d2e0314d1 Revert "chore(ci): silence TestIndexBlobManagerStress output on failure (#4028)" (#4035)
This reverts commit 5f57b79dc0.
2024-08-07 10:29:48 -07:00
Julio López
5f57b79dc0 chore(ci): silence TestIndexBlobManagerStress output on failure (#4028) 2024-08-05 15:56:49 -07:00
Jarek Kowalski
f8a46b9b93 chore(ci): re-enable KopiaUI build on macOS (#3992) 2024-07-20 21:30:37 -07:00
Jarek Kowalski
09415e0c7d chore(ci): upgraded to go 1.22 (#3746)
Upgrades go to 1.22 and switches to new-style for loops

---------

Co-authored-by: Julio López <1953782+julio-lopez@users.noreply.github.com>
2024-04-08 09:52:47 -07:00
Jarek Kowalski
7278f570e2 chore(ci): upgraded linter to 1.57.1 (#3753) 2024-03-25 22:20:38 -07:00
Jarek Kowalski
70ae6a2c81 chore(ci): install apple notarization key before build (#3715)
This should recent regression after Electron upgrade.

Fixes #3711
2024-03-08 23:41:27 -08:00
Maxim Khitrov
f62ef51700 feat(snapshots): Implement volume shadow copy support on Windows (#3543)
* Implement volume shadow copy support on Windows

* Update go-vss version

* Fix unused variables

* Rename upload_actions*.go files

* Move vss settings to a separate policy section

* Handle existing shadow copy root

* Fix tests

* Fix lint issues

* Add cli policy test

* Add OS snapshot integration test

* Add GitHub Actions VSS test

* Fix "Incorrect function" error for root VSS snapshots

* Rename err to finalErr in createOSSnapshot

* Add OSSnapshotMode test

* Do not modify paths starting with \\?\ on Windows

* Allow warning messages in logfile tests

* Fix ignorefs not wrapping OS snapshot directory

* Retry VSS creation if another op was in progress

---------

Co-authored-by: Jarek Kowalski <jaak@jkowalski.net>
2024-02-03 21:44:41 -08:00
PhracturedBlue
0f608ff18c test(cli): Attempt to fix socket-activated tests (#3318) 2023-09-18 21:47:39 -07:00
Jarek Kowalski
53d799ee51 chore(ci): skip license check for non-dev dependencies since we don't ship those (#3121) 2023-07-03 22:59:01 -07:00
Jarek Kowalski
cbc66f936d chore(ci): upgraded linter to 1.53.3 (#3079)
* chore(ci): upgraded linter to 1.53.3

This flagged a bunch of unused parameters, so the PR is larger than
usual, but 99% mechanical.

* separate lint CI task

* run Lint in separate CI
2023-06-18 13:26:01 -07:00
Jarek Kowalski
7f69502bdd chore(ci): test commit (#2987) 2023-04-29 23:11:57 -07:00
Jarek Kowalski
f4dae8dea4 chore(ci): trigger CI rebuild after signing key update (#2950) 2023-04-16 22:34:42 -07:00
Aaron Alpar
c65613ccba feat(cli): ability to read repository status ... (#2799)
* fix spelling

* permissive index read

* fixup v1 permissive index

* fixups for lint

* trigger rebuild

* Update repo/local_config.go

Co-authored-by: Shikhar Mall <mall.shikhar.in@gmail.com>

* rename permissive read flag

* extend "permissive-read" rename

* hide permissive command-line flag

* syntax fixup

* fixup for test

* fixups for tests

* Update .golangci.yml

Co-authored-by: Shikhar Mall <mall.shikhar.in@gmail.com>

---------

Co-authored-by: Shikhar Mall <mall.shikhar.in@gmail.com>
2023-03-27 16:08:11 -07:00
Jarek Kowalski
ca59ae3d0a chore(ui): update to latest htmlui (#2851) 2023-03-27 00:34:32 +00:00
Jarek Kowalski
e6612977b7 feat(server): improved server shutdown and integration tests (#2722)
* feat(server): improved server shutdown and integration tests

Added `--shutdown-grace-period` flag to `kopia server start` command
which can be used to specify how long the server will wait for active
connections to finish before forcibly shutting down.

This allowed removal of final out-of-process execution of
during integration tests and the need for `integration-tests` target
which was running the same tests as `tests` but in out-of-process mode.

We thus now have all the test coverage in-process without having to
build and launch `kopia` binary.

* fixed logging

* increase test timeout

* speed up and/or parallelize longest-running tests
2023-02-01 22:19:32 -08:00
Jarek Kowalski
f69424961f chore(ci): upgrade golang to 1.19.2 and linter to 1.50.1 (#2526)
Lack of generics support is blocking various dependency upgrades,
so this unblocks that.

Temporarily disabled `checklocks` linter until it is fixed upstream.
2022-10-28 11:02:47 -07:00
Jarek Kowalski
09575943f8 test(ui): added minimal automated KopiaUI test (#2434)
* test(ui): added minimal automated KopiaUI test

```
$ make kopia-ui-test
```

This currently executes super minimal E2E test on pre-built KopiaUI
using Playwright https://playwright.dev

* better os/arch detection

* remove unwanted log

* fixed executable path on linux

* fix for linux, misc
2022-09-23 17:37:36 -07:00
Jarek Kowalski
09453d8ae9 fix(ci): fixed the root cause of the HTMLUI test flake (#2387) 2022-09-09 03:21:50 +00:00
chaitalisg
b61a7627e9 test(general): Add test for snapshot fix command (#2018)
* add robustness test for snapshot fix commands

* temporary change to see if plumbing works

* add robustness test for snapshot fix commands

* temporary change to see if plumbing works

* debug

* revert changes to robustness main_test

* Move recovery tests to a new package

* Revert unwanted changes

* Updated make target

* Temporary change for a pipeline run

* Resolve go package issues

* Remove local path used for debugging

* Debugging

* Debugging

* Add new orchestration script for recovery test

* Add comments

* Add comments

* Revert changes to robustness job script

* Remove unawanted files

* Change permissions for the orchestration script

* Fix typo

* Executable

* Update orchestration script

* Fix linter errors

* Fix linter errors

* Fix linter errors

* fix: linter grouping issue

* Fix linter errors

* Fix linter errors

* Update tests/recovery/blobmanipulator/blobmanipulator.go

Co-authored-by: Aaron Alpar <55999015+aaron-kasten@users.noreply.github.com>

* Implement feedback

* Implement feedback

* Fix linter errors

* Address feedback

* Add maintenance functions

* Added mechanism to interrupt kopia operation during the test run

* Fix linter errors

* Revert debugging changes

* Fix linter errors

* Fix linter errors

* Replace syscall

* Skip test when KOPIA_EXE is not set

* Remove debugging changes

* Add kopia command interruption to simulate corruption

* Check if command is running before killing

* Delete a snapshot before calling maintenance

* Remove nil check for the process

Co-authored-by: Shikhar Mall <small@kopia.io>
Co-authored-by: Aaron Alpar <55999015+aaron-kasten@users.noreply.github.com>
2022-08-09 09:44:18 -07:00
Jarek Kowalski
51dcaa985d chore(ci): upgraded linter to 1.48.0 (#2294)
Mechanically fixed all issues, added `lint-fix` make target.
2022-08-09 06:07:54 +00:00
Jarek Kowalski
8515d050e5 test(infra): improved support for in-process testing (#2169)
* feat(infra): improved support for in-process testing

* support for killing of a running server using simulated Ctrl-C
* support for overriding os.Stdin
* migrated many tests from the exe runner to in-process runner

* added required indirection when defining Envar() so we can later override it in tests

* refactored CLI runners by moving environment overrides to CLITestEnv
2022-07-09 18:22:50 -07:00
Jarek Kowalski
9941a05ab1 chore(ui): upgraded UI (#2157)
* https://github.com/kopia/htmlui/pull/88
* https://github.com/kopia/htmlui/pull/90
* https://github.com/kopia/htmlui/pull/89
* https://github.com/kopia/htmlui/pull/84
* https://github.com/kopia/htmlui/pull/85
2022-07-07 03:54:11 +00:00
Jarek Kowalski
d25e2ad026 feat(infra): added make kopia-ui-with-local-htmlui-changes (#2062)
This allows building of KopiaUI with local changes make to htmlui/
repository.

In order for this to work you must have 3 repositories checked out
side-by-side:

* https://github.com/kopia/kopia
* https://github.com/kopia/htmlui
* https://github.com/kopia/htmluibuild
2022-06-18 22:49:39 +00:00
Julio Lopez
3d1de6f27a chore(general): minor cleanups (#1959)
- expand command flag description for clarification
- include blob id in blob get error in the cache
- nit: remove unused BOTO_PATH
- nit: fix comment
- cleanup: remove unnecessary function declaration in interface
- leverage 'testify' to simplify test
2022-05-23 15:16:25 -07:00
Jarek Kowalski
daa62de3e4 chore(ci): added checklocks static analyzer (#1838)
From https://github.com/google/gvisor/tree/master/tools/checklocks

This will perform static verification that we're using
`sync.Mutex`, `sync.RWMutex` and `atomic` correctly to guard access
to certain fields.

This was mostly just a matter of adding annotations to indicate which
fields are guarded by which mutex.

In a handful of places the code had to be refactored to allow static
analyzer to do its job better or to not be confused by some
constructs.

In one place this actually uncovered a bug where a function was not
releasing a lock properly in an error case.

The check is part of `make lint` but can also be invoked by
`make check-locks`.
2022-03-19 22:42:59 -07:00
Jarek Kowalski
e591f4b79b chore(ci): skip non-deterministic tests when computing code coverage (#1817) 2022-03-09 07:42:01 -08:00
Jarek Kowalski
9d63e56bb9 feat(cli): improved formatting of 'policy show' outputs (#1767) 2022-02-22 22:21:48 -08:00
Jarek Kowalski
d3edab594e build(ci): added rclone 1.57.0 to Docker container images (#1718)
* build(ci): added rclone 1.57.0 to Docker container images

/bin/rclone is configured to use config in /app/rclone/rclone.conf
so the user can pass -v ~/.config/rclone:/app/rclone

* pr feedback
2022-02-02 21:06:43 -08:00
Jarek Kowalski
7d1bfb2070 feat(ci): automatically publish official releases (#1693) 2022-01-30 11:00:51 -08:00
Jarek Kowalski
9cad0edb53 test(ui): added end-to-end HTML UI test (#1686)
* test(general): refactored parsing of server output

* test(ui): added experimental end-to-end test using chromedp
2022-01-29 01:34:45 -08:00
Jarek Kowalski
e030c15803 fix(ci): generate changelog as part of the build (#1679) 2022-01-23 16:58:33 -08:00
Jarek Kowalski
c2ab5020dc build(ci): auto-generate change log (#1678) 2022-01-23 15:22:11 -08:00
Jarek Kowalski
41a62a7139 chore(ci): do not linter on linux/{arm,arm64} (#1677) 2022-01-23 14:56:13 -08:00
Julio Lopez
5bf8e7c570 Allow building without UI (#1614) 2021-12-21 20:19:27 -08:00
Jarek Kowalski
daacc6a8f4 htmlui: moved HTML UI to separate repository (#1600)
The source code for htmlui is now in github.com/kopia/htmlui
GitHub Actions will drop compiled builds in github.com/kopia/htmluibuild
where they are now used as a go module dependency.

This greatly simplifies the build and improves the security,
because Kopia will be consuming pre-built htmlui.

This also means kopia can now installed with embedded UI using:
`go install github.com/kopia/kopia@latest`
2021-12-18 12:28:30 -08:00
Jarek Kowalski
b81362d72c testing: do not run randomized tests in code coverage mode (#1585) 2021-12-13 22:07:50 -08:00
Jarek Kowalski
8a4ac4dec3 Upgraded linter to 1.43.0 (#1505)
* fixed new gocritic violations
* fixed new 'contextcheck' violations
* fixed 'gosec' warnings
* suppressed ireturn and varnamelen linters
* fixed tenv violations, enabled building robustness tests on arm64
* fixed remaining linux failures
* makefile: fixed 'lint-all' target when running on arm64
* linter: increase deadline
* disable nilnil linter - to be enabled in separate PR
2021-11-11 17:03:11 -08:00
Jarek Kowalski
e7ed4951d6 ci: also build armv7l version of KopiaUI (#1483)
Also fixed embedded server paths for KopiaUI.

Fixes #1448
2021-11-04 16:50:47 -07:00
Julio Lopez
0629d007fc nit: remove spurious space in Makefile commands (#1311) 2021-09-22 13:44:46 -07:00
Jarek Kowalski
928150fe6b linter: upgrade to 1.42.1 (#1292) 2021-09-14 19:11:39 -07:00
Jarek Kowalski
bd7e9641da fixed minor buffer leak from internal logger, added allocation tracker (#1290) 2021-09-14 06:13:19 -07:00
Jarek Kowalski
8b2b91f9f9 content: fixed repo upgrade version (#1286)
* content: fixed repo upgrade version

Previously upgrade would enable epoch manager and index v2 but would
not set the version of the format itself. Everything worked fine
but it would not protect from old kopia opening the repository.

* ci: added compatibility test that uses real 0.8 and current binaries
2021-09-10 22:51:51 -07:00