Skip to content

fix(source-google-analytics-data-api): fix offset pagination - #83318

Closed
Bhupesh Cholake (RealBhupesh) wants to merge 2 commits into
airbytehq:masterfrom
RealBhupesh:RealBhupesh/source-google-analytics-data-api-pagination
Closed

Bhupesh Cholake (RealBhupesh) wants to merge 2 commits into
airbytehq:masterfrom
RealBhupesh:RealBhupesh/source-google-analytics-data-api-pagination

Conversation

@RealBhupesh

Copy link
Copy Markdown

What

Fixes #82766.

The GA4 runReport endpoint accepts offset in the POST body and does not return an offset field. The connector's paginator was injecting offset as a query parameter and using response.offset as a cursor, so reports larger than the 100,000-row limit could be truncated and fail to advance correctly.

This changes both the static stream template and the dynamic stream mapping to use the CDK's OffsetIncrement strategy with offset injected into body_json. Pivot reports keep their existing no-pagination behavior. The connector patch version is bumped to 2.9.46 with a changelog entry.

This PR addresses the deterministic paginator defect described in the issue. It does not claim to resolve every possible memory or concurrency cause of a stalled sync.

Checks

  • GA4 unit tests: 15 passed.
  • Parsed the updated manifest and metadata YAML.
  • Verified the static and dynamic paginator definitions with manifest assertions.
  • Ran git diff --check.

Connector version

Patch release: fixes pagination behavior without changing stream names or record schemas.

@CLAassistant

CLAassistant commented Aug 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

👋 Welcome to Airbyte!

Thank you for your contribution from RealBhupesh/airbyte! We're excited to have you in the Airbyte community.

If you have any questions, feel free to ask in the PR comments or join our Slack community.

💡 Show Tips and Tricks

PR Slash Commands

As needed or by request, Airbyte Maintainers can execute the following slash commands on your PR:

  • /format-fix - Fixes most formatting issues.
  • /bump-version - Bumps connector versions.
  • /run-connector-tests - Runs connector tests.
  • /run-cat-tests - Runs CAT tests.
  • /run-regression-tests - Runs regression tests for the modified connector(s).
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).
  • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
  • /ai-review - AI-powered PR review for connector safety and quality gates.
  • /ai-docs-review - AI-powered documentation review for PRs with connector changes.
  • /ai-create-docs-pr - Creates a documentation PR for connector changes.
  • /force-merge reason="<A_GOOD_REASON>" - Force merges the PR using admin privileges, bypassing CI checks. Requires a reason.

Tips for Working with CI

  1. Pre-Release Checks. Please pay attention to these, as they contain standard checks on the metadata.yaml file, docs requirements, etc. If you need help resolving a pre-release check, please ask a maintainer.
    • Note: If you are creating a new connector, please be sure to replace the default logo.svg file with a suitable icon.
  2. Connector CI Tests. Some failures here may be expected if your tests require credentials. Please review these results to ensure (1) unit tests are passing, if applicable, and (2) integration tests pass to the degree possible and expected.
  3. (Optional.) BYO Connector Credentials for tests in your fork. You can optionally set up your fork with BYO credentials for your connector. This can significantly speed up your review, ensuring your changes are fully tested before the maintainers begin their review.
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@RealBhupesh Bhupesh Cholake (RealBhupesh) changed the title 🐛 Source Google Analytics Data API: fix offset pagination fix(source-google-analytics-data-api): fix offset pagination Aug 2, 2026
@RealBhupesh
Bhupesh Cholake (RealBhupesh) marked this pull request as ready for review August 2, 2026 09:32
@airbyte-support-bot

Copy link
Copy Markdown
Contributor

↪️ Triggering /ai-review per Hands-Free AI Triage Project triage next step.

Reason: Community PR, opened ready-for-review, with no AI pipeline stage on record. /ai-review is the correct entry point for a ready PR so the change can get a first-pass connector safety/quality assessment and reach a maintainer with context attached.

Note on CI: the failing checks (Progressive Rollout Gate, Connector Active Progressive Rollout Checks Summary, Test source-google-analytics-data-api Connector [No Creds]) are the standard fork-PR limitations — forked branches cannot access the org secrets those jobs need. They are not evidence of a defect in this diff.

Thanks for the contribution!


Devin session

@octavia-bot-suspended

octavia-bot-suspended Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

