Repository navigation
Link rules, an optional coc field, and fail-loud branch sync - #497
Merged
Merged
Conversation
drop_redundant_link_fields already removed a cfp_link, sponsor or finaid that repeats the main link. It now also removes one that is only the bare root of the same site: an empty or "/" path with no query or fragment, on the same host as link (ignoring "www.") or on a parent domain of it. "cfp_link: https://pycon.de/" next to "link: https://2027.pycon.de/" says nothing about the CfP, so it goes. Sub-pages, #anchors and query strings on the parent domain stay, as do links to other sites and a year subdomain next to a series link, which is more specific than the link itself. The current data has no such links, so the sort leaves _data unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QzyF2ciB5jhvcTVpj4ErMr
check_link_availability treated any redirect that ended on a 200 as a healthy link, even when it landed on another site: pythoncamp.de now redirects to barcamps.eu and pytennessee.org to a casino site. When the final URL is on a different site, the original URL is now returned as it is (no Wayback lookup or save, no replacement), the redirect is logged, and a record is kept for review. Different site means the hosts differ after dropping "www.", neither is a subdomain of the other, and their registrable domains differ. The registrable domain is the last two labels, or three under a known two-level public suffix such as co.uk or org.au, so ug.pycon.org to africa.pycon.org stays the same site. Same-site redirects behave as before. Records go to the module-level REDIRECT_RECORDS list and, when the DESK_QUEUE_OUT environment variable names a file, are appended to it as JSON lines shaped like a "link-check" "redirect" queue item: source, kind, received, title, url, year and a payload with conference, year, field, final_url and status. sort_yaml.check_links passes the conference, year and field as keyword arguments, which default to None, so other callers keep working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QzyF2ciB5jhvcTVpj4ErMr
Conference entries can now carry "coc", a URL to the conference's Code of Conduct. It is validated and serialised like finaid and sponsor (an http or https URL, written back as a plain string) and sits right after finaid in key order: in utils/schema.yml, which order_keywords follows, and in the pydantic model, whose field order the YAML writer follows. It is also listed with the other optional columns in tidy_conf/validation.py and documented in README.md and CONTRIBUTING.md. No entry uses it yet, so the sort leaves _data unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QzyF2ciB5jhvcTVpj4ErMr
When the accumulator branch could not be rebased or merged onto main cleanly, the enrich-tba-conferences and canonical-source-update jobs retried with "git merge origin/main -X theirs", which resolves every conflict in favour of main and silently throws away the data changes already waiting on the branch. Both jobs now collect the conflicted files, abort the merge, report them as "::error title=Branch Sync Conflict::<files>" and exit 1, so a person resolves the conflict. check-conference-update.yml has the same fallback and is left alone here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QzyF2ciB5jhvcTVpj4ErMr
registrable_domain only keeps three labels under a suffix listed in TWO_LEVEL_PUBLIC_SUFFIXES. PyCon Tanzania (pycon.or.tz) and PyCon Israel (pycon.org.il, cfp.pycon.org.il) use suffixes that were not listed, so their registrable domain collapsed to the bare suffix and a redirect to any other site under it, such as a parked page on another .org.il domain, counted as the same site and went unrecorded. or.tz and org.il are the two-level suffixes current entries use that were missing; co.il is added with org.il. Regression cases cover both hosts in TestIsDifferentSite and TestRegistrableDomain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QzyF2ciB5jhvcTVpj4ErMr
Every forms.gle link redirects to docs.google.com, so the cross-site check recorded the three forms.gle cfp_links in conferences.yml (and the ones on recent archive entries) as different-site redirects on every link check. A person would review the same known-good items again after each run, and upcoming forms.gle links lost the Wayback save that any other healthy link gets. is_expected_redirect now covers links that redirect to another site by design. EXPECTED_REDIRECT_TARGETS lists hosts with a known target: forms.gle must land on google.com and lu.ma on luma.com, so a forms.gle link that lands anywhere else is still recorded. URL_SHORTENERS lists general shorteners (bit.ly, goo.gl, tinyurl.com), whose links may land anywhere. Such a redirect is not recorded and the link is checked as it was before the cross-site check: on a 200 the URL is kept and, for an upcoming conference, saved to the Wayback Machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QzyF2ciB5jhvcTVpj4ErMr
The record_redirect docstring and the earlier commit called each record a queue item, but a queue item also carries an "id" (a sha1 of source, kind, url and payload), which the records leave out. The docstring and the comment on REDIRECT_RECORDS_ENV now say that the JSON lines are not complete items: the queue writer assigns the id, and the series key of the file the item goes in, when it adds a line, so both are defined in one place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QzyF2ciB5jhvcTVpj4ErMr
Owner
Author
|
Routine review 1. RequestNo issue is linked, so the request is the PR description. It asks for four things:
2. Checked against
3. Needs your decision
4. FindingsImportant: None. Nits:
5. TestsInvariant coverage, per instance:
Checks run on The empty 6. Bounds
Generated by Claude Code |
Owner
Author
|
Answers to the routine review:
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR of the desk stack. It holds the deterministic rules that every writer runs through, so no LLM is involved here.
Changes
utils/tidy_conf/links.py). Acfp_link,sponsororfinaidthat is only the root of the same site, or of a parent domain, is now removed. Example:https://pycon.de/next tolink: https://2027.pycon.de/. This is what the python-organizers import kept writing back onto PyCon Germany. The existing rule against a sub-link that equalslinkis unchanged. Nothing in the current data matches the new rule.check_link_availability).pytennessee.orgended up serving a gambling site.DESK_QUEUE_OUTnames a file, each record is also appended there as one JSON line, ready for the queue a later PR adds.www.;co.ukandorg.il.forms.gleto Google Forms,lu.matoluma.com) behave as before.cocfield for the conference's Code of Conduct URL. It is added toutils/schema.yml, the pydantic model, the key order (right afterfinaid), the README field table, CONTRIBUTING and the validation columns. Nothing sets it yet; the desk will fill it in on its visits.enrich-tba-conferences.ymlandcanonical-source-update.ymlused to fall back togit merge origin/main -X theirson a conflict, which silently kept main's side and dropped the bot's edits. They now abort, print::error title=Branch Sync Conflict::<files>and fail the job.check-conference-update.ymlis left alone because a later PR rewrites it.Needs your call
pixi run linksisn't scheduled in any workflow. Until a later PR in this stack adds a scheduled, report-only redirect scan, redirects are only found when someone runs it by hand.Checks
uv run --python 3.11 --with "pandas<2.3",..., as in REVIEW.md): 775 passed, 0 failed on this branch. On top of the whole stack: 1092 passed, 0 failed.uvx ruff@0.4.4 check utils tests: all checks passed.python utils/sort_yaml.py --skip_linksexits 0 and leaves_data/unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01QzyF2ciB5jhvcTVpj4ErMr
Generated by Claude Code