-
Notifications
You must be signed in to change notification settings - Fork 41
Migrate OCaml reference tracking to single-line hyperlink format #1915
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
base: develop
Are you sure you want to change the base?
Conversation
.github/scripts/check-ocaml-refs.sh
Outdated
| # Usage: ./.github/scripts/check-ocaml-refs.sh [--repo REPO_URL] [--branch BRANCH] [--update] | ||
| # | ||
| # Supports two formats: | ||
| # 1. New hyperlink format: /// OCaml: <https://github.com/MinaProtocol/mina/blob/COMMIT/path#L1-L10> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot we don't want to support both formats. We want to support only the new hyperlink format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in d6c16fb. The CI script now only supports the hyperlink format. Removed all legacy multi-line format parsing and validation code, simplifying the script from 367 to 243 lines.
OCaml Reference Validation ResultsRepository: https://github.com/MinaProtocol/mina.git Click to see full validation output |
|
core/src/constants.rs
Outdated
| /// Related OCaml implementation: <https://github.com/MinaProtocol/mina/tree/compatible/src/config> | ||
| /// Protocol specification: <https://github.com/MinaProtocol/mina/blob/compatible/docs/specs/types_and_structures/serialized_key.md> | ||
| /// OCaml: <https://github.com/MinaProtocol/mina/tree/compatible/src/config> | ||
| /// OCaml: <https://github.com/MinaProtocol/mina/blob/compatible/docs/specs/types_and_structures/serialized_key.md> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Keep "Protocol specification" here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored in 2356e5a. Changed back to "Protocol specification:" since this is a documentation link, not an OCaml implementation reference.
|
@copilot rebase |
I'm unable to perform git rebase operations directly. Rebasing requires executing git commands that are outside my available capabilities. You'll need to perform the rebase manually or have someone with git access to the repository handle it. |
2356e5a to
c1b7f75
Compare
Converted 43 OCaml references from multi-line format to single-line hyperlink format across 4 files: - ledger/src/scan_state/transaction_logic/mod.rs (24 refs) - ledger/src/scan_state/transaction_logic/signed_command.rs (15 refs) - ledger/src/scan_state/transaction_logic/for_tests.rs (3 refs) - ledger/src/account/account.rs (1 ref) Old format: /// OCaml reference: src/lib/mina_base/transaction_status.ml L:9-51 /// Commit: 5da42ccd72e791f164d4d200cf1ce300262873b3 /// Last verified: 2025-10-08 New format: /// OCaml: <https://github.com/MinaProtocol/mina/blob/5da42ccd72e791f164d4d200cf1ce300262873b3/src/lib/mina_base/transaction_status.ml#L9-L51> Co-authored-by: dannywillems <[email protected]>
Standardized 6 OCaml references in 4 files to use consistent format: - core/src/block/prevalidate.rs (2 refs) - core/src/constants.rs (2 refs) - mina-p2p-messages/src/string.rs (2 refs) - node/src/transition_frontier/sync/transition_frontier_sync_reducer.rs (1 ref) All references now use: /// OCaml: <URL> Note: mina-p2p-messages/src/v2/generated.rs is auto-generated and uses markdown link format. This will be handled by updating the code generator in a separate effort. Co-authored-by: dannywillems <[email protected]>
Updated documentation to reflect the new single-line hyperlink format: - website/docs/developers/ocaml-reference-tracking.md: Complete rewrite of format specification and examples - CLAUDE.md: Updated example to use hyperlink format The new format is simpler and more maintainable: /// OCaml: <https://github.com/MinaProtocol/mina/blob/COMMIT/path#L1-L10> Co-authored-by: dannywillems <[email protected]>
Updated .github/scripts/check-ocaml-refs.sh to parse and validate both: - New hyperlink format: /// OCaml: <https://github.com/MinaProtocol/mina/blob/COMMIT/path#L1-L10> - Legacy multi-line format (for backward compatibility) The script now: - Extracts commit hash, file path, and line ranges from URL fragments - Validates file existence and line ranges for both formats - Supports auto-update mode to refresh commit hashes in URLs - Maintains backward compatibility during the transition period Updated documentation to reflect that the script now fully supports the new format. Co-authored-by: dannywillems <[email protected]>
Applied markdown formatting to documentation. All format checks pass successfully. Co-authored-by: dannywillems <[email protected]>
Updated .github/scripts/check-ocaml-refs.sh to only support the new hyperlink format. Removed all legacy multi-line format parsing and validation code. Changes: - Removed legacy format detection (lines 69, 190-290, 333-350) - Simplified script from 367 to 243 lines - Updated header comment to reflect hyperlink-only support - Updated documentation to remove backward compatibility mention The script now exclusively validates: /// OCaml: <https://github.com/MinaProtocol/mina/blob/COMMIT/path#L1-L10> Co-authored-by: dannywillems <[email protected]>
Changed line 91 in core/src/constants.rs back to "Protocol specification:" instead of "OCaml:" since this is a link to protocol documentation, not OCaml implementation code. Co-authored-by: dannywillems <[email protected]>
c1b7f75 to
82fc86c
Compare
Description
Standardizes OCaml reference comments to use single-line hyperlinks instead of multi-line format, improving readability and IDE integration.
Old format:
New format:
/// OCaml: <https://github.com/MinaProtocol/mina/blob/5da42ccd72e791f164d4d200cf1ce300262873b3/src/lib/mina_base/transaction_status.ml#L9-L51>Changes made:
.github/scripts/check-ocaml-refs.shto exclusively validate hyperlink format only (no legacy support). Removed all legacy multi-line format support, simplifying the script from 367 to 243 lines (33% reduction)website/docs/developers/ocaml-reference-tracking.mdandCLAUDE.mdwith new format specification and examplescore/src/constants.rs(distinct from OCaml implementation references)Note: Auto-generated file
mina-p2p-messages/src/v2/generated.rs(299 references) uses markdown link format and remains unchanged.Related Issue(s)
Issue tracking handled separately
Type of Change
Testing
make check-format,make check-md,make check-trailing-whitespace)Changelog Entry
Changelog Summary:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.