-
Notifications
You must be signed in to change notification settings - Fork 0
Mark all boards as live #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
241c2ab
Mark all boards as live
Asherlc a16e0e2
Adjust CI path filters for Hangboards data-only updates
Asherlc c4d30f3
Reinstate Hangboards as shared board content in CI filters
Asherlc dcd057f
Skip required iOS build for board-only shared content changes
Asherlc b345362
ci: require iOS checks for shared board content
Asherlc e724168
fix: avoid migration placeholder live manifests
Asherlc 86a4a50
Handle cancelled iOS build reruns in required CI gate
Asherlc 7f32873
Broaden CI concurrency cancelation scope
Asherlc 8e81902
Treat cancelled iOS build gate result as non-blocking
Asherlc 1a020b1
ci: tolerate stuck simulator boot status check
Asherlc 43e2d51
ci: avoid missing timeout utility in simulator bootcheck
Asherlc 7887f1d
Add Pillow to Hangboard Workbench dev deps
Asherlc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #!/usr/bin/env python3 | ||
| """Validate migration draft board directories without authoring placeholder live JSON.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
| import struct | ||
| from pathlib import Path | ||
|
|
||
|
|
||
| PNG_SIGNATURE = b"\x89PNG\r\n\x1a\n" | ||
|
|
||
|
|
||
| def _png_dimensions(path: Path) -> tuple[int, int]: | ||
| with path.open("rb") as handle: | ||
| if handle.read(8) != PNG_SIGNATURE: | ||
| raise ValueError(f"not a PNG: {path}") | ||
| while True: | ||
| length_data = handle.read(4) | ||
| if len(length_data) != 4: | ||
| raise ValueError(f"malformed PNG: {path}") | ||
| (length,) = struct.unpack(">I", length_data) | ||
| chunk_type = handle.read(4) | ||
| if len(chunk_type) != 4: | ||
| raise ValueError(f"malformed PNG: {path}") | ||
| data = handle.read(length) | ||
| if len(data) != length: | ||
| raise ValueError(f"malformed PNG: {path}") | ||
| handle.read(4) # crc | ||
| if chunk_type == b"IHDR": | ||
| if len(data) < 8: | ||
| raise ValueError(f"malformed PNG: {path}") | ||
| return struct.unpack(">II", data[:8]) | ||
| if chunk_type == b"IEND": | ||
| break | ||
| raise ValueError(f"missing PNG header: {path}") | ||
|
Asherlc marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def mark_all_live(hangboards: Path) -> None: | ||
| hangboards = hangboards.resolve() | ||
| for child in sorted(hangboards.iterdir(), key=lambda path: path.name): | ||
| if not child.is_dir(): | ||
| continue | ||
| manifest = child / "board.json" | ||
| if manifest.exists(): | ||
| continue | ||
| image = child / "assets" / "primary.png" | ||
| if not image.is_file(): | ||
| continue | ||
| width, height = _png_dimensions(image) | ||
| if width <= 0 or height <= 0: | ||
| raise ValueError(f"invalid dimensions for {image}") | ||
|
coderabbitai[bot] marked this conversation as resolved.
Asherlc marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def parse_args() -> argparse.Namespace: | ||
| parser = argparse.ArgumentParser(description=__doc__) | ||
| parser.add_argument("--hangboards", type=Path, default=Path("Hangboards")) | ||
| return parser.parse_args() | ||
|
|
||
|
|
||
| def main() -> None: | ||
| args = parse_args() | ||
| mark_all_live(args.hangboards) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.