From 30b2dc327b73208bd651bc804555b6dd65657253 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 1 Mar 2026 13:26:40 +0100 Subject: [PATCH] fix: sync server config (bot_name, allowed_users, null-safety guards) - Add bot_name and allowed_command_users to config.yml - Add null-safety guards for context.octokit in app.js - Add debug logging for command parsing - Remove unused config sections (fork_overrides, pull_request_rules, signed_commit_strategy, ci_attestation, dependabot, change_strategy, templates, codeowners, ai_review) --- config.yml | 120 ++++------------------------------------------------- src/app.js | 5 ++- 2 files changed, 12 insertions(+), 113 deletions(-) diff --git a/config.yml b/config.yml index 9467fe8..d2669ee 100644 --- a/config.yml +++ b/config.yml @@ -3,6 +3,13 @@ # Organization to monitor organization: pulseengine +# Bot mention name (without [bot] suffix) +bot_name: temper-pulseengine + +# Users authorized to trigger commands +allowed_command_users: + - avrabe + # Target settings for repositories settings: merge: @@ -11,7 +18,6 @@ settings: allow_rebase_merge: true delete_branch_on_merge: true -# Forked repositories can use slightly looser merge settings forks: merge: allow_merge_commit: true @@ -19,12 +25,11 @@ forks: allow_rebase_merge: true delete_branch_on_merge: true -# Branch protection rules (applied to the repository default branch) branch_protection: default: required_status_checks: strict: true - contexts: ['ci', 'lint', 'test'] + contexts: ["ci", "lint", "test"] enforce_admins: true required_pull_request_reviews: required_approving_review_count: 1 @@ -37,18 +42,7 @@ branch_protection: allow_force_pushes: false allow_deletions: false require_signed_commits: true - fork_overrides: - # Loosened defaults for forked repositories - enforce_admins: false - required_status_checks: null - required_pull_request_reviews: null - required_linear_history: false - required_conversation_resolution: false - allow_force_pushes: true - allow_deletions: true - require_signed_commits: false -# Standard issue labels issue_labels: - name: "bug" color: "d73a4a" @@ -74,101 +68,3 @@ issue_labels: - name: "automation" color: "0e8a16" description: "Automation updates" - -# Pull request rules -pull_request_rules: - required_approving_reviews: 1 - require_code_owner_reviews: true - dismiss_stale_reviews: true - require_last_push_approval: true - required_status_checks: - - "ci" - - "lint" - - "test" - -# Signed commit merge strategy -signed_commit_strategy: - allow_merge_commits_for_signed: true - temporary_rule_timeout: 3600000 # 1 hour in milliseconds - admin_users: - - "avrabe" - # List of branches where this applies - protected_branches: - - "main" - - "master" - - "production" - -# CI attestation requirements -ci_attestation: - required_for_main_branch: true - required_checks: - - "security-scan" - - "vulnerability-check" - - "license-compliance" - attestation_format: "sigstore" - -# Dependabot configuration -dependabot: - version: 2 - updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - time: "09:00" - timezone: "UTC" - open-pull-requests-limit: 10 - target-branch: "main" - reviewers: - - "avrabe" - assignees: - - "avrabe" - labels: - - "dependencies" - - "automation" - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - day: "monday" - time: "09:00" - timezone: "UTC" - -# Configuration change strategy -change_strategy: - use_pull_requests: true - pr_title: "[Bot] Repository Configuration Update" - pr_body: "This PR updates repository configuration to match organization standards." - pr_reviewers: - - "avrabe" - pr_labels: - - "automation" - - "configuration" - require_approval: true - auto_merge: false - -# Issue/PR templates to apply -templates: - pull_request: .github/PULL_REQUEST_TEMPLATE.md - issue: .github/ISSUE_TEMPLATE/ - -# CODEOWNERS file to apply -codeowners: .github/CODEOWNERS - -# AI-powered PR review (requires a local OpenAI-compatible endpoint) -ai_review: - enabled: false - endpoint: "" - model: "" - max_diff_size: 12000 - max_tokens: 2000 - temperature: 0.3 - timeout: 120000 - allow_remote_endpoint: false - system_prompt: | - You are a thorough code reviewer. Analyze the PR diff and provide: - 1. Summary of changes - 2. Potential bugs or issues - 3. Security concerns - 4. Suggestions for improvement - 5. Overall assessment diff --git a/src/app.js b/src/app.js index b43a188..26d7753 100644 --- a/src/app.js +++ b/src/app.js @@ -103,6 +103,7 @@ function registerApp(app, { getRouter, addHandler } = {}) { }); app.on('issue_comment.created', async (context) => { + if (!context.octokit) { return; } if (context.log) setLogger(context.log); const deliveryId = context.id; if (deliveryId && isProcessed(deliveryId)) { @@ -112,7 +113,8 @@ function registerApp(app, { getRouter, addHandler } = {}) { const config = getConfig(); const { comment, repository, sender } = context.payload; - if (!comment?.body || !context.octokit) { + + if (!comment?.body || !context.octokit?.issues) { return; } @@ -168,6 +170,7 @@ function registerApp(app, { getRouter, addHandler } = {}) { }; // Use extracted command (supports both /command and @botname command) + getLogger().info({ commandBody, extractedCommand, botName }, "Debug: command parsing"); const cmd = extractedCommand; if (cmd === '/configure-repo') {