Skip to content

feat: guide multi-account Google Search Console setup - #211

Merged
mohanagy merged 1 commit into
developmentfrom
feat/204-multi-account-setup
Jul 24, 2026
Merged

feat: guide multi-account Google Search Console setup#211
mohanagy merged 1 commit into
developmentfrom
feat/204-multi-account-setup

Conversation

@mohanagy

@mohanagy mohanagy commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Part of #204; does not close it.

This delivers the Google Search Console multi-account vertical slice through the shared setup path:

  • miftah setup can add any number of named Google accounts and requires an explicit durable default when there is more than one.
  • Console submits the same typed account input to the shared preset builder.
  • Each account receives a separate upstream-owned GSC_CONFIG_DIR, namespaced by resolved configuration path and profile.
  • Profile names, duplicate accounts, unsafe paths, and incompatible legacy/named input are rejected before config publication.

Security impact

  • Generated profiles remain read-only.
  • Miftah stores only a client-secrets file path and never reads the provider token cache.
  • CLI and Console both use typed validation and the existing atomic configuration publication path; no client configuration is mutated automatically.

Validation

  • tests/setup-command.test.ts, tests/preset-catalog.test.ts, tests/console-server.test.ts, and tests/console-application-service.test.ts: 64 passing on Node 22.22.3.
  • npm run typecheck.
  • npm run lint.
  • Current-head CI run 30083297283: Linux quality and Ubuntu/macOS/Windows Node 20/22/24 all green after the single unrelated test: diagnose multi-upstream availability cascade under coverage #122 timeout rerun.

Intentional remaining #204 scope

Import/paste existing client entries, generic local/remote setup, per-profile live readiness and first read-only call verification, and later profile management remain tracked in #204.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5c44fb1b-61e9-43a8-93bd-02ed3450fdc4

📥 Commits

Reviewing files that changed from the base of the PR and between 407b2c3 and a2a74d7.

📒 Files selected for processing (20)
  • CHANGELOG.md
  • README.md
  • docs/cli.md
  • docs/console-api.md
  • docs/oauth-support.md
  • docs/presets-and-clients.md
  • docs/provider-adapters.md
  • src/cli/init.ts
  • src/config/presets.ts
  • src/console/console-application-service.ts
  • src/console/console-assets.ts
  • src/console/console-server.ts
  • tests/console-application-service.test.ts
  • tests/console-server.test.ts
  • tests/oauth-console-threat-model-docs-contract.test.ts
  • tests/package-contract.test.ts
  • tests/preset-catalog.test.ts
  • tests/preset-docs-contract.test.ts
  • tests/readme-product-contract.test.ts
  • tests/setup-command.test.ts
📝 Walkthrough

Walkthrough

Google Search Console onboarding now supports multiple named profiles through the CLI and local Console. Generated profiles receive explicit defaults, separate upstream-owned OAuth state directories, structured validation, and updated documentation and tests.

Changes

Google Search Console onboarding

Layer / File(s) Summary
Preset generation and isolation
src/config/presets.ts, tests/preset-catalog.test.ts, tests/package-contract.test.ts
Preset generation validates named profiles and defaults, forwards configuration context, and creates distinct hashed GSC_CONFIG_DIR values per configuration and profile.
CLI profile collection
src/cli/init.ts, tests/setup-command.test.ts
Interactive and noninteractive setup collect multiple profiles, client-secrets paths, and an explicit default while preserving sensitive-path handling.
Console onboarding and API validation
src/console/console-assets.ts, src/console/console-server.ts, src/console/console-application-service.ts, tests/console-*.test.ts
The Console adds dynamic account fields, validates structured GSC payloads, forwards profile data, and persists generated configurations.
Documentation and contracts
README.md, docs/*.md, CHANGELOG.md, tests/*docs-contract.test.ts, tests/readme-product-contract.test.ts
Documentation describes guided multi-account setup, cache ownership and isolation, API restrictions, OAuth boundaries, and current configuration guidance.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant CLI as miftah setup
  participant Console as Local Console
  participant Builder as buildPresetConfig
  participant Config as Generated configuration
  Operator->>CLI: configure named GSC profiles
  Operator->>Console: submit named GSC profiles
  CLI->>Builder: pass profiles and defaultProfile
  Console->>Builder: pass profiles and defaultProfile
  Builder->>Config: generate isolated profile environments
Loading

Possibly related PRs

  • mohanagy/miftah#184: Introduced the Google Search Console preset extended here with multi-profile setup.
  • mohanagy/miftah#59: Established the preset-catalog and secure onboarding framework used by this change.
  • mohanagy/miftah#103: Related README onboarding rewrite covering the product-first setup journey.

Poem

A bunny adds accounts, two by two,
With secret paths kept out of view.
Each profile gets its cachey home,
A chosen default leads the roam.
The Console and CLI hop bright—
GSC setup now feels just right!


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 10.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately reflects the main change: guided multi-account Google Search Console setup.
Description check ✅ Passed The description includes the required Summary, Security impact, and Validation sections and gives relevant implementation and test detail.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/204-multi-account-setup

Comment @coderabbitai help to get the list of available commands.

@mohanagy

Copy link
Copy Markdown
Owner Author

Review follow-up: the description warning is addressed with Summary, Security impact, and checklist Validation sections. The generic 80% docstring-coverage error is not an actionable repository requirement: this change already documents its two new exported types, and adding docstrings broadly to unrelated existing private functions would be out of scope and would not improve the audited behavior. There are no CodeRabbit review threads or code findings to resolve.

@mohanagy
mohanagy force-pushed the feat/204-multi-account-setup branch from 407b2c3 to a2a74d7 Compare July 24, 2026 10:01
@mohanagy

Copy link
Copy Markdown
Owner Author

Current-head review exception for a2a74d7: all 12 required checks are green (Linux quality, Verify, macOS/Ubuntu/Windows Node 20/22/24, and package validation). CodeRabbit is demonstrably rate-limited for 36 minutes and the GraphQL review check found no reviews or review threads. Its earlier generic docstring-coverage checklist was already addressed and is not a repository requirement. A bounded local Claude Code Opus review attempt produced no report, so no result is claimed from it; independent local diff review found no blocking correctness, security, compatibility, or test issues. Proceeding under the documented rate-limit exception.

@mohanagy
mohanagy merged commit ed8c0fc into development Jul 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant