diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0383856fe..924244569 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,10 @@ the most useful contribution. From a clone, the file goes to `bios/Manufacturer/Console/filename`, and `python scripts/validate_pr.py path/to/file` names that folder for a file still outside `bios/`. Given a folder, such as an old card's BIOS folder, it checks -every file under it. A file over the browser's 25 MB limit goes in that way. +every file under it. A file over the browser's 25 MB limit goes in that way, +up to the 100 MB GitHub accepts in a push. A larger file stays out of the pull +request: [open an issue](https://github.com/Abdess/retrobios/issues/new?template=missing-bios.yml) with the hashes +`validate_pr.py` prints, and a maintainer adds it to the `large-files` release. ## Add a platform diff --git a/scripts/generate_readme.py b/scripts/generate_readme.py index 596f62d68..01e3ac47d 100644 --- a/scripts/generate_readme.py +++ b/scripts/generate_readme.py @@ -37,6 +37,7 @@ from common import ( from nativemode import check_label import release_record from siteguides import install_command +from validate_pr import LARGE_FILE_ISSUE_URL from verify import verify_platform @@ -930,7 +931,10 @@ the most useful contribution. From a clone, the file goes to `bios/Manufacturer/Console/filename`, and `python scripts/validate_pr.py path/to/file` names that folder for a file still outside `bios/`. Given a folder, such as an old card's BIOS folder, it checks -every file under it. A file over the browser's 25 MB limit goes in that way. +every file under it. A file over the browser's 25 MB limit goes in that way, +up to the 100 MB GitHub accepts in a push. A larger file stays out of the pull +request: [open an issue]({LARGE_FILE_ISSUE_URL}) with the hashes +`validate_pr.py` prints, and a maintainer adds it to the `large-files` release. ## Add a platform diff --git a/tests/test_contributing_text.py b/tests/test_contributing_text.py index bf00749aa..66ced6b53 100644 --- a/tests/test_contributing_text.py +++ b/tests/test_contributing_text.py @@ -97,6 +97,17 @@ class BeforeOpeningAPullRequest(unittest.TestCase): with self.subTest(package=package): self.assertRegex(pip_line, rf"\b{package}\b") + def test_a_file_too_large_for_git_has_a_route(self): + """The guide sent any file over 25 MB through a clone, which GitHub + refuses past 100 MB, and only a maintainer can write to the release.""" + import validate_pr + + text = generate_readme.generate_contributing() + section = text.split("## What happens next", 1)[1].split("\n## ", 1)[0] + self.assertEqual(validate_pr.MAX_FILE_SIZE, 100 * 1024 * 1024) + self.assertIn("100 MB", section) + self.assertIn(f"]({validate_pr.LARGE_FILE_ISSUE_URL})", section) + def test_it_installs_what_the_checks_need_and_no_site_package(self): """The site is built by Node from website/package-lock.json: a pip line naming the old theme installed packages nothing reads."""