Skip to content
Merged
Show file tree
Hide file tree
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
37 changes: 0 additions & 37 deletions .github/workflows/test-changelog-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,40 +96,3 @@ jobs:
--base-ref 8aaff9fbb645ae9df9ba7593fa63273f839b62fb^1 \
--head-ref 8aaff9fbb645ae9df9ba7593fa63273f839b62fb \
--pr-number 1798

- name: Validate the associated pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
PR_INFO="$(
gh api \
-H "Accept: application/vnd.github+json" \
"repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/pulls" \
--jq '
[.[] | select(.state == "open")]
| first
| if . == null then "" else ([.number, .base.ref] | @tsv) end
'
)"

if [ -z "$PR_INFO" ]; then
echo "::notice::No open pull request is associated with ${GITHUB_SHA}; skipping PR-diff validation"
exit 0
fi

IFS=$'\t' read -r PR_NUMBER BASE_BRANCH <<<"$PR_INFO"
git fetch --no-tags origin \
"+refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}"

if git diff --quiet \
"origin/${BASE_BRANCH}...${GITHUB_SHA}" \
-- perf-changelog.yaml; then
echo "::notice::PR #${PR_NUMBER} does not change perf-changelog.yaml; skipping PR-diff validation"
exit 0
fi

python utils/validate_perf_changelog.py \
--changelog-file perf-changelog.yaml \
--base-ref "origin/${BASE_BRANCH}" \
--head-ref "$GITHUB_SHA" \
--pr-number "$PR_NUMBER"
19 changes: 0 additions & 19 deletions utils/changelog_gate_tests/test_validate_perf_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,25 +252,6 @@ def test_run_sweep_checks_changelog_before_reuse_and_setup() -> None:
)


def test_changelog_gate_skips_prs_without_changelog_changes() -> None:
repo_root = Path(__file__).resolve().parents[2]
workflow = yaml.load(
(repo_root / ".github/workflows/test-changelog-gate.yml").read_text(),
Loader=yaml.BaseLoader,
)
steps = workflow["jobs"]["test-changelog"]["steps"]
validate_step = next(
step
for step in steps
if step.get("name") == "Validate the associated pull request"
)
script = validate_step["run"]

assert "git diff --quiet" in script
assert "-- perf-changelog.yaml" in script
assert "skipping PR-diff validation" in script


def test_merge_helper_waits_for_changelog_check_before_merge() -> None:
repo_root = Path(__file__).resolve().parents[2]
script = (repo_root / "utils/merge_with_reuse.sh").read_text()
Expand Down