mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-08-06 12:59:34 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2057bbdf3d | |||
| 619c7e1d2b |
@@ -1,81 +0,0 @@
|
||||
name: KB refresh (helm-dashboard)
|
||||
|
||||
# TWICE-DAILY batched refresh of this repo's knowledge-base record. Mirrors the mono
|
||||
# kb-refresh pattern, adapted for a single repo: on a schedule we diff
|
||||
# `kb-refresh-last..HEAD` — `kb-refresh-last` is a lightweight marker tag this workflow
|
||||
# moves to HEAD after each successful run — and if anything changed in that window we
|
||||
# trigger the KB Buildkite pipeline with CHANGED=helm-dashboard so the `repos/helm-dashboard` KB
|
||||
# record regenerates (deterministic + AI). The KB repo is updated; this repo is never
|
||||
# modified (only its lightweight marker tag is moved). No-change runs are skipped to
|
||||
# save tokens. The KB pipeline's nightly full rebuild is the backstop.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 11,20 * * *' # 11:00 & 20:00 UTC — batches all merges since the previous run
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write # to move the kb-refresh-last marker tag
|
||||
|
||||
jobs:
|
||||
refresh:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout (full history + tags to diff since last run)
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Detect changes since last run
|
||||
id: detect
|
||||
run: |
|
||||
MARKER="kb-refresh-last"
|
||||
# Diff from the marker tag set by the previous successful run to HEAD.
|
||||
# First run / missing tag -> fall back to the last 24h of history (the KB
|
||||
# pipeline's nightly full rebuild is the backstop for anything this misses).
|
||||
if git rev-parse -q --verify "refs/tags/${MARKER}" >/dev/null; then
|
||||
BASE=$(git rev-list -n1 "refs/tags/${MARKER}")
|
||||
else
|
||||
BASE=$(git rev-list -n1 --before="24 hours ago" "$GITHUB_SHA" || true)
|
||||
fi
|
||||
[ -z "$BASE" ] && BASE="${GITHUB_SHA}^"
|
||||
echo "Diff base: $BASE"
|
||||
# Single-repo: any non-empty diff in the window -> refresh this repo's record.
|
||||
if [ -n "$(git diff --name-only "$BASE" "$GITHUB_SHA")" ]; then
|
||||
echo "changed=helm-dashboard" >> "$GITHUB_OUTPUT"
|
||||
echo "Changes detected since last run -> refreshing helm-dashboard."
|
||||
else
|
||||
echo "changed=" >> "$GITHUB_OUTPUT"
|
||||
echo "No changes since last run -> nothing to refresh."
|
||||
fi
|
||||
|
||||
- name: Trigger knowledge-base pipeline (targeted refresh)
|
||||
if: steps.detect.outputs.changed != ''
|
||||
env:
|
||||
BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_API_TOKEN }}
|
||||
BK_ORG: komodor # Buildkite org slug (NOT the GitHub org "komodorio")
|
||||
BK_PIPELINE: knowledge-base
|
||||
CHANGED: ${{ steps.detect.outputs.changed }}
|
||||
run: |
|
||||
if [ -z "$BUILDKITE_API_TOKEN" ]; then echo "BUILDKITE_API_TOKEN not set — skipping."; exit 0; fi
|
||||
payload=$(printf '{"commit":"HEAD","branch":"master","message":"KB refresh — %s","env":{"CHANGED":"%s"}}' "$CHANGED" "$CHANGED")
|
||||
resp=$(curl -sS -w $'\n%{http_code}' -X POST \
|
||||
"https://api.buildkite.com/v2/organizations/${BK_ORG}/pipelines/${BK_PIPELINE}/builds" \
|
||||
-H "Authorization: Bearer ${BUILDKITE_API_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$payload")
|
||||
code=${resp##*$'\n'}; body=${resp%$'\n'*}
|
||||
echo "$body"
|
||||
if [ "$code" -ge 200 ] && [ "$code" -lt 300 ]; then
|
||||
echo "Triggered KB refresh for: ${CHANGED} [HTTP $code]."
|
||||
else
|
||||
echo "::error::Buildkite trigger failed (HTTP $code): $body"; exit 1
|
||||
fi
|
||||
|
||||
- name: Advance the kb-refresh-last marker
|
||||
run: |
|
||||
# Reached when the trigger succeeded or there was nothing to refresh (a failed
|
||||
# trigger exits non-zero above and skips this, so the window is retried next
|
||||
# run). Move the marker forward; pushing a lightweight tag — never the branch.
|
||||
git tag -f kb-refresh-last "$GITHUB_SHA"
|
||||
git push -f origin refs/tags/kb-refresh-last
|
||||
Generated
+13
-27
@@ -26,7 +26,7 @@
|
||||
"react-icons": "^5.5.0",
|
||||
"react-intersection-observer": "^10.0.3",
|
||||
"react-modern-drawer": "^1.4.0",
|
||||
"react-router": "^7.13.0",
|
||||
"react-router": "^8.3.0",
|
||||
"react-select": "^5.10.2",
|
||||
"swagger-ui-react": "^5.31.2",
|
||||
"uuid": "^14.0.0"
|
||||
@@ -5585,18 +5585,11 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
|
||||
"integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
"node_modules/cookie-es": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-3.1.1.tgz",
|
||||
"integrity": "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/copy-to-clipboard": {
|
||||
"version": "3.3.3",
|
||||
@@ -11177,20 +11170,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "7.15.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.15.1.tgz",
|
||||
"integrity": "sha512-R8rl9HhgikFYoPJymnUtPXWbnDb3oget6lQnfIoupbt61aT9aOhRkDsY2XRhZRyX1Z/8a5sL74fXmFNm3NRK5A==",
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-8.3.0.tgz",
|
||||
"integrity": "sha512-qyPMvW83jGIct3yiieisxdk9M745anqhpIMKN5m1t6yBMfgVPpt77aHOqs5fUlEJRMCGffg9BaQLH9oPVOL7xQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cookie": "^1.0.1",
|
||||
"set-cookie-parser": "^2.6.0"
|
||||
"cookie-es": "^3.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
"node": ">=22.22.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=18",
|
||||
"react-dom": ">=18"
|
||||
"react": ">=19.2.7",
|
||||
"react-dom": ">=19.2.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react-dom": {
|
||||
@@ -11768,12 +11760,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/set-cookie-parser": {
|
||||
"version": "2.7.2",
|
||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",
|
||||
"integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/set-function-length": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
"react-icons": "^5.5.0",
|
||||
"react-intersection-observer": "^10.0.3",
|
||||
"react-modern-drawer": "^1.4.0",
|
||||
"react-router": "^7.13.0",
|
||||
"react-router": "^8.3.0",
|
||||
"react-select": "^5.10.2",
|
||||
"swagger-ui-react": "^5.31.2",
|
||||
"uuid": "^14.0.0"
|
||||
|
||||
+9
-15
@@ -2880,10 +2880,10 @@ convert-source-map@^2.0.0:
|
||||
resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz"
|
||||
integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==
|
||||
|
||||
cookie@^1.0.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz"
|
||||
integrity sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==
|
||||
cookie-es@^3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/cookie-es/-/cookie-es-3.1.1.tgz#c4a8a16cf88cb5a185b23f4a61d6e9a85eb53287"
|
||||
integrity sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==
|
||||
|
||||
copy-to-clipboard@^3.3.1:
|
||||
version "3.3.3"
|
||||
@@ -5732,13 +5732,12 @@ react-refresh@^0.18.0:
|
||||
resolved "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz"
|
||||
integrity sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==
|
||||
|
||||
react-router@^7.13.0:
|
||||
version "7.15.1"
|
||||
resolved "https://registry.yarnpkg.com/react-router/-/react-router-7.15.1.tgz#0a12fece05887a47c54970480745385c793bcaac"
|
||||
integrity sha512-R8rl9HhgikFYoPJymnUtPXWbnDb3oget6lQnfIoupbt61aT9aOhRkDsY2XRhZRyX1Z/8a5sL74fXmFNm3NRK5A==
|
||||
react-router@^8.3.0:
|
||||
version "8.3.0"
|
||||
resolved "https://registry.yarnpkg.com/react-router/-/react-router-8.3.0.tgz#b7bc69c3e3833ba79ebf892aef03d62b649508f8"
|
||||
integrity sha512-qyPMvW83jGIct3yiieisxdk9M745anqhpIMKN5m1t6yBMfgVPpt77aHOqs5fUlEJRMCGffg9BaQLH9oPVOL7xQ==
|
||||
dependencies:
|
||||
cookie "^1.0.1"
|
||||
set-cookie-parser "^2.6.0"
|
||||
cookie-es "^3.1.1"
|
||||
|
||||
react-select@^5.10.2:
|
||||
version "5.10.2"
|
||||
@@ -6062,11 +6061,6 @@ serialize-error@^8.1.0:
|
||||
dependencies:
|
||||
type-fest "^0.20.2"
|
||||
|
||||
set-cookie-parser@^2.6.0:
|
||||
version "2.7.2"
|
||||
resolved "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz"
|
||||
integrity sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==
|
||||
|
||||
set-function-length@^1.2.2:
|
||||
version "1.2.2"
|
||||
resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz"
|
||||
|
||||
Reference in New Issue
Block a user