File tree Expand file tree Collapse file tree
utils/changelog_gate_tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9696 --base-ref 8aaff9fbb645ae9df9ba7593fa63273f839b62fb^1 \
9797 --head-ref 8aaff9fbb645ae9df9ba7593fa63273f839b62fb \
9898 --pr-number 1798
99-
100- - name : Validate the associated pull request
101- env :
102- GH_TOKEN : ${{ github.token }}
103- run : |
104- PR_INFO="$(
105- gh api \
106- -H "Accept: application/vnd.github+json" \
107- "repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/pulls" \
108- --jq '
109- [.[] | select(.state == "open")]
110- | first
111- | if . == null then "" else ([.number, .base.ref] | @tsv) end
112- '
113- )"
114-
115- if [ -z "$PR_INFO" ]; then
116- echo "::notice::No open pull request is associated with ${GITHUB_SHA}; skipping PR-diff validation"
117- exit 0
118- fi
119-
120- IFS=$'\t' read -r PR_NUMBER BASE_BRANCH <<<"$PR_INFO"
121- git fetch --no-tags origin \
122- "+refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}"
123-
124- if git diff --quiet \
125- "origin/${BASE_BRANCH}...${GITHUB_SHA}" \
126- -- perf-changelog.yaml; then
127- echo "::notice::PR #${PR_NUMBER} does not change perf-changelog.yaml; skipping PR-diff validation"
128- exit 0
129- fi
130-
131- python utils/validate_perf_changelog.py \
132- --changelog-file perf-changelog.yaml \
133- --base-ref "origin/${BASE_BRANCH}" \
134- --head-ref "$GITHUB_SHA" \
135- --pr-number "$PR_NUMBER"
Original file line number Diff line number Diff line change @@ -252,25 +252,6 @@ def test_run_sweep_checks_changelog_before_reuse_and_setup() -> None:
252252 )
253253
254254
255- def test_changelog_gate_skips_prs_without_changelog_changes () -> None :
256- repo_root = Path (__file__ ).resolve ().parents [2 ]
257- workflow = yaml .load (
258- (repo_root / ".github/workflows/test-changelog-gate.yml" ).read_text (),
259- Loader = yaml .BaseLoader ,
260- )
261- steps = workflow ["jobs" ]["test-changelog" ]["steps" ]
262- validate_step = next (
263- step
264- for step in steps
265- if step .get ("name" ) == "Validate the associated pull request"
266- )
267- script = validate_step ["run" ]
268-
269- assert "git diff --quiet" in script
270- assert "-- perf-changelog.yaml" in script
271- assert "skipping PR-diff validation" in script
272-
273-
274255def test_merge_helper_waits_for_changelog_check_before_merge () -> None :
275256 repo_root = Path (__file__ ).resolve ().parents [2 ]
276257 script = (repo_root / "utils/merge_with_reuse.sh" ).read_text ()
You can’t perform that action at this time.
0 commit comments