-
Notifications
You must be signed in to change notification settings - Fork 183
[Stellar] download rust package gitignore #726
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: master
Are you sure you want to change the base?
[Stellar] download rust package gitignore #726
Conversation
Co-authored-by: Eric Lau <ericglau@outlook.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes add a .gitignore file to generated Rust projects within the Stellar package. A gitIgnore constant containing "target/" is introduced, and the .gitignore file is written to the project archives. Test expectations and snapshot outputs are updated to reflect the new file inclusion. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
Comment |
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: 0
🧹 Nitpick comments (1)
packages/core/stellar/src/zip-rust.ts (1)
42-42: LGTM! Consider additional common Rust ignores.The
.gitignoreis correctly added at the workspace root. The current implementation meets the requirement from issue #710.For enhanced developer experience, you might consider adding commonly ignored entries:
**/*.rs.bk(rustfmt backup files)Cargo.lock(for library projects; already appropriate for binaries to track it).DS_Store/Thumbs.db(OS artifacts).vscode//.idea/(IDE artifacts)If you'd like to enhance the gitignore, here's an example:
const gitIgnore = `\ target/ +**/*.rs.bk +.DS_Store `;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/core/stellar/src/zip-rust.compile.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (4)
packages/core/stellar/src/utils/compile-test.ts(1 hunks)packages/core/stellar/src/zip-rust.compile.test.ts.md(1 hunks)packages/core/stellar/src/zip-rust.ts(2 hunks)packages/core/stellar/src/zip-scaffold.compile.test.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build (solidity, default)
- GitHub Check: build (stellar, compile)
🔇 Additional comments (4)
packages/core/stellar/src/zip-rust.compile.test.ts.md (1)
141-142: LGTM! Snapshot correctly updated.The snapshot properly reflects the new
.gitignorefile content withtarget/exclusion.packages/core/stellar/src/utils/compile-test.ts (1)
59-59: LGTM! Test expectations correctly updated.The addition of
.gitignoreto the expected files list properly reflects the new zip structure.packages/core/stellar/src/zip-rust.ts (1)
28-30: Clean implementation of gitignore constant.The
.gitignorecontent correctly excludes thetarget/directory and includes a trailing newline, following standard text file conventions.packages/core/stellar/src/zip-scaffold.compile.test.ts (1)
30-30: No action required—.gitignoreis correctly included in the scaffold.The implementation already writes
.gitignoreto the archive. ThezipScaffoldProjectfunction chains tocreateRustZipEnvironment, which adds the.gitignorefile at line 42 ofzip-rust.ts.
Fixes #710
Summary
Add
.gitignoreto generated Rust contract zip files for Stellar contracts and update related tests.Description
This merge request ensures that a
.gitignorefile is included in the Rust contract environment zipgenerated by the Stellar contract packaging logic. The
.gitignorefile excludes thetarget/directory, aligning with standard Rust project practices. All relevant test utilities and snapshot
files have been updated to expect and verify the presence of
.gitignorein the zip output.Motivation / Context
Including
.gitignorein generated Rust contract environments prevents unnecessary build artifactsfrom being tracked in version control. This change improves developer experience and aligns with
best practices for Rust projects. No related issue is referenced.
Changes
.gitignorefile to Rust contract zip output inzip-rust.ts.compile-test.tsto expect.gitignorein zip contents.zip-scaffold.compile.test.tsto expect.gitignore.Affected functions
createRustZipEnvironment: Now adds.gitignoreto the zip.runRustCompilationTestand related test logic: Updated expected files list to include.gitignore.Security Impact
✅ No security impact.
✅ No security-sensitive modifications.
Testing
.gitignoreis present.Backward Compatibility