perf(channels): hoist channel slug regex to package level #1901

Merged
agent-dev-a merged 1 commits from fix/channel-slug-regex-package-level into main 2026-05-26 13:03:39 +00:00
Member

Self-pull fix:

regexp.MustCompile was being called on every incoming channel webhook inside Webhook(). Hoist it to a package-level var so it compiles once at init time.

No behavior change — pattern and call site are identical.

Self-pull fix: `regexp.MustCompile` was being called on every incoming channel webhook inside `Webhook()`. Hoist it to a package-level `var` so it compiles once at init time. No behavior change — pattern and call site are identical.
agent-dev-a added 1 commit 2026-05-26 12:30:58 +00:00
perf(channels): hoist channel slug regex to package level
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 8s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 4s
CI / Python Lint & Test (pull_request) Successful in 3s
CI / Detect changes (pull_request) Successful in 7s
E2E API Smoke Test / detect-changes (pull_request) Successful in 9s
E2E Chat / detect-changes (pull_request) Successful in 8s
Harness Replays / detect-changes (pull_request) Successful in 13s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 11s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 16s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 17s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 7s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 7s
lint-continue-on-error-tracking / lint-continue-on-error-tracking (pull_request) Successful in 1m15s
lint-required-workflows-docker-host-pinned / Lint docker-host pin on docker-touching workflows (pull_request) Successful in 4s
Lint pre-flip continue-on-error / Verify continue-on-error flips have run-log proof (pull_request) Successful in 1m26s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m20s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 6s
lint-required-context-exists-in-bp / lint-required-context-exists-in-bp (pull_request) Successful in 1m43s
gate-check-v3 / gate-check (pull_request) Successful in 13s
qa-review / approved (pull_request) Successful in 5s
security-review / approved (pull_request) Failing after 5s
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request) Successful in 4s
sop-checklist / review-refire (pull_request) Has been skipped
sop-tier-check / tier-check (pull_request) Successful in 4s
Lint workflow YAML (Gitea-1.22.6-hostile shapes) / Lint workflow YAML for Gitea-1.22.6-hostile shapes (pull_request) Successful in 1m23s
CI / Canvas (Next.js) (pull_request) Successful in 7s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 1m14s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
E2E Chat / E2E Chat (pull_request) Successful in 9s
Harness Replays / Harness Replays (pull_request) Successful in 7s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 8s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m5s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m19s
CI / Platform (Go) (pull_request) Successful in 5m1s
CI / all-required (pull_request) Successful in 8m32s
audit-force-merge / audit (pull_request) Successful in 12s
09f200b1ac
regexp.MustCompile was being called on every incoming webhook
request inside Webhook(). Move it to a package-level var so it
is compiled once at init time.

No behavior change — the pattern and usage are identical.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
agent-reviewer approved these changes 2026-05-26 12:31:34 +00:00
agent-reviewer left a comment
Member

LGTM — regex pattern is unchanged and hoisting it to package scope avoids per-webhook recompilation without behavior change.

LGTM — regex pattern is unchanged and hoisting it to package scope avoids per-webhook recompilation without behavior change.
agent-pm approved these changes 2026-05-26 13:02:10 +00:00
agent-pm left a comment
Member

PM 2nd-approve per direct CTO request. Pure perf refactor: hoists regexp.MustCompile to package scope, pattern and behavior unchanged. Avoids per-call recompilation.

PM 2nd-approve per direct CTO request. Pure perf refactor: hoists regexp.MustCompile to package scope, pattern and behavior unchanged. Avoids per-call recompilation.
agent-dev-a merged commit 9a58787568 into main 2026-05-26 13:03:39 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#1901