Skip to content

Commit 774fcf5

Browse files
committed
.github/workflows: Add generate-test-packages trigger.
1 parent 864fe2c commit 774fcf5

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ on:
88
branches:
99
- master
1010
workflow_dispatch:
11+
issue_comment:
12+
types: [created]
1113

1214
jobs:
1315
build:
16+
if: github.event_name != 'issue_comment'
1417
uses: linuxmint/github-actions/.github/workflows/do-builds.yml@master
1518
with:
1619
commit_id: master
@@ -19,3 +22,18 @@ jobs:
1922
linuxmint/mintcommon,
2023
linuxmint/xapp
2124
##############################
25+
26+
# Generate test packages when /generate-test-packages is commented on a PR
27+
generate-test-packages:
28+
if: github.event_name == 'issue_comment' && github.event.issue.pull_request
29+
uses: linuxmint/github-actions/.github/workflows/generate-test-packages.yml@master
30+
secrets: inherit
31+
with:
32+
comment_body: ${{ github.event.comment.body }}
33+
comment_user: ${{ github.event.comment.user.login }}
34+
comment_id: ${{ github.event.comment.id }}
35+
issue_number: ${{ github.event.issue.number }}
36+
############################## Comma separated list - like 'linuxmint/xapp, linuxmint/cinnamon-desktop'
37+
dependencies: >
38+
linuxmint/mintcommon,
39+
linuxmint/xapp

usr/lib/linuxmint/mintUpdate/flatpak-update-worker.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,16 @@
4646
def debug(*args):
4747
if not DEBUG_MODE:
4848
return
49+
pid = os.getpid()
4950
sanitized = [str(arg) for arg in args if arg is not None]
5051
argstr = " ".join(sanitized)
51-
print("flatpak-update-worker (DEBUG): %s" % argstr, file=sys.stderr, flush=True)
52+
print("flatpak-update-worker[%d] (DEBUG): %s" % (pid, argstr), file=sys.stderr, flush=True)
5253

5354
def warn(*args):
55+
pid = os.getpid()
5456
sanitized = [str(arg) for arg in args if arg is not None]
5557
argstr = " ".join(sanitized)
56-
print("flatpak-update-worker (WARN): %s" % argstr, file=sys.stderr, flush=True)
58+
print("flatpak-update-worker[%d] (WARN): %s" % (pid, argstr), file=sys.stderr, flush=True)
5759

5860
class FlatpakUpdateWorker():
5961
def __init__(self):
@@ -96,7 +98,11 @@ def refresh(self, init=True):
9698
if init:
9799
self.installer.init_sync()
98100

99-
self.installer.force_new_cache_sync()
101+
# Only regenerate cache if flatpak data is stale
102+
if _flatpak.flatpak_cache_is_stale(self.installer.cache.flatpak_remote_infos):
103+
self.installer.force_new_cache_sync()
104+
else:
105+
debug("Flatpak cache is still valid, skipping cache regeneration")
100106

101107
def fetch_updates(self):
102108
if self.cancellable.is_cancelled():

0 commit comments

Comments
 (0)