Skip to content

PR #584 follow-ups: extract drive-ai-ingester to testable module + centralize GitHub repo config #604

Description

@don-petry

Tracking issue for review findings on PR #584 that are real but out of scope for that PR's minimal review-fix pass. PR #584 fixed the concrete correctness bugs inline (409 retry, tagging-status gating, concurrency lock, content-extraction gating, Base64 round-trip validation, mojibake heuristic narrowing, retention exemption, etc.); the items below are larger refactors to schedule separately.

1. Extract drive-ai-ingester logic into a testable src/index.js

AGENTS.md requires each GAS script to keep code.gs/config.gs as thin entry points and extract Node-testable logic into src/<script>/src/index.js using a service-injection pattern, with Jest coverage — mirroring gmail-ai-classifier. drive-ai-ingester currently keeps analyzeDocumentWithAi, applyDualLayerTagsToDriveFile, extractFileContentText, extractJsonSubstring, parseRetryDelayMs, getNotePathForDomain, formatDriveIngestionEntry, and the GitHub sync helpers inside Code.gs/GitHubSync.gs. Also rename Code.gs/Config.gs to lowercase to match the repo convention.

2. Centralize GitHub repo coordinates in config.gs

GITHUB_REPO_OWNER/GITHUB_REPO_NAME are defined as module constants in gmail-ai-classifier/src/index.js and duplicated as literals in gitHubSync.gs / drive-ai-ingester/GitHubSync.gs. Move them to config.gs (or a single shared source) and reference from all URL builders so the duplicates cannot drift.

Sources: gemini-code-assist, coderabbitai, cubic review comments on PR #584.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions