diff --git a/.github/workflows/backend-converted-types-check.yml b/.github/workflows/backend-converted-types-check.yml new file mode 100644 index 000000000..c6f09fdac --- /dev/null +++ b/.github/workflows/backend-converted-types-check.yml @@ -0,0 +1,46 @@ +name: Backend-Converted-Types-Check +on: + push: + paths: + - 'backend/**' + - 'frontend/types/api/**' + branches: + - main + - staging + pull_request: + paths: + - 'backend/**' + - 'frontend/types/api/**' + branches: + - '*' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: read + checks: write + +jobs: + build: + name: converted-types-check + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version-file: 'backend/go.mod' + cache-dependency-path: 'backend/go.sum' + - name: Check if all backend-types have been converted to frontend-types + working-directory: backend + run: | + currHash=$(find ../frontend/types/api -type f -print0 | sort -z | xargs -0 sha1sum | sha256sum | head -c 64) + make frontend-types + newHash=$(find ../frontend/types/api -type f -print0 | sort -z | xargs -0 sha1sum | sha256sum | head -c 64) + if [ "$currHash" != "$newHash" ]; then + echo "frontend-types have changed, please commit the changes" + exit 1 + fi + diff --git a/frontend/types/api/machine_metrics.ts b/frontend/types/api/machine_metrics.ts index 78c773286..4e35cbdf3 100644 --- a/frontend/types/api/machine_metrics.ts +++ b/frontend/types/api/machine_metrics.ts @@ -5,92 +5,9 @@ import type { ApiDataResponse } from './common' ////////// // source: machine_metrics.go -export interface MachineMetricSystem { - timestamp?: number /* uint64 */; - exporter_version?: string; - /** - * system - */ - cpu_cores?: number /* uint64 */; - cpu_threads?: number /* uint64 */; - cpu_node_system_seconds_total?: number /* uint64 */; - cpu_node_user_seconds_total?: number /* uint64 */; - cpu_node_iowait_seconds_total?: number /* uint64 */; - cpu_node_idle_seconds_total?: number /* uint64 */; - memory_node_bytes_total?: number /* uint64 */; - memory_node_bytes_free?: number /* uint64 */; - memory_node_bytes_cached?: number /* uint64 */; - memory_node_bytes_buffers?: number /* uint64 */; - disk_node_bytes_total?: number /* uint64 */; - disk_node_bytes_free?: number /* uint64 */; - disk_node_io_seconds?: number /* uint64 */; - disk_node_reads_total?: number /* uint64 */; - disk_node_writes_total?: number /* uint64 */; - network_node_bytes_total_receive?: number /* uint64 */; - network_node_bytes_total_transmit?: number /* uint64 */; - misc_node_boot_ts_seconds?: number /* uint64 */; - misc_os?: string; - /** - * do not store in bigtable but include them in generated model - */ - machine?: string; -} -export interface MachineMetricValidator { - timestamp?: number /* uint64 */; - exporter_version?: string; - /** - * process - */ - cpu_process_seconds_total?: number /* uint64 */; - memory_process_bytes?: number /* uint64 */; - client_name?: string; - client_version?: string; - client_build?: number /* uint64 */; - sync_eth2_fallback_configured?: boolean; - sync_eth2_fallback_connected?: boolean; - /** - * validator - */ - validator_total?: number /* uint64 */; - validator_active?: number /* uint64 */; - /** - * do not store in bigtable but include them in generated model - */ - machine?: string; -} -export interface MachineMetricNode { - timestamp?: number /* uint64 */; - exporter_version?: string; - /** - * process - */ - cpu_process_seconds_total?: number /* uint64 */; - memory_process_bytes?: number /* uint64 */; - client_name?: string; - client_version?: string; - client_build?: number /* uint64 */; - sync_eth2_fallback_configured?: boolean; - sync_eth2_fallback_connected?: boolean; - /** - * node - */ - disk_beaconchain_bytes_total?: number /* uint64 */; - network_libp2p_bytes_total_receive?: number /* uint64 */; - network_libp2p_bytes_total_transmit?: number /* uint64 */; - network_peers_connected?: number /* uint64 */; - sync_eth1_connected?: boolean; - sync_eth2_synced?: boolean; - sync_beacon_head_slot?: number /* uint64 */; - sync_eth1_fallback_configured?: boolean; - sync_eth1_fallback_connected?: boolean; - /** - * do not store in bigtable but include them in generated model - */ - machine?: string; -} export interface MachineMetricsData { - system_metrics: (MachineMetricSystem | undefined)[]; - validator_metrics: (MachineMetricValidator | undefined)[]; - node_metrics: (MachineMetricNode | undefined)[]; + system_metrics: (any /* types.MachineMetricSystem */ | undefined)[]; + validator_metrics: (any /* types.MachineMetricValidator */ | undefined)[]; + node_metrics: (any /* types.MachineMetricNode */ | undefined)[]; } export type GetUserMachineMetricsRespone = ApiDataResponse;