fix(guide-ci): Slack notify must not fail the deploy #9

Merged
hiveiq merged 2 commits from fix/slack-notify-nonfatal into develop 2026-07-08 14:23:06 -04:00
3 changed files with 10 additions and 6 deletions
+6 -2
View File
@@ -86,6 +86,7 @@ jobs:
# org secret; if unset the step no-ops so forks/dry-runs don't error.
- name: Notify Slack (#hiveops-dev-deploy)
if: always()
continue-on-error: true # a notification must NEVER fail the deploy
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
JOB_STATUS: ${{ job.status }}
@@ -98,7 +99,8 @@ jobs:
run: |
[ -z "$SLACK_WEBHOOK_URL" ] && { echo "no SLACK_WEBHOOK_URL secret — skipping"; exit 0; }
SHORT="${SHA:0:8}"
SUBJECT="$(printf '%s' "$COMMIT_MSG" | head -n1 | tr -d '"\\' | cut -c1-100)"
FIRST="${COMMIT_MSG%%$'\n'*}" # first line via param-expansion (no pipe)
SUBJECT="$(printf '%s' "$FIRST" | tr -d '"\\' | cut -c1-100)"
if [ "$JOB_STATUS" = "success" ]; then
COLOR="#2eb67d"; TITLE=":white_check_mark: guide → bcos.dev deployed"
else
@@ -106,4 +108,6 @@ jobs:
fi
PAYLOAD=$(printf '{"attachments":[{"color":"%s","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"*%s*"}},{"type":"section","fields":[{"type":"mrkdwn","text":"*Commit*\\n`%s` %s"},{"type":"mrkdwn","text":"*Branch*\\n%s"},{"type":"mrkdwn","text":"*By*\\n%s"},{"type":"mrkdwn","text":"*Run*\\n#%s"}]},{"type":"actions","elements":[{"type":"button","text":{"type":"plain_text","text":"View run"},"url":"%s"}]}]}]}' \
"$COLOR" "$TITLE" "$SHORT" "$SUBJECT" "$REF_NAME" "$ACTOR" "$RUN_NUMBER" "$RUN_URL")
curl -s -X POST -H 'Content-type: application/json' --data "$PAYLOAD" "$SLACK_WEBHOOK_URL"
# Non-fatal: capture the HTTP code, never let curl's exit fail the step.
code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 -X POST -H 'Content-type: application/json' --data "$PAYLOAD" "$SLACK_WEBHOOK_URL" || echo "curl-error")
echo "slack notify HTTP: $code (200 = card posted; anything else = runner could not reach Slack)"
@@ -10,7 +10,7 @@ audience: dev
## Responsibility
`hiveops-journal` receives raw ATM journal files from agents (chunked upload), stores the originals on disk, and parses them into structured transactions using YAML rules (VC journal format + TCR rules). It also detects missing journal dates per ATM (gaps), archives old transactions (90-day hot/cold split), and exposes a REST API consumed by the incident/devices frontends. It replaces the legacy SmartJournal dependency. See [platform.service-ownership].
`hiveops-journal` receives raw ATM journal files from agents (chunked upload), stores the originals on disk, and parses them into structured transactions using YAML rules (VC journal format + TCR rules). It also detects missing journal dates per ATM (gaps), archives old transactions (90-day hot/cold split), and exposes a REST API consumed by the incident/devices frontends. It replaces the legacy journal-parsing dependency. See [platform.service-ownership].
Runs as **one image, two roles** driven by `JOURNAL_ROLE`:
- `upload` (default) — HTTP controllers, scheduled jobs, Kafka **producer**.
+3 -3
View File
@@ -53,11 +53,11 @@ def main():
for repo in sorted(glob.glob(os.path.join(ROOT, "hiveops-*"))):
name = os.path.basename(repo)
svc = name[len("hiveops-"):]
# non-service / special repos, and DEPRECATED ones (qds-monitor + smartjournal were the
# early incident bridge before the agent shipped — superseded, don't document)
# non-service / special repos, and the DEPRECATED qds-monitor (the early incident
# bridge before the agent shipped — superseded, don't document)
if svc in ("agent","guide","bom","security-common","template","docs","release",
"devops","integration","tools","adoons",
"qds-monitor","smartjournal"): # last line = deprecated
"qds-monitor"): # last entry = deprecated
continue
if not os.path.isdir(repo) or not has_backend(repo):
continue