AI PR Review starting...

Reviewing PR for connector safety and quality.
View playbook

✅ Devin AI session created successfully!

@airbyte-support-bot

Airbyte Support Bot (airbyte-support-bot) commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ AI PR Review Report

🔴 Review Action: REQUEST CHANGES

Gate Status
Test Coverage FAIL
CI Checks FAIL
Live / E2E Tests UNKNOWN
Forwards Compatibility FAIL (warning-level)
Behavioral Changes FAIL (warning-level)
Code Hygiene WARNING

⚠️ Risk Level: 4/5

Paginator strategy swap (CursorPagination → OffsetIncrement, request_parameter → body_json, page_size: 100000) changes sync/pagination behavior for every GA4 report stream with no accompanying tests.

🔧 Remediation Required

Test Coverage (enforced, FAIL) — Add at least one test that validates the new pagination behavior. A manifest/mock-server test under airbyte-integrations/connectors/source-google-analytics-data-api/unit_tests/ asserting that (a) offset is injected into the request body rather than the query string, and (b) the paginator advances by 100,000 and stops at the end of the result set, would satisfy this gate and simultaneously de-risk the Forwards Compatibility and Behavioral Changes warnings.

CI Checks (enforced, FAIL) — Test source-google-analytics-data-api Connector [No Creds] is failing on the latest run (job). Test failure is expected for a community PR without credentials — maintainers can re-run with credentials via /run-connector-tests or manually approve after code review.

Live / E2E Tests (enforced, UNKNOWN) — No /ai-prove-fix run found on this PR or on the linked issue #82766. Run /ai-prove-fix to publish a pre-release and validate the pagination change against real GA4 report data.

Forwards Compatibility (warning) — The change replaces the pagination strategy entirely. Confirm that a partially-completed sync started on 2.9.45 resumes correctly on 2.9.46 (and on rollback), or add tests demonstrating it.

Behavioral Changes (warning) — page_size: 100000 is a new explicit request-size declaration. Document the expected request/row-count behavior in the PR description and back it with test evidence.

Code Hygiene (warning) — Source (manifest.yaml) changed with no test files modified. No live validation evidence present, so the risk is not mitigated.


📋 PR Details

Connector(s): source-google-analytics-data-api
PR: #83318
HEAD SHA: 672be568b87387c696e9933f57e91326a808b9c9
Session: https://app.devin.ai/sessions/31a17f96dddf4de18ecd9405d52d39de

🔍 Gate Evaluation Details

Gate-by-Gate Analysis

