mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 00:45:54 +03:00
[PR #429] Unify GSC analytics response contract and status-driven consumers #733
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#733
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/429
Author: @AJaySi
Created: 3/12/2026
Status: 🔄 Open
Base:
main← Head:codex/define-consistent-response-contract-for-get_search_analytics-ren1d4📝 Commits (1)
fa05388Unify GSC analytics response contract and status-based consumers📊 Changes
4 files changed (+127 additions, -82 deletions)
View changed files
📝
backend/api/content_planning/services/content_strategy/autofill/normalizers/analytics_normalizer.py(+7 -2)📝
backend/services/analytics/handlers/gsc_handler.py(+30 -61)📝
backend/services/gsc_service.py(+85 -14)📝
backend/services/scheduler/executors/gsc_insights_executor.py(+5 -5)📄 Description
Motivation
get_search_analyticsalways returns a single, predictable shape so downstream code can rely on keys rather than presence checks.statusmarker and empty collections.status+ guaranteed keys instead of brittle key-existence logic.Description
GSCService.get_search_analytics:_base_payload(status, error)and_normalize_payload(payload)that guarantee the unified contract with keys:overall_metrics.rows,query_data.rows,page_data.rows,query_page_data.rows,verification_data.rows,date_range(start/end),site_url,startDate/endDate/siteUrlaliases,status, and optionalerror/warning.get_search_analyticsto return the canonical payload with appropriatestatusvalues (examples:not_connected,auth_failed,no_data,verification_failed,api_error,partial_success,success,error) and empty arrays instead of ad-hoc dict shapes.date_range,site_url, andstatusand ensure cached responses are converted via_normalize_payloadbefore being returned.statusand guaranteed keys:backend/services/analytics/handlers/gsc_handler.pynow derives metrics fromoverall_metrics/query_dataand computes connection status fromstatus;backend/services/scheduler/executors/gsc_insights_executor.pychecksstatusrather than presence of'error'; onboarding normalizernormalize_gsc_analyticsgates processing based onstatus.Testing
python -m compileall backend/services/gsc_service.py backend/services/analytics/handlers/gsc_handler.py backend/services/scheduler/executors/gsc_insights_executor.py backend/api/content_planning/services/content_strategy/autofill/normalizers/analytics_normalizer.pyand all modified modules compiled without syntax errors.Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.