Skip to content

Commit

Permalink
LFS migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrudnik committed Oct 29, 2023
1 parent ef390b2 commit eb876d4
Show file tree
Hide file tree
Showing 12 changed files with 406 additions and 67 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

121 changes: 121 additions & 0 deletions 0001-Split-the-IDE-run-configurations-by-OS.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
From af0b54a1418df6f4fdfd98c440aaf297b650718c Mon Sep 17 00:00:00 2001
From: Adrian Rudnik <[email protected]>
Date: Sun, 29 Oct 2023 21:52:54 +0100
Subject: [PATCH 1/5] Split the IDE run configurations by OS

---
service/.idea/runConfigurations/build.xml | 3 ---
service/.idea/runConfigurations/build_gui_only.xml | 3 ---
service/.idea/runConfigurations/build_webservice_only.xml | 3 ---
service/.idea/runConfigurations/compile_linux_binary.xml | 4 ++--
service/.idea/runConfigurations/compile_windows_binary.xml | 4 ++--
service/.idea/runConfigurations/linux_build.xml | 3 +++
service/.idea/runConfigurations/linux_build_gui_only.xml | 3 +++
service/.idea/runConfigurations/win_build.xml | 3 +++
service/.idea/runConfigurations/win_build_gui_only.xml | 3 +++
service/.idea/runConfigurations/win_build_webservice_only.xml | 3 +++
10 files changed, 19 insertions(+), 13 deletions(-)
delete mode 100644 service/.idea/runConfigurations/build.xml
delete mode 100644 service/.idea/runConfigurations/build_gui_only.xml
delete mode 100644 service/.idea/runConfigurations/build_webservice_only.xml
create mode 100644 service/.idea/runConfigurations/linux_build.xml
create mode 100644 service/.idea/runConfigurations/linux_build_gui_only.xml
create mode 100644 service/.idea/runConfigurations/win_build.xml
create mode 100644 service/.idea/runConfigurations/win_build_gui_only.xml
create mode 100644 service/.idea/runConfigurations/win_build_webservice_only.xml

diff --git a/service/.idea/runConfigurations/build.xml b/service/.idea/runConfigurations/build.xml
deleted file mode 100644
index 2a10e12..0000000
--- a/service/.idea/runConfigurations/build.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fc8d675a174860f4a0960b5620eb5226a3fcc2810b7380f4427e450118127191
-size 420
diff --git a/service/.idea/runConfigurations/build_gui_only.xml b/service/.idea/runConfigurations/build_gui_only.xml
deleted file mode 100644
index a8c6e23..0000000
--- a/service/.idea/runConfigurations/build_gui_only.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bf53dacbd3cc92f3e32db984ce55bf7ed70b82b9e21ef877a55d3c666a601701
-size 483
diff --git a/service/.idea/runConfigurations/build_webservice_only.xml b/service/.idea/runConfigurations/build_webservice_only.xml
deleted file mode 100644
index 87059c9..0000000
--- a/service/.idea/runConfigurations/build_webservice_only.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:61446f79c183ab16d6ab9ce5726a2a06aed6ce63ccd0983e1389ce4ddfcf3900
-size 483
diff --git a/service/.idea/runConfigurations/compile_linux_binary.xml b/service/.idea/runConfigurations/compile_linux_binary.xml
index a21e3bb..607f2a4 100644
--- a/service/.idea/runConfigurations/compile_linux_binary.xml
+++ b/service/.idea/runConfigurations/compile_linux_binary.xml
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e5462985250c6ad31f84a4626f3ab46e19b5e938f8f595e2d3de91eb8fe98d70
-size 556
+oid sha256:81c4d545db2314f28a5519e1dcf04d312c059b3ae59872650ec54f91a55f25a0
+size 575
diff --git a/service/.idea/runConfigurations/compile_windows_binary.xml b/service/.idea/runConfigurations/compile_windows_binary.xml
index ef87798..2990857 100644
--- a/service/.idea/runConfigurations/compile_windows_binary.xml
+++ b/service/.idea/runConfigurations/compile_windows_binary.xml
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:7606233e222800162eee246a4673b4367063f4b7d6e76004535d8d80700cd9f6
-size 725
+oid sha256:2af53bbac4f92f3da3123fc8e189e937a7ff54669e05f4666dd7b8aee45a74cb
+size 746
diff --git a/service/.idea/runConfigurations/linux_build.xml b/service/.idea/runConfigurations/linux_build.xml
new file mode 100644
index 0000000..21756cf
--- /dev/null
+++ b/service/.idea/runConfigurations/linux_build.xml
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7cba675f3be7b3158ac03fea47047730b11e52d6d9e3bfd835f1b9c251bbdbbe
+size 445
diff --git a/service/.idea/runConfigurations/linux_build_gui_only.xml b/service/.idea/runConfigurations/linux_build_gui_only.xml
new file mode 100644
index 0000000..9f7d589
--- /dev/null
+++ b/service/.idea/runConfigurations/linux_build_gui_only.xml
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e735fa99bab29b26ced842018d5d4912d294c17fd8eba048b54965b293cbc30b
+size 561
diff --git a/service/.idea/runConfigurations/win_build.xml b/service/.idea/runConfigurations/win_build.xml
new file mode 100644
index 0000000..ad7109f
--- /dev/null
+++ b/service/.idea/runConfigurations/win_build.xml
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d95de666b68aca146467e73e93e66d48895081211aa089ebae90670924ff2e49
+size 498
diff --git a/service/.idea/runConfigurations/win_build_gui_only.xml b/service/.idea/runConfigurations/win_build_gui_only.xml
new file mode 100644
index 0000000..3fd4a85
--- /dev/null
+++ b/service/.idea/runConfigurations/win_build_gui_only.xml
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5fc8af81dc185a30b3da63500a15c6aacebf3555d4b7f923e47f9811b66b3b50
+size 561
diff --git a/service/.idea/runConfigurations/win_build_webservice_only.xml b/service/.idea/runConfigurations/win_build_webservice_only.xml
new file mode 100644
index 0000000..8ba469f
--- /dev/null
+++ b/service/.idea/runConfigurations/win_build_webservice_only.xml
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5b8c34dd035f2a304f8cd3b33eb99ba780fb9551de7f94a8c7652ff6677e4afa
+size 508
--
2.42.0.windows.2

