diff --git a/doc/updates.md b/doc/updates.md new file mode 100644 index 0000000..e63116f --- /dev/null +++ b/doc/updates.md @@ -0,0 +1,103 @@ +# Update mechanism of Bridge + +There are mulitple options how to change version of application: +* Automatic in-app update +* Manual in-app update +* Manual install + +In-app update ends with restarting bridge into new version. Automatic in-app +update is downloading, verifying and installing the new version immediatelly +without user confirmation. For manual in-app update user needs to confirm first. +Update is done from special update file published on website. + +The manual installation requires user to download, verify and install manually +using installer for given OS. + +The bridge is installed and executed differently for given OS: + +* Windows and Linux apps are using launcher mechanism: + * There is system protected installation path which is created on first + install. It contains bridge exe and launcher exe. When users starts + bridge the launcher is executed first. It will check update path compare + version with installed one. The newer version then is then executed. + * Update mechanism means to replace files in update folder which is located + in user space. + +* macOS app does not use launcher + * No launcher, only one executable + * In-App udpate replaces the bridge files in installation path directly + + +```mermaid +flowchart LR + subgraph Frontend + U[User requests
version check] + ManIns((Notify user about
manual install
is needed)) + R((Notify user
about restart)) + ManUp((Notify user about
manual update)) + NF((Notify user about
force update)) + + ManUp -->|Install| InstFront[Install] + InstFront -->|Ok| R + InstFront -->|Error| ManIns + + U --> CheckFront[Check online] + CheckFront -->|Ok| IAFront{Is new version
and applicable?} + CheckFront -->|Error| ManIns + + IAFront -->|No| Latest((Notify user
has latest version)) + IAFront -->|Yes| CanInstall{Can update?} + CanInstall -->|No| ManIns + CanInstall -->|Yes| NotifOrInstall{Is automatic
update enabled?} + NotifOrInstall -->|Manual| ManUp + end + + + subgraph Backend + W[Wait for next check] + + W --> Check[Check online] + + Check --> NV{Has new
version?} + Check -->|Error| W + NV -->|No new version| W + IA{Is install
applicable?} + NV -->|New version
available| IA + IA -->|Local rollout
not enough| W + IA -->|Yes| AU{Is automatic\nupdate enabled?} + + AU -->|Yes| CanUp{Can update?} + CanUp -->|No| ManIns + + CanUp -->|Yes| Ins[Install] + Ins -->|Error| ManIns + Ins -->|Ok| R + + AU -->|No| ManUp + ManUp -->|Ignore| W + + + F[Force update] + F --> NF + end + + ManIns --> Web[Open web page] + NF --> Web + ManUp --> Web + R --> Re[Restart] + NF --> Q[Quit bridge] + NotifOrInstall -->|Automatic| W +``` + + +The non-trivial is to combine the update with setting change: +* turn off/on automatic in-app updates +* change from stable to beta or back + +_TODO fill flow chart details_ + + +We are not support downgrade functionality. Only some circumstances can lead to +downgrading the app version. + +_TODO fill flow chart details_ diff --git a/pkg/parallel/parallel_test.go b/pkg/parallel/parallel_test.go index 628a5dc..67805ed 100644 --- a/pkg/parallel/parallel_test.go +++ b/pkg/parallel/parallel_test.go @@ -34,7 +34,7 @@ var ( wantOutput = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} testProcessSleep = 100 // ms runParallelTimeOverhead = 150 // ms - windowsCIExtra = 250 // ms - estimated experimentally + windowsCIExtra = 500 // ms - estimated experimentally ) func TestParallel(t *testing.T) { diff --git a/pkg/store/cooldown_test.go b/pkg/store/cooldown_test.go index 88fa27f..eb96090 100644 --- a/pkg/store/cooldown_test.go +++ b/pkg/store/cooldown_test.go @@ -127,6 +127,6 @@ func TestCooldownNotSooner(t *testing.T) { assert.True(t, testCooldown.isTooSoon()) // After given wait time it shouldn't be soon anymore. - time.Sleep(waitTime / 2) + time.Sleep(waitTime/2 + time.Millisecond) assert.False(t, testCooldown.isTooSoon()) } diff --git a/test/Makefile b/test/Makefile index fd52323..45649d1 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,7 +1,7 @@ .PHONY: check-go check-godog install-godog test test-bridge test-live test-live-bridge test-stage test-debug test-live-debug bench export GO111MODULE=on -export BRIDGE_VERSION:=2.1.2+integrationtests +export BRIDGE_VERSION:=2.1.3+integrationtests export VERBOSITY?=fatal export TEST_DATA=testdata