Gate Status Enforced? Details
PR Hygiene PASS Yes Description is substantive; changelog row added for 2.9.46; no unresolved human review comments.
Code Hygiene WARNING WARNING manifest.yaml modified; no test files modified.
Test Coverage FAIL Yes Behavioral change (title fix(...), links Fixes #82766) with zero test files in the diff.
Code Security PASS Yes No auth/credential/token paths touched; no security keywords in the diff hunks.
Per-Record Performance PASS WARNING No per-record processing code changed; paginator config only.
Breaking Dependencies PASS WARNING No dependency or build files modified.
Backwards Compatibility PASS Yes (enforced) No spec, schema, stream, primary-key, cursor-field, or format changes; metadata.yaml diff is a patch version bump only.
Forwards Compatibility FAIL Warning (elevates Risk Level) Pagination keywords in diff hunks with no tests or state-migration evidence.
Behavioral Changes FAIL Warning (elevates Risk Level) page_size present in diff hunks.
Out-of-Scope Changes PASS Skip All changes are under airbyte-integrations/connectors/** and docs/**.
CI Checks FAIL Yes Test source-google-analytics-data-api Connector [No Creds] failed. Test failure expected for community PR without credentials — maintainers can manually approve after code review.
Live / E2E Tests UNKNOWN Yes Bug fix touching sync/pagination behavior requires validation; no /ai-prove-fix conclusion found. Not run ≠ disproven.

PR Hygiene evidence

  • PR Body Length (raw): 1035
  • PR Body Length (after stripping HTML comments/whitespace): 1035
  • PR Body Length (visible content, headings/labels removed): ~980
  • PR Body Preview: ## What\n\nFixes #82766.\n\nThe GA4 runReport endpoint accepts offset in the POST body and does not return an of…
  • Changelog: docs/integrations/sources/google-analytics-data-api.md gained a 2.9.46 row.
  • Human reviewer comments: none (all PR comments are from [bot] / support-bot accounts).

Test Coverage evidence

  • Behavioral Change Detected: Yes
  • Indicators Found: title prefix fix(...); body contains Fixes #82766
  • Test Files Modified: none
  • New Test Content Found: No
  • Manifest-only changes are explicitly not exempt from this gate.

Code Hygiene evidence

  • Source Files Modified: airbyte-integrations/connectors/source-google-analytics-data-api/manifest.yaml
  • Test Files Modified: none
  • Coverage Evidence: Not Found

Backwards Compatibility evidence

  • No spec*.json / spec*.yaml files in the diff and no spec block touched in manifest.yaml.
  • No schemas/*.json changes; no field type or format added, removed, or altered.
  • No stream added, removed, or renamed; primary_key and cursor_field untouched.
  • No record transformations / extractor change that would alter a primary-key or cursor value.
  • metadata.yaml change is dockerImageTag: 2.9.45 → 2.9.46 only — a patch bump, no releases.breakingChanges entry needed.

Forwards / Behavioral evidence (diff hunks only)

  • Removed: type: CursorPagination, cursor_value: '{{ response.get("offset", {}) }}', stop_condition: ..., inject_into: request_parameter
  • Added: type: OffsetIncrement, page_size: 100000, inject_into: body_json
  • Matched keywords: paginator, pagination_strategy, cursor_value, page_size
  • Applies to both the static stream template (definitions) and the dynamic_streams mapping.
📚 Evidence Consulted

Evidence

  • Changed files: 3
    • airbyte-integrations/connectors/source-google-analytics-data-api/manifest.yaml (+6 / −8)
    • airbyte-integrations/connectors/source-google-analytics-data-api/metadata.yaml (+1 / −1)
    • docs/integrations/sources/google-analytics-data-api.md (+1 / −0)
  • CI checks (latest run per name, HEAD 672be56):
    • ✅ Lint source-google-analytics-data-api Connector
    • ✅ Build and Verify Artifacts (source-google-analytics-data-api)
    • ✅ source-google-analytics-data-api Pre-Release Checks
    • ✅ Check Changelog Updated, Format Check, Docs / MarkDownLint, Docs / Vale, Build Airbyte Docs, Validate PR Title
    • ❌ Test source-google-analytics-data-api Connector [No Creds] — counted
    • ❌ source-google-analytics-data-api Progressive Rollout Gate / Connector Active Progressive Rollout Checks Summary — excluded (release-management checks reflecting base-branch rollout state, not this PR's code)
  • PR labels: community, connectors/source/google-analytics-data-api, hyd-review. No validation labels present.
  • PR description: present
  • Existing bot reviews: none
❓ How to Respond

Resolving a Failing Gate

Each non-PASS gate above lists concrete remediation. Apply it, push, then re-run /ai-review — the bot re-evaluates from the diff, CI check-runs, and /ai-prove-fix results.

Written explanations do not change a gate verdict. If you believe a gate is a false positive or it cannot be remediated as written, request review from a human maintainer and explain the situation to them in a PR comment — a human reviewer can approve or merge over a bot FAIL. Never edit the PR description to argue with the bot; the description is how reviewers learn what the PR does.

@bazarnov

Copy link
Copy Markdown
Contributor

Thanks for the contribution - the root-cause analysis here is correct: RunReportResponse carries no offset field (reference), so the old CursorPagination stop condition fired on page 1, and limit/offset belong in the POST body. Closing in favor of #83188, which fixes the same defect on the current base (2.11.0-rc.2) and additionally covers what this PR leaves open:

  • injects limit through the paginator and removes the hard-coded limit: 100000 from the request body (keeping a hard-coded value alongside an injected one raises a request-body key collision in the CDK as soon as the two numbers diverge);
  • adds orderBys over all configured dimensions - GA4 documents no default row ordering for runReport (pagination docs), so offset paging without an explicit total order can overlap or skip rows between pages;
  • lowers the page size to 25,000 to bound the memory profile behind the reported stalls (~1.17 GiB RSS per 100,000-row page);
  • ships mock-server tests for pagination advancement, orderBys placement, and pivot no-pagination behavior.

Apologies that we cannot take both - and thanks again for pinpointing the broken paginator.

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

Projects

Status: Inactive

5 participants