blackcowmoo / grafana-google-analytics-datasource

Grafana Google Analytics datasource
https://grafana.com/grafana/plugins/blackcowmoo-googleanalytics-datasource/
Apache License 2.0
35 stars 15 forks source link

Feature/backend/add realtime report && add e2e test #107

Closed lcc3108 closed 5 days ago

lcc3108 commented 7 months ago

Summary by CodeRabbit

coderabbitai[bot] commented 7 months ago

[!WARNING]

Review failed

The pull request is closed.

전체 개요

이번 변경 사항은 Grafana 플러그인 개발 환경을 개선하고 테스트 및 린팅 도구를 강화하며, CI/CD 워크플로우를 업데이트하고, Docker 및 TypeScript 설정을 최적화하는 데 중점을 두고 있습니다. 또한, Google Analytics와의 통합 기능을 추가 및 확장하여 실시간 데이터 수집과 분석을 지원합니다.

변경 사항

파일 경로 변경 요약
.config/.cprc.json 버전 "4.16.0"을 나타내는 단일 키-값 쌍을 추가한 간단한 JSON 구성 파일을 도입
.config/.eslintrc 기본 Grafana ESLint 구성 확장, 특정 규칙 비활성화 및 사용자 정의 규칙 추가
.config/.prettierrc.js Prettier 코드 포맷터 설정 추가
.config/README.md 프로젝트 개발, 테스트 및 빌드에 사용되는 도구들의 기본 구성 제공
.config/entrypoint.sh DEV 환경 변수 값에 따라 운영 모드를 결정하는 셸 스크립트 도입
.config/jest-setup.js, .config/jest.config.js Jest 설정 파일 및 테스트 설정 확장
.config/jest/mocks/react-inlinesvg.tsx react-inlinesvg 모듈에 대한 모의(mock) 구성 추가
.config/jest/utils.js Jest 구성에서 특정 패키지를 변환하는 유틸리티 함수 추가
.config/supervisord/supervisord.conf Supervisord를 사용하여 다양한 프로그램과 서비스 구성
.config/tsconfig.json Grafana 플러그인에 대한 TypeScript 컴파일러 옵션 및 모듈 해상도 구성
.config/types/custom.d.ts 이미지 및 폰트 형식에 대한 선언 추가
.config/webpack/constants.ts 상수 SOURCE_DIRDIST_DIR 추가
.config/webpack/publicPath.ts 플러그인의 AMD 모듈 위치를 기반으로 공개 경로를 동적으로 설정
.config/webpack/utils.ts 환경 확인, 파일 읽기 및 번들링 관련 유틸리티 함수 추가
.config/webpack/webpack.config.ts Grafana 플러그인용 webpack 구성 제공
.dockerIgnore docker*Docker* 패턴을 추가하여 파일 및 디렉토리 제외
.github/workflows/ci.yaml Node.js와 Go 환경에 대한 의존성 업그레이드 및 워크플로우 단계 조정
.github/workflows/playwright.yml E2E 테스트를 위한 GitHub Actions 워크플로우 추가
.github/workflows/release.yaml Node.js 및 Go 설정 및 버전 업데이트
.gitignore 테스트 및 린트 관련 새 디렉토리 및 파일 추가
Dockerfile Grafana 개발 설정 추가 및 사용 도구 설치
cypress.config.js Cypress 프로젝트 설정 추가
cypress/integration/01-smoke.spec.ts Grafana 플러그인 설치 및 구성 테스트를 위한 시나리오 추가
docker-compose.yaml Grafana 서비스를 위한 Docker Compose 구성 추가
go.mod Go 버전 업데이트 및 필요한 패키지 추가
package.json 빌드, 테스트, 린트 및 E2E 테스트 관련 스크립트 추가 및 의존성 업데이트
.pkg/analytics.go 새로운 메서드 GetRealtimeDimensionsGetRealTimeMetrics 추가
.pkg/gav3/analytics.go GoogleAnalytics 구조체에 새로운 메서드 추가
.pkg/gav4/client.go GoogleClient 구조체의 getReport 메서드 업데이트

시퀀스 다이어그램

sequenceDiagram
    participant Dev as Developer
    participant GitHub as GitHub Actions
    participant Docker as Docker Container
    participant Grafana as Grafana Server
    participant GA as Google Analytics

    Dev->>GitHub: Push code changes
    GitHub->>Docker: Build and start container
    Docker->>Grafana: Start Grafana service
    Grafana->>GA: Fetch real-time metrics
    GA-->>Grafana: Return metrics
    Grafana-->>Docker: Display metrics
    Docker-->>GitHub: Run tests and linting
    GitHub-->>Dev: Report results

코드를 짜는 토끼, 기쁨이 가득해
구성 파일들 반짝반짝, 플러그인도 새로워지네
ESLint, Prettier, Jest, 모두 손발 맞추어
Docker와 TypeScript, 완벽하게 준비됐지
Google Analytics 실시간으로, 데이터 흐르네
🐇✨코드 세상에서 빛나는 토끼의 꿈✨🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.