Skip to content

Commit abdb5d1

Browse files
authored
Merge branch 'main' into docs/talos-files-op-warning
2 parents b4c39ff + 4aacfc2 commit abdb5d1

6 files changed

Lines changed: 127 additions & 103 deletions

File tree

‎.github/workflows/fetch-telemetry.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v7
2323
with:
2424
ref: 'main'
2525

2626
- name: Set up Python
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
2929
python-version: '3.12'
3030

‎.github/workflows/hugo.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ jobs:
4141
- name: Install Dart Sass
4242
run: sudo snap install dart-sass
4343
- name: Checkout
44-
uses: actions/checkout@v4
44+
uses: actions/checkout@v7
4545
with:
4646
submodules: recursive
4747
fetch-depth: 0
4848
- name: Setup Pages
4949
id: pages
50-
uses: actions/configure-pages@v4
50+
uses: actions/configure-pages@v6
5151
- name: Install Node.js dependencies
5252
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
5353
- name: Download OpenAPI specs
@@ -71,7 +71,7 @@ jobs:
7171
echo -e "\nDisallow: /" >> public/robots.txt
7272
cat public/robots.txt
7373
- name: Upload artifact
74-
uses: actions/upload-pages-artifact@v3
74+
uses: actions/upload-pages-artifact@v5
7575
with:
7676
path: ./public
7777

@@ -85,5 +85,5 @@ jobs:
8585
steps:
8686
- name: Deploy to GitHub Pages
8787
id: deployment
88-
uses: actions/deploy-pages@v4
88+
uses: actions/deploy-pages@v5
8989

‎.github/workflows/update-oss-health.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919

2020
steps:
2121
- name: Checkout target repo
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v7
2323
with:
2424
ref: 'main'
2525

2626
- name: Setup Python
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
2929
python-version: '3.12'
3030

‎hack/fetch_telemetry.py‎

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
2. Filter apps to entries visible on the Cozystack dashboard.
88
3. Merge case-insensitive / Pax* / legacy-name aliases into one canonical entry
99
per application, keeping the maximum instance count (zero-count entries
10-
left after the merge are dropped from the table).
11-
4. Pull `Tenant` out of the apps map and surface it as the top-level Tenants
12-
summary card (the raw `total_tenants` field from the API is always zero).
10+
left after the merge are dropped from the table). Rows are emitted in a
11+
fixed canonical order (FIXED_ORDER) so the published table stays stable for
12+
copy-paste; apps not in that list are appended at the end (by count).
13+
4. Surface the Tenants summary card from the API `total_tenants` field (now
14+
populated per period), falling back to the point-in-time `Tenant` entry in
15+
the apps map only when `total_tenants` is zero/absent.
1316
5. Emit the payload in the shape consumed by `oss-health-app.html` +
1417
`renderTelemetry`, including `summary_cards`, `apps`, `range`.
1518
@@ -78,29 +81,48 @@
7881
}
7982

8083

84+
# Fixed canonical row order for the published table. Keeping this stable (rather
85+
# than re-sorting by count every run) means the rows always line up for copy-paste
86+
# into external spreadsheets. Apps not listed here are appended at the end, sorted
87+
# by count desc — move them into this list once they should have a stable slot.
88+
FIXED_ORDER: list[str] = [
89+
"VMDisk", "VMInstance", "Etcd", "Ingress", "Monitoring", "Kubernetes",
90+
"SeaweedFS", "Bucket", "Postgres", "MariaDB", "Harbor", "ClickHouse",
91+
"Redis", "VirtualPrivateCloud", "MongoDB", "Kafka", "OpenBAO", "RabbitMQ",
92+
"Qdrant", "NATS", "FoundationDB", "VPN", "TCPBalancer", "HTTPCache",
93+
"OpenSearch", "NFS", "ClearML",
94+
]
95+
96+
8197
def normalize_key(raw: str) -> str:
8298
return raw.lower().replace("-", "").replace("_", "")
8399

84100

85101
def clean_apps(apps: dict[str, int]) -> list[dict[str, object]]:
86-
"""Filter, dedupe (max), drop zeros, sort desc by count."""
102+
"""Filter, dedupe (max), drop zeros, order by FIXED_ORDER (extras appended)."""
87103
merged: dict[str, int] = {}
88104
for raw_name, count in apps.items():
89105
canonical = ALIASES.get(normalize_key(raw_name))
90106
if not canonical:
91107
continue
92108
if count > merged.get(canonical, 0):
93109
merged[canonical] = count
94-
non_zero = [(name, n) for name, n in merged.items() if n > 0]
95-
non_zero.sort(key=lambda item: (-item[1], item[0].lower()))
96-
return [{"name": name, "value": str(count)} for name, count in non_zero]
110+
non_zero = {name: n for name, n in merged.items() if n > 0}
111+
rank = {name: i for i, name in enumerate(FIXED_ORDER)}
112+
ordered = sorted(
113+
non_zero.items(),
114+
key=lambda item: (rank.get(item[0], len(FIXED_ORDER)), -item[1], item[0].lower()),
115+
)
116+
return [{"name": name, "value": str(count)} for name, count in ordered]
97117

98118

99119
def transform_period(raw_period: dict, label_fallback: str) -> dict | None:
100120
if not raw_period:
101121
return None
102122
apps_raw = raw_period.get("apps", {}) or {}
103-
tenants = int(apps_raw.get("Tenant", 0))
123+
# Prefer the per-period `total_tenants` field (now populated by the API);
124+
# fall back to the point-in-time `Tenant` entry only if it's zero/absent.
125+
tenants = int(raw_period.get("total_tenants") or 0) or int(apps_raw.get("Tenant", 0))
104126
clusters = int(raw_period.get("clusters", 0))
105127
total_nodes = int(raw_period.get("total_nodes", 0))
106128
avg_nodes = raw_period.get("avg_nodes_per_cluster")

‎layouts/_default/oss-health-app.html‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ <h2>${escapeHtml(payload.title)} snapshot</h2>
203203

204204
const renderTelemetry = (payload) => {
205205
const order = ["month", "quarter", "year"];
206-
const labels = { month: "Month", quarter: "Quarter", year: "Year" };
206+
// Tab switcher shows relative windows; the concrete period (e.g. "June 2026")
207+
// is shown inside via period.label in the range strip below.
208+
const labels = { month: "Last 30 days", quarter: "Last 90 days", year: "Last 12 months" };
207209
const available = order.filter((name) => payload.periods[name]);
208210
if (!available.length) {
209211
root.innerHTML = `<p class="oss-health-empty">No telemetry data available yet.</p>`;

0 commit comments

Comments
 (0)