Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update repo_data.py #138

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dashboard/repository/scripts/repo_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pandas as pd
import requests
import re
Expand Down Expand Up @@ -149,6 +150,11 @@ def load_org_repo_platform_from_clickhouse(client, table_name):
url = "https://oss.x-lab.info/open_digger/" # 基础API URL
platform_project_mapping_table = 'platform_project_mapping' # 存储repo_name和platform信息的表名

# 获取从 GitHub 或其他平台的凭证
dashboard_host = os.getenv('DASHBOARD_DB_HOST')
dashboard_user = os.getenv('DASHBOARD_DB_USER')
dashboard_password = os.getenv('DASHBOARD_DB_PASSWORD')

# 连接到ClickHouse
target_client = Client(
host=dashboard_host, # 目标服务器地址
Expand Down Expand Up @@ -206,4 +212,4 @@ def load_org_repo_platform_from_clickhouse(client, table_name):
# -------------------- latest_month_data Metric Set -------------------- (latest month data)
latest_data_4 = get_latest_data(all_data_4)
latest_table_4 = "REPO_latest_month_data"
save_to_clickhouse(target_client, latest_table_4, latest_data_4, ['org_repo', 't_month', 'activity', 'openrank', 'attention'])
save_to_clickhouse(target_client, latest_table_4, latest_data_4, ['org_repo', 't_month', 'activity', 'openrank', 'attention'])
Loading