metadata: annotations: prow.k8s.io/context: pull-check-deps prow.k8s.io/job: pull-check-deps creationTimestamp: "2025-10-31T02:37:34Z" generation: 10 labels: created-by-prow: "true" event-GUID: 8da81c80-b602-11f0-9b57-f01667719b72 prow.k8s.io/build-id: "1984087322303401984" prow.k8s.io/context: pull-check-deps prow.k8s.io/id: 5ded3fff-28f3-45c3-b515-6d3bdf8aa419 prow.k8s.io/is-optional: "false" prow.k8s.io/job: pull-check-deps prow.k8s.io/refs.base_ref: master prow.k8s.io/refs.org: tikv prow.k8s.io/refs.pull: "9723" prow.k8s.io/refs.repo: pd prow.k8s.io/type: presubmit name: 5ded3fff-28f3-45c3-b515-6d3bdf8aa419 namespace: apps resourceVersion: "1761878474488223007" uid: 7131999f-ac1c-4207-9aad-81c1c14c2ed5 spec: agent: kubernetes cluster: default context: pull-check-deps decoration_config: gcs_configuration: bucket: gs://prow-tidb-logs path_strategy: explicit gcs_credentials_secret: gcs-credentials utility_images: clonerefs: gcr.io/k8s-prow/clonerefs:v20230601-43eb1068e4 entrypoint: gcr.io/k8s-prow/entrypoint:v20230601-43eb1068e4 initupload: gcr.io/k8s-prow/initupload:v20230601-43eb1068e4 sidecar: gcr.io/k8s-prow/sidecar:v20230601-43eb1068e4 job: pull-check-deps namespace: prow-test-pods pod_spec: containers: - args: - "set -eo pipefail\n# skip it for batch jobs\nif [[ \"${JOB_TYPE:-}\" == \"batch\" ]]; then\n echo \"JOB_TYPE is batch, skip it.\"\n exit 0\nfi\n# skip it when the base branch is not in [master, release-X.Y]\nif [[ \"${PULL_BASE_REF}\" != \"master\" && ! \"${PULL_BASE_REF}\" =~ ^release-[0-9]+\\.[0-9]+$ ]]; then\n \ echo \"base branch is not in [master, release-X.Y], skip it.\"\n exit 0\nfi\n\necho \"\U0001F4AC base branch of the PR: ${PULL_BASE_REF}\"\n\n# install tools: jq\napt-get update && apt-get install -y jq\n\n## Check for go module dependencies\ndeps=(\n \ \"github.com/pingcap/kvproto\"\n \"github.com/pingcap/tidb-dashboard\"\n \ # add more on demand...\n)\n# Define prefix replace KV pairs: key is dep prefix, value is the branch prefix to use.\ndeclare -A dep_branch_prefix_map=(\n \ # Example:\n # For github.com/tikv/client-go, map release-X.Y to tidb-X.Y.\n \ # [\"github.com/tikv/client-go\"]=\"tidb\"\n)\n\n# Function to get expected branch for a dependency\nget_expect_branch() {\n local dep=\"$1\"\n local base_branch=\"$2\"\n for prefix in \"${!dep_branch_prefix_map[@]}\"; do\n \ if [[ \"$dep\" == \"$prefix\"* ]]; then\n # If base_branch is release-X.Y, map to tidb-X.Y\n if [[ \"$base_branch\" =~ ^release-([0-9]+\\.[0-9]+)$ ]]; then\n echo \"${dep_branch_prefix_map[$prefix]}-${BASH_REMATCH[1]}\"\n \ return\n fi\n fi\n done\n # Default: use base branch as is\n echo \"$base_branch\"\n}\n\nfor dep in \"${deps[@]}\"; do\n echo \"\U0001F50D checking ${dep} branch...\"\n expect_include_branch=$(get_expect_branch \"$dep\" \"$PULL_BASE_REF\")\n echo \"ℹ️ The expected branch of go module ${dep} is '${expect_include_branch}'.\"\n\n # get the repo and commit\n dep_info=$(go list -m -json \"$dep\" 2>/dev/null) || {\n echo \"ℹ️ Dependency ${dep} not found in this project, skipping.\";\n continue;\n }\n commit=$(echo \"$dep_info\" | jq -r 'if .Version | test(\"-[0-9a-f]{12}$\") then .Version | split(\"-\") | .[2] else \"null\" end')\n if [[ \"$commit\" == \"null\" ]]; then\n echo \"ℹ️ Dependency ${dep} is not using a pseudo-version, skipping check.\"\n continue\n fi\n echo \"ℹ️ The commit of go module ${dep} is '${commit}'.\"\n\n # Extract repo URL from module path, handling possible subfolders\n repo_url=$(echo \"$dep_info\" | jq -r '.Path' | awk -F/ '{print \"https://\"$1\"/\"$2\"/\"$3\".git\"}')\n to_clone_folder=$(basename \"$repo_url\" .git)\n\n git clone \"$repo_url\" ../${to_clone_folder} && pushd ../${to_clone_folder}\n \ git checkout \"${expect_include_branch}\" || (\n echo \"❌ branch ${expect_include_branch} in ${repo_url} not found\"\n exit 1\n )\n\n \ # check whether the commit is in the expected branch\n if ! git merge-base --is-ancestor \"$commit\" \"${expect_include_branch}\"; then\n echo \"❌ commit ${commit} is not in branch '${expect_include_branch}' of ${repo_url}\"\n \ exit 1\n fi\n popd\n echo \"\U0001F389 ${dep} branch is correct\"\n\n \ # clean up for next\n rm -rf ../${to_clone_folder}\ndone\n\necho \"\U0001F389 All dependencies are correct\"\n" command: - bash - -c image: golang:1.25 name: build resources: limits: cpu: 100m memory: 256Mi requests: cpu: 50m memory: 128Mi prowjob_defaults: tenant_id: GlobalDefaultID refs: base_link: https://github.com/tikv/pd/commit/e2ce37be70eb478137bd22b34843c5fff8481d28 base_ref: master base_sha: e2ce37be70eb478137bd22b34843c5fff8481d28 org: tikv pulls: - author: bufferflies author_link: https://github.com/bufferflies commit_link: https://github.com/tikv/pd/pull/9723/commits/1705d8f9d2817b2c1b2b2f01aa7ec2a5776c02b2 head_ref: feat/router_grpc_impl link: https://github.com/tikv/pd/pull/9723 number: 9723 sha: 1705d8f9d2817b2c1b2b2f01aa7ec2a5776c02b2 title: 'Feat(router service): implement grpc function' repo: pd repo_link: https://github.com/tikv/pd report: true rerun_command: /test pull-check-deps type: presubmit status: build_id: "1984087322303401984" completionTime: "2025-10-31T02:41:13Z" description: Job succeeded. pendingTime: "2025-10-31T02:37:35Z" pod_name: 5ded3fff-28f3-45c3-b515-6d3bdf8aa419 prev_report_states: gcsk8sreporter: success gcsreporter: success github-reporter: success startTime: "2025-10-31T02:37:34Z" state: success url: https://prow.tidb.net/view/gs/prow-tidb-logs/pr-logs/pull/tikv_pd/9723/pull-check-deps/1984087322303401984