feat(ci): add rollback mechanism and Telegram notifications

CI/CD Pipeline Improvement - Add automated rollback on deployment
failure and Telegram notifications for CI/deploy status.

Changes:
- scripts/deploy-prod.sh: Add rollback_save_image(), rollback_restore_image(),
  and telegram_notify() functions
- scripts/deploy-prod.sh: Save current Docker image before building new one
- scripts/deploy-prod.sh: Rollback to previous image on health check failure
- .gitea/workflows/ci.yaml: Add Telegram notifications for CI failures
- memento-note/eslint.config.mjs: Disable experimental React Compiler rules

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Antigravity
2026-05-27 19:36:57 +00:00
parent 5442af4c55
commit 2de66a863d
4 changed files with 211 additions and 54 deletions

View File

@@ -1,44 +1,47 @@
import { createRequire } from "module";
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
const reactCompilerRules = [
"react-hooks/hooks",
"react-hooks/capitalized-calls",
"react-hooks/static-components",
"react-hooks/use-memo",
"react-hooks/void-use-memo",
"react-hooks/preserve-manual-memoization",
"react-hooks/memo-dependencies",
"react-hooks/incompatible-library",
"react-hooks/immutability",
"react-hooks/globals",
"react-hooks/refs",
"react-hooks/memoized-effect-dependencies",
"react-hooks/exhaustive-effect-dependencies",
"react-hooks/set-state-in-effect",
"react-hooks/no-deriving-state-in-effects",
"react-hooks/error-boundaries",
"react-hooks/purity",
"react-hooks/set-state-in-render",
"react-hooks/invariant",
"react-hooks/todo",
"react-hooks/syntax",
"react-hooks/unsupported-syntax",
"react-hooks/config",
"react-hooks/gating",
"react-hooks/rule-suppression",
"react-hooks/fbt",
"react-hooks/component-hook-factories",
];
const require = createRequire(import.meta.url);
const disabledCompilerRules = Object.fromEntries(
reactCompilerRules.map((r) => [r, "off"])
);
// Manually configure Next.js ESLint without React Compiler plugin
const nextWebVitals = require("eslint-config-next/core-web-vitals");
const nextTypeScript = require("eslint-config-next/typescript");
// React Compiler rules to disable (from eslint-plugin-react-hooks v5+)
// See: https://react.dev/learn/react-compiler
const reactCompilerRules = {
"react-hooks/hooks": "off",
"react-hooks/capitalized-calls": "off",
"react-hooks/static-components": "off",
"react-hooks/use-memo": "off",
"react-hooks/void-use-memo": "off",
"react-hooks/preserve-manual-memoization": "off",
"react-hooks/memo-dependencies": "off",
"react-hooks/incompatible-library": "off",
"react-hooks/immutability": "off",
"react-hooks/globals": "off",
"react-hooks/refs": "off",
"react-hooks/memoized-effect-dependencies": "off",
"react-hooks/exhaustive-effect-dependencies": "off",
"react-hooks/set-state-in-effect": "off",
"react-hooks/no-deriving-state-in-effects": "off",
"react-hooks/error-boundaries": "off",
"react-hooks/purity": "off",
"react-hooks/set-state-in-render": "off",
"react-hooks/invariant": "off",
"react-hooks/todo": "off",
"react-hooks/syntax": "off",
"react-hooks/unsupported-syntax": "off",
"react-hooks/config": "off",
"react-hooks/gating": "off",
"react-hooks/rule-suppression": "off",
"react-hooks/fbt": "off",
"react-hooks/component-hook-factories": "off",
};
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
...nextWebVitals,
...nextTypeScript,
globalIgnores([
".next/**",
".venv-i18n/**",
@@ -52,8 +55,7 @@ const eslintConfig = defineConfig([
]),
{
rules: {
...disabledCompilerRules,
"react-hooks/exhaustive-deps": "off",
...reactCompilerRules,
"react-hooks/rules-of-hooks": "error",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",