134 changes: 134 additions & 0 deletions 0002-Added-a-ui-updater-to-show-progress-on-the-app-itsel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
From c33cb7c87b2061f96fe451e310d23256ff8a6473 Mon Sep 17 00:00:00 2001
From: Adrian Rudnik <[email protected]>
Date: Sun, 29 Oct 2023 21:53:18 +0100
Subject: [PATCH 2/5] Added a ui updater to show progress on the app itself

---
service/internal/stats/progress.go | 4 +++
service/internal/ui/updater.go | 44 ++++++++++++++++++++++++++++++
service/main.go | 18 ++++++++----
3 files changed, 60 insertions(+), 6 deletions(-)
create mode 100644 service/internal/ui/updater.go

diff --git a/service/internal/stats/progress.go b/service/internal/stats/progress.go
index e3af9f9..de0fec3 100644
--- a/service/internal/stats/progress.go
+++ b/service/internal/stats/progress.go
@@ -39,3 +39,7 @@ func (p *ProcessProgress) Done() {
p.progressCount.Add(-1)
p.pushTrigger()
}
+
+func (p *ProcessProgress) IsInProgress() bool {
+ return p.progressCount.Load() > 0
+}
diff --git a/service/internal/ui/updater.go b/service/internal/ui/updater.go
new file mode 100644
index 0000000..7196d34
--- /dev/null
+++ b/service/internal/ui/updater.go
@@ -0,0 +1,44 @@
+package ui
+
+import (
+ "fyne.io/fyne/v2/canvas"
+ "github.com/adrianrudnik/ablegram/internal/stats"
+ "time"
+)
+
+type UiUpdater struct {
+ ticker *time.Ticker
+ statusText *canvas.Text
+ statusLast bool
+}
+
+func NewUiUpdater(text *canvas.Text) *UiUpdater {
+ return &UiUpdater{
+ ticker: time.NewTicker(500 * time.Millisecond),
+ statusText: text,
+ }
+}
+
+func (u *UiUpdater) Run(progress *stats.ProcessProgress) {
+ for {
+ select {
+ case <-u.ticker.C:
+ u.updateStatusText(progress)
+ }
+ }
+}
+
+func (u *UiUpdater) updateStatusText(progress *stats.ProcessProgress) {
+ if u.statusLast == progress.IsInProgress() {
+ return
+ }
+
+ if progress.IsInProgress() {
+ u.statusText.Text = "The service is processing files."
+ } else {
+ u.statusText.Text = "The service has completed all tasks."
+ }
+
+ u.statusLast = progress.IsInProgress()
+ u.statusText.Refresh()
+}
diff --git a/service/main.go b/service/main.go
index 582ec19..71629f4 100644
--- a/service/main.go
+++ b/service/main.go
@@ -14,6 +14,7 @@ import (
"github.com/adrianrudnik/ablegram/internal/pipeline"
"github.com/adrianrudnik/ablegram/internal/pusher"
"github.com/adrianrudnik/ablegram/internal/stats"
+ "github.com/adrianrudnik/ablegram/internal/ui"
"github.com/adrianrudnik/ablegram/internal/webservice"
"github.com/icza/gox/osx"
"github.com/rs/zerolog"
@@ -49,6 +50,10 @@ func main() {
filesPipeline := pipeline.NewFilesForProcessor()
resultsPipeline := pipeline.NewDocumentsToIndex()

+ // ProcessProgress is responsible in holding the current progress and
+ // notifying the frontend about it
+ progress := stats.NewProcessProgress(pusherPipeline.Chan)
+
// Kick of the webservice
go func() {
if *noWebserviceFlag {
@@ -59,10 +64,6 @@ func main() {
config.Logger = log.With().Str("module", "config").Logger()
appConfig := config.LoadWithDefaults("")

- // ProcessProgress is responsible in holding the current progress and
- // notifying the frontend about it
- progress := stats.NewProcessProgress(pusherPipeline.Chan)
-
// Metrics is responsible in keeping and communicating key metrics for the frontend
appMetrics := stats.NewMetrics(pusherPipeline.Chan)

@@ -109,15 +110,20 @@ func main() {
a.Settings().SetTheme(&ablegramTheme{})
a.SetIcon(resourceIconPng)
w := a.NewWindow("Ablegram")
+ w.SetFixedSize(true)
w.CenterOnScreen()

logo := canvas.NewImageFromResource(resourceLogoPng)
logo.FillMode = canvas.ImageFillOriginal

- text := canvas.NewText("The service is running and collecting.", color.White)
+ statusTxt := canvas.NewText("Starting up...", color.White)
quitBtn := widget.NewButton("Shut down service", func() { a.Quit() })
startBtn := widget.NewButton("Open results in browser", func() { openBrowser() })
- content := container.New(layout.NewPaddedLayout(), container.New(layout.NewVBoxLayout(), logo, text, startBtn, quitBtn))
+
+ uiUpdater := ui.NewUiUpdater(statusTxt)
+ go uiUpdater.Run(progress)
+
+ content := container.New(layout.NewPaddedLayout(), container.New(layout.NewVBoxLayout(), logo, statusTxt, startBtn, quitBtn))

w.SetContent(content)

--
2.42.0.windows.2

43 changes: 43 additions & 0 deletions 0003-Hotfix-for-empty-window-on-minimized-restore.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From d99a391ba36d5021a6b4a57c8cb057e97e856eeb Mon Sep 17 00:00:00 2001
From: Adrian Rudnik <[email protected]>
Date: Sun, 29 Oct 2023 22:33:38 +0100
Subject: [PATCH 3/5] Hotfix for empty window on minimized restore

---
service/main.go | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/service/main.go b/service/main.go
index 71629f4..db54cc0 100644
--- a/service/main.go
+++ b/service/main.go
@@ -2,6 +2,7 @@ package main

import (
"flag"
+ "fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
@@ -110,7 +111,6 @@ func main() {
a.Settings().SetTheme(&ablegramTheme{})
a.SetIcon(resourceIconPng)
w := a.NewWindow("Ablegram")
- w.SetFixedSize(true)
w.CenterOnScreen()

logo := canvas.NewImageFromResource(resourceLogoPng)
@@ -126,6 +126,10 @@ func main() {
content := container.New(layout.NewPaddedLayout(), container.New(layout.NewVBoxLayout(), logo, statusTxt, startBtn, quitBtn))

w.SetContent(content)
+ w.SetFixedSize(true)
+
+ // Hotfix for https://github.com/fyne-io/fyne/issues/4350
+ w.Resize(fyne.NewSize(1, 1))

w.ShowAndRun()

--
2.42.0.windows.2

27 changes: 27 additions & 0 deletions 0004-Added-fyne-metadata-file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 3933c598737eed52d277b58371dbc10a88069d21 Mon Sep 17 00:00:00 2001
From: Adrian Rudnik <[email protected]>
Date: Sun, 29 Oct 2023 22:49:38 +0100
Subject: [PATCH 4/5] Added fyne metadata file

---
service/FyneApp.toml | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 service/FyneApp.toml

diff --git a/service/FyneApp.toml b/service/FyneApp.toml
new file mode 100644
index 0000000..9984977
--- /dev/null
+++ b/service/FyneApp.toml
@@ -0,0 +1,8 @@
+Website = "https://www.ablegram.app"
+
+[Details]
+Icon = "assets/icon.png"
+Name = "Ablegram"
+ID = "com.ablegram.app"
+Version = "1.0.0"
+Build = 1
--
2.42.0.windows.2

Loading

0 comments on commit eb876d4

Please sign in to comment.