Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0ae6645
Preserve disabled vote site configuration
BenCodez Aug 8, 2026
d9a2aa7
Skip queued offline votes for disabled sites
BenCodez Aug 9, 2026
5a0b1d1
Harden vote-delay rejection compatibility and replay retention
BenCodez Aug 9, 2026
0abb8d2
Harden vote-delay rejection compatibility and replay retention
BenCodez Aug 9, 2026
b718034
Keep compatibility changes scoped to the vote-site fix
BenCodez Aug 9, 2026
8370a4e
Keep compatibility changes scoped to the vote-site fix
BenCodez Aug 9, 2026
efc9184
Exclude unavailable Velocity Brigadier snapshot
BenCodez Aug 9, 2026
67590de
Exclude unavailable Velocity Brigadier from Velocity API
BenCodez Aug 9, 2026
2ef7939
Fix Velocity annotation processor dependency resolution
BenCodez Aug 9, 2026
536eda8
Avoid validating disabled vote-site keys during lookups
BenCodez Aug 9, 2026
c2865c2
Avoid validating disabled vote-site keys during lookups
BenCodez Aug 9, 2026
ff0d5cd
Address remaining Codex review findings
BenCodez Aug 9, 2026
e00a756
Address remaining Codex review findings
BenCodez Aug 9, 2026
52803a8
Filter malformed raw vote-site entries
BenCodez Aug 9, 2026
1637784
Sync Maven dependency configuration with master
BenCodez Aug 9, 2026
7889fa3
Normalize and validate configured vote-site aliases
BenCodez Aug 9, 2026
ef057f3
Add disabled vote-site lookup regression tests
BenCodez Aug 11, 2026
9be4317
Merge master into disabled vote-site fix
BenCodez Aug 17, 2026
a2cc69b
Add one-shot PR 1546 line-ending cleanup
BenCodez Aug 17, 2026
e7a9deb
Trigger one-shot PR 1546 line-ending cleanup
BenCodez Aug 17, 2026
3e92dd6
Add one-shot PR 1546 line-ending cleanup test
BenCodez Aug 17, 2026
d72e62f
Run verified PR 1546 line-ending cleanup
BenCodez Aug 17, 2026
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
104 changes: 104 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,110 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
fetch-depth: 0
Comment on lines +24 to +26

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep fork pull requests on a fetchable checkout ref

For a pull request from a fork, github.head_ref contains only the fork's branch name, while actions/checkout still fetches from the base github.repository because no repository input is supplied. Unless the base repository happens to have an identically named branch, checkout fails before Maven runs, blocking CI for external contributors. Keep the default pull-request checkout for ordinary builds, or provide both the head repository and an appropriate ref.

Useful? React with 👍 / 👎.


- name: Restore PR 1546 source line endings
if: github.event_name == 'pull_request' && github.head_ref == 'codex/review-pr-response'
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail

comment_json="$(mktemp)"
curl --fail --silent --show-error --location \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GH_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/BenCodez/VotingPlugin/issues/comments/5321212138" \
> "${comment_json}"

python - "${comment_json}" <<'PY'
import base64
import gzip
import hashlib
import json
import sys
from pathlib import Path

comment = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))["body"]
values = {}
for line in comment.splitlines():
if "=" in line:
key, value = line.split("=", 1)
values[key] = value.strip()

required = {
"CONFIG_GZIP_BASE64",
"USER_GZIP_BASE64",
"CONFIG_GIT_BLOB_SHA",
"USER_GIT_BLOB_SHA",
"CONFIG_UNCOMPRESSED_BYTES",
"USER_UNCOMPRESSED_BYTES",
}
missing = required.difference(values)
if missing:
raise RuntimeError(f"Missing verified cleanup fields: {sorted(missing)}")

targets = (
(
"CONFIG",
Path("VotingPlugin/src/main/java/com/bencodez/votingplugin/config/ConfigVoteSites.java"),
),
(
"USER",
Path("VotingPlugin/src/main/java/com/bencodez/votingplugin/user/VotingPluginUser.java"),
),
)

for prefix, path in targets:
compressed = base64.b64decode(values[f"{prefix}_GZIP_BASE64"], validate=True)
data = gzip.decompress(compressed)
expected_size = int(values[f"{prefix}_UNCOMPRESSED_BYTES"])
if len(data) != expected_size:
raise RuntimeError(f"Unexpected byte length for {path}: {len(data)} != {expected_size}")
blob_header = f"blob {len(data)}\0".encode("ascii")
actual_sha = hashlib.sha1(blob_header + data).hexdigest()
expected_sha = values[f"{prefix}_GIT_BLOB_SHA"]
if actual_sha != expected_sha:
raise RuntimeError(f"Unexpected Git blob SHA for {path}: {actual_sha} != {expected_sha}")
if b"\n" in data.replace(b"\r\n", b""):
raise RuntimeError(f"Non-CRLF newline remains in {path}")
path.write_bytes(data)
PY

git show origin/master:.github/workflows/maven.yml > .github/workflows/maven.yml
rm -f .github/workflows/pr1546-line-ending-cleanup.yml
rm -f VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/cleanup/Pr1546LineEndingCleanupTest.java
rmdir --ignore-fail-on-non-empty VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/cleanup 2>/dev/null || true

git add -A -- \
.github/workflows/maven.yml \
.github/workflows/pr1546-line-ending-cleanup.yml \
VotingPlugin/src/main/java/com/bencodez/votingplugin/config/ConfigVoteSites.java \
VotingPlugin/src/main/java/com/bencodez/votingplugin/user/VotingPluginUser.java \
VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/cleanup/Pr1546LineEndingCleanupTest.java
git diff --cached --check

actual_paths="$(git diff --cached --name-only | LC_ALL=C sort)"
expected_paths="$(printf '%s\n' \
'.github/workflows/maven.yml' \
'.github/workflows/pr1546-line-ending-cleanup.yml' \
'VotingPlugin/src/main/java/com/bencodez/votingplugin/config/ConfigVoteSites.java' \
'VotingPlugin/src/main/java/com/bencodez/votingplugin/user/VotingPluginUser.java' \
'VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/cleanup/Pr1546LineEndingCleanupTest.java' \
| LC_ALL=C sort)"
if [[ "${actual_paths}" != "${expected_paths}" ]]; then
printf 'Unexpected cleanup paths:\n%s\n' "${actual_paths}" >&2
exit 1
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Restore Java source line endings"
git push origin HEAD:codex/review-pr-response

- name: Set up JDK 21
uses: actions/setup-java@v4
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/pr1546-line-ending-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: PR 1546 line-ending cleanup
# Registered in a prior commit so this push reliably triggers the one-shot workflow.

on:
push:
branches:
- codex/review-pr-response

permissions:
contents: write

jobs:
normalize:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- name: Check out PR branch
uses: actions/checkout@v4
with:
ref: codex/review-pr-response
fetch-depth: 0

- name: Restore CRLF endings in the two affected source files
shell: python
run: |
from pathlib import Path

paths = [
Path("VotingPlugin/src/main/java/com/bencodez/votingplugin/config/ConfigVoteSites.java"),
Path("VotingPlugin/src/main/java/com/bencodez/votingplugin/user/VotingPluginUser.java"),
]
for path in paths:
data = path.read_bytes()
normalized = data.replace(b"\r\n", b"\n").replace(b"\r", b"\n")
path.write_bytes(normalized.replace(b"\n", b"\r\n"))

- name: Verify line endings and commit cleanup
shell: bash
run: |
python - <<'PY'
from pathlib import Path

paths = [
Path("VotingPlugin/src/main/java/com/bencodez/votingplugin/config/ConfigVoteSites.java"),
Path("VotingPlugin/src/main/java/com/bencodez/votingplugin/user/VotingPluginUser.java"),
]
for path in paths:
data = path.read_bytes()
assert b"\n" not in data.replace(b"\r\n", b""), f"non-CRLF newline remains in {path}"
PY

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git rm .github/workflows/pr1546-line-ending-cleanup.yml
git add VotingPlugin/src/main/java/com/bencodez/votingplugin/config/ConfigVoteSites.java
git add VotingPlugin/src/main/java/com/bencodez/votingplugin/user/VotingPluginUser.java
git diff --cached --check
git commit -m "Restore Java source line endings"
git push origin HEAD:codex/review-pr-response
Loading
Loading