-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor(mod)!: rename the go module of this repository #11
Conversation
We now consider this project a hard fork, meaning we do not seek to integrate the changes in the original repository as those a too structural and only present for how specific requirements (e.g. determinism, execution control flow, etc...). By changing the module name we do not rely on importing the original module and use the replace directore anymore, to be used this project must now be imported directly.
WalkthroughThe pull request involves a comprehensive update of import paths for the Prolog library across multiple files, transitioning from Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## main #11 +/- ##
=======================================
Coverage 98.29% 98.29%
=======================================
Files 23 23
Lines 6579 6579
=======================================
Hits 6467 6467
Misses 81 81
Partials 31 31
|
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.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (3)
examples/embed_prolog_into_go/main.go (1)
Line range hint
1-62
: Optional enhancements for improved code qualityWhile not directly related to the PR's main objective, consider the following suggestions to enhance the example:
- Replace
panic
with proper error handling. For example:if err := p.Exec(`...`); err != nil { log.Fatalf("Failed to execute Prolog code: %v", err) }
Add comments explaining the Prolog queries and their expected results to improve readability.
Define the struct used for scanning results outside the loop for better reusability:
type QueryResult struct { Course string Student string } // ... in the loop var s QueryResult if err := sols.Scan(&s); err != nil { log.Printf("Failed to scan solution: %v", err) continue }These changes would make the example more robust and easier to understand, especially for users new to Prolog or this library.
cmd/1pl/main.go (1)
Line range hint
44-47
: Consider updating the comment to reflect the new project name.The comment still refers to "ichiban/prolog". Consider updating it to reflect the new project name "axone-protocol/prolog" for consistency.
Here's a suggested update:
-Top level for ichiban/prolog %s -This is for testing purposes only! -See https://github.com/ichiban/prolog for more details. +Top level for axone-protocol/prolog %s +This is for testing purposes only! +See https://github.com/axone-protocol/prolog for more details.interpreter.go (1)
12-12
: Reminder: Update documentation and other references.While the code change is correct, remember to update any documentation, README files, or other references that might still point to the old repository or import path.
Consider running the following script to identify potential areas that need updating:
#!/bin/bash # Description: Find potential documentation and references that might need updating # Test 1: Search for references to the old repository in markdown files echo "Searching for references to 'ichiban/prolog' in markdown files:" rg --type md 'ichiban/prolog' # Test 2: Search for references to the old repository in Go doc comments echo "Searching for references to 'ichiban/prolog' in Go doc comments:" rg --type go '// .* ichiban/prolog' # Test 3: Check if README.md exists and contains the new repository name echo "Checking if README.md exists and contains the new repository name:" if [ -f README.md ]; then grep 'axone-protocol/prolog' README.md else echo "README.md not found" fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
go.mod
is excluded by!**/*.mod
📒 Files selected for processing (12)
- cmd/1pl/interpreter.go (1 hunks)
- cmd/1pl/main.go (1 hunks)
- examples/call_go_from_prolog/main.go (1 hunks)
- examples/dcg/main.go (1 hunks)
- examples/embed_prolog_into_go/main.go (1 hunks)
- examples/hanoi/main.go (1 hunks)
- examples/initialization/main.go (1 hunks)
- examples/sandboxing/main.go (1 hunks)
- interpreter.go (1 hunks)
- interpreter_test.go (1 hunks)
- solutions.go (1 hunks)
- solutions_test.go (1 hunks)
✅ Files skipped from review due to trivial changes (6)
- cmd/1pl/interpreter.go
- examples/hanoi/main.go
- examples/sandboxing/main.go
- interpreter_test.go
- solutions.go
- solutions_test.go
🔇 Additional comments (8)
examples/initialization/main.go (1)
7-7
: LGTM! Import statement updated correctly.The import statement has been successfully updated to use the new module path
github.com/axone-protocol/prolog
. This change aligns with the PR objectives to rename the Go module and establish it as an independent fork.To ensure consistency across the codebase, please run the following verification script:
This script will help ensure that the module renaming has been applied consistently throughout the project.
examples/call_go_from_prolog/main.go (2)
Line range hint
1-73
: Verify functionality with the new module.The import changes appear to be the only modifications in this file. The rest of the code remains unchanged, which suggests that the API of the new
github.com/axone-protocol/prolog
module is compatible with the previousgithub.aaakk.us.kg/ichiban/prolog
module. This is a positive sign for maintaining backwards compatibility.However, to ensure that the functionality remains intact with the new module:
- Please run the example code to confirm it still works as expected.
- Consider adding or updating any existing tests to verify the behavior with the new module.
If you encounter any issues during testing, please update the code accordingly or consider documenting any breaking changes if they exist.
7-8
: LGTM: Import statements updated correctly.The import statements have been successfully updated to reflect the new module name
github.com/axone-protocol/prolog
. This change is consistent with the PR objectives of renaming the Go module.To ensure the change is consistent throughout the file, let's run the following script:
✅ Verification successful
Import statements correctly updated.
All references to the old module
github.com/ichiban/prolog
have been successfully removed, and the new modulegithub.aaakk.us.kg/axone-protocol/prolog
is used consistently in the import statements.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all references to the old module have been updated. # Test: Search for any remaining references to the old module. Expect: No results. rg --type go 'github.com/ichiban/prolog' examples/call_go_from_prolog/main.go # Test: Confirm that the new module is used consistently. Expect: Only the import statements. rg --type go 'github.com/axone-protocol/prolog' examples/call_go_from_prolog/main.goLength of output: 241
examples/dcg/main.go (3)
Line range hint
1-85
: Confirmed: No further changes needed in this file.I've reviewed the entire file, and I can confirm that no additional changes are necessary. The usage of the
prolog
package remains the same throughout the file, and the functionality of the program should be unaffected by the module renaming.
Line range hint
1-85
: Summary: Module renaming successfully implemented in this example.This file demonstrates that the module renaming has been successfully implemented without affecting the functionality of existing code. The only required change was updating the import statement, which was done correctly. This example serves as a good reference for other codebases that need to update their imports to use the new module path.
7-7
: LGTM: Import statement updated correctly.The import statement has been successfully updated to use the new module path
github.com/axone-protocol/prolog
. This change aligns with the PR objective of renaming the Go module and establishing it as an independent fork.To ensure this change is consistent across the codebase, let's run the following script:
✅ Verification successful
[Verified] Import statements updated correctly.
All active import statements now use the new module path
github.com/axone-protocol/prolog
, aligning with the PR objective. The previous module path only appears in comments, which does not affect functionality.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all imports of the prolog package use the new path # Test: Search for any remaining imports of the old package. Expect: No results. rg --type go 'github.com/ichiban/prolog' # Test: Confirm that the new import is used consistently. Expect: Consistent usage across all Go files. rg --type go 'github.com/axone-protocol/prolog'Length of output: 1895
interpreter.go (2)
12-12
: LGTM: Import path updated as per PR objectives.The change from
github.com/ichiban/prolog/engine
github.com/axone-protocol/prolog/engine
aligns with the PR objective to rename the Go module. This modification is correct and necessary for establishing this repository as a hard fork of the original project.
12-12
: Verify consistency of import path changes across the project.While this change is correct, it's crucial to ensure that all files in the project have been updated consistently with the new import path.
Let's verify the consistency of this change across the project:
✅ Verification successful
Import path changes are consistent across the project.
- All import statements have been updated to
github.com/axone-protocol/prolog
.- No remaining import statements reference
github.com/ichiban/prolog
.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining references to the old import path # Test 1: Search for any remaining references to the old import path echo "Searching for any remaining references to 'github.com/ichiban/prolog':" rg --type go 'github.com/ichiban/prolog' # Test 2: Verify that go.mod has been updated echo "Checking go.mod for the new module name:" grep 'module github.com/axone-protocol/prolog' go.mod # Test 3: Check for any replace directives in go.mod echo "Checking for any replace directives in go.mod:" grep 'replace' go.modLength of output: 1230
Script:
#!/bin/bash # Description: Search for import statements referencing the old import path # Test 1: Using ast-grep to find imports of 'github.com/ichiban/prolog' echo "Searching for import statements referencing 'github.com/ichiban/prolog':" ast-grep --lang go --pattern $'import $_ "github.com/ichiban/prolog/$_"' .Length of output: 236
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.
Our will be done! Let us merge this and pave the way for what is to come!
Summary
This PR mark the decision of making this repository a hard fork of https://github.com/ichiban/prolog by renaming the go module to
github.com/axone-protocol/prolog
.Motivations
The existence of this repository was originally motivated by our needs in https://github.com/axone-protocol/axoned (e.g. to make this VM deterministic, increase execution control flow, control memory allocation, etc...), and the intention was at first, to propose to integrate these changes to the original repository.
As of today, we consider that these changes would have structural and behavioural impacts mismatching the approach conveyed by the original project, leading us to make this module independent, so that codebases depending on it are totally detached from
ichiban/prolog
.Impacts
Regarding codebases using this module, they must now directly import it under the new module name in their sources, and mention it under the
require
directives of theirgo.mod
, removing thereplace
directive.Misc benefits
As we'll be detached from the original repository, we'll be able to rework the CI 💪.