[PR #354] [MERGED] Align GSC SearchAnalytics requests to docs, fix decay logic, add task-report endpoints/UI and tests #319

Closed
opened 2026-03-02 23:35:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/354
Author: @AJaySi
Created: 2/13/2026
Status: Merged
Merged: 2/14/2026
Merged by: @AJaySi

Base: mainHead: codex/schedule-content-strategy-tasks-for-alwrity


📝 Commits (1)

  • 70c349d Fix test path in GSC design review doc

📊 Changes

10 files changed (+578 additions, -17 deletions)

View changed files

📝 backend/api/onboarding_utils/onboarding_completion_service.py (+26 -0)
📝 backend/routers/gsc_auth.py (+54 -0)
backend/services/gsc_query_request_shapes_tests.py (+41 -0)
📝 backend/services/gsc_service.py (+52 -17)
backend/services/gsc_task_report_service.py (+196 -0)
docs/gsc_step5_dashboard_design_review.md (+52 -0)
📝 frontend/src/api/gsc.ts (+35 -0)
📝 frontend/src/components/OnboardingWizard/IntegrationsStep.tsx (+15 -0)
📝 frontend/src/components/SEODashboard/SEODashboard.tsx (+5 -0)
frontend/src/components/shared/GSCTaskReportsPanel.tsx (+102 -0)

📄 Description

Motivation

  • Ensure Search Analytics payloads conform to Google Search Console documentation to avoid malformed API calls and unstable behavior.
  • Fix an incorrect decay comparison that used a sliced 60-day window and caused unreliable period-over-period insights.
  • Provide a single, reviewable contract for issue-task reporting used by both Onboarding Step 5 and the SEO Dashboard.
  • Improve reviewer confidence by adding focused tests and a concise design-review document describing changes and rationale.

Description

  • Added a docs-aligned request builder in backend/services/gsc_service.py (_build_search_analytics_request) and constants DEFAULT_SEARCH_TYPE='web' and MAX_ROW_LIMIT=25000, and switched verification/aggregate/query calls to use it to enforce type, bounded rowLimit, non-negative startRow, and omitting dimensions for aggregate totals.
  • Fixed period-over-period logic in backend/services/gsc_task_report_service.py by adding _fetch_query_rows_range(...) and comparing equivalent windows (current 30d vs previous 30d) instead of slicing a 60d set, and implemented the GSCTaskReportService used to construct the 4 issue sections and Google query templates.
  • Integrated the task-report surface across layers: new router endpoints in backend/routers/gsc_auth.py (GET /gsc/task-reports, POST /gsc/task-reports/run), onboarding bootstrap to create/verify platform-insights tasks in backend/api/onboarding_utils/onboarding_completion_service.py, a reusable frontend panel frontend/src/components/shared/GSCTaskReportsPanel.tsx, client methods in frontend/src/api/gsc.ts, and added the panel into IntegrationsStep.tsx and SEODashboard.tsx.
  • Added a concise reviewer document docs/gsc_step5_dashboard_design_review.md summarizing design considerations, issues solved (1–4), exact code edits, and validation performed.

Testing

  • Ran unit tests: PYTHONPATH=backend pytest -q backend/services/gsc_query_request_shapes_tests.py which passed (2 passed) and produced expected warnings but no failures.
  • Performed Python compilation checks with python -m compileall on modified backend modules which completed successfully.

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/354 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 2/13/2026 **Status:** ✅ Merged **Merged:** 2/14/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/schedule-content-strategy-tasks-for-alwrity` --- ### 📝 Commits (1) - [`70c349d`](https://github.com/AJaySi/ALwrity/commit/70c349d641323f4f95c9e9493001b69af75d6c78) Fix test path in GSC design review doc ### 📊 Changes **10 files changed** (+578 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `backend/api/onboarding_utils/onboarding_completion_service.py` (+26 -0) 📝 `backend/routers/gsc_auth.py` (+54 -0) ➕ `backend/services/gsc_query_request_shapes_tests.py` (+41 -0) 📝 `backend/services/gsc_service.py` (+52 -17) ➕ `backend/services/gsc_task_report_service.py` (+196 -0) ➕ `docs/gsc_step5_dashboard_design_review.md` (+52 -0) 📝 `frontend/src/api/gsc.ts` (+35 -0) 📝 `frontend/src/components/OnboardingWizard/IntegrationsStep.tsx` (+15 -0) 📝 `frontend/src/components/SEODashboard/SEODashboard.tsx` (+5 -0) ➕ `frontend/src/components/shared/GSCTaskReportsPanel.tsx` (+102 -0) </details> ### 📄 Description ### Motivation - Ensure Search Analytics payloads conform to Google Search Console documentation to avoid malformed API calls and unstable behavior. - Fix an incorrect decay comparison that used a sliced 60-day window and caused unreliable period-over-period insights. - Provide a single, reviewable contract for issue-task reporting used by both Onboarding Step 5 and the SEO Dashboard. - Improve reviewer confidence by adding focused tests and a concise design-review document describing changes and rationale. ### Description - Added a docs-aligned request builder in `backend/services/gsc_service.py` (`_build_search_analytics_request`) and constants `DEFAULT_SEARCH_TYPE='web'` and `MAX_ROW_LIMIT=25000`, and switched verification/aggregate/query calls to use it to enforce `type`, bounded `rowLimit`, non-negative `startRow`, and omitting `dimensions` for aggregate totals. - Fixed period-over-period logic in `backend/services/gsc_task_report_service.py` by adding `_fetch_query_rows_range(...)` and comparing equivalent windows (current 30d vs previous 30d) instead of slicing a 60d set, and implemented the `GSCTaskReportService` used to construct the 4 issue sections and Google query templates. - Integrated the task-report surface across layers: new router endpoints in `backend/routers/gsc_auth.py` (`GET /gsc/task-reports`, `POST /gsc/task-reports/run`), onboarding bootstrap to create/verify platform-insights tasks in `backend/api/onboarding_utils/onboarding_completion_service.py`, a reusable frontend panel `frontend/src/components/shared/GSCTaskReportsPanel.tsx`, client methods in `frontend/src/api/gsc.ts`, and added the panel into `IntegrationsStep.tsx` and `SEODashboard.tsx`. - Added a concise reviewer document `docs/gsc_step5_dashboard_design_review.md` summarizing design considerations, issues solved (1–4), exact code edits, and validation performed. ### Testing - Ran unit tests: `PYTHONPATH=backend pytest -q backend/services/gsc_query_request_shapes_tests.py` which passed (`2 passed`) and produced expected warnings but no failures. - Performed Python compilation checks with `python -m compileall` on modified backend modules which completed successfully. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_698ebdb2693c832884b3724a015ecab1) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:35:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#319
No description provided.