(Windows) build issues and contributing docs
I noticed some Windows-specific build failures and some gaps in the CONTRIBUTING.md docs.
I have the PR currently in draft mode because I am still doing some more checks on the tests, and I have yet to check the publishing. Felt it was sufficient to start opening it up to review, though.
I'd be happy to provide more details as needed.
This PR addresses the following:
- Note that PNPM version currently used is version 8.x, not last version
I haven't verified yet whether PNPM 9.x works, but I figured it might be useful to specify the version reflected by the lockFileVersion. This part isn't really Windows specific, I hadn't really caught on to the Windows-specificness of my issues yet at this point :) .
- For windows users, document that git setting
core.symlinksshould be true
The symlinks in use in the repo don't work out of the box on Windows, but require a bit of Windows settings fiddling and git settings fiddling.
- Enforce the line endings as they are currently in use in the repo
This avoids Windows users executing pnpm build or adding new files and thereby introducing inconsistent line endings. Current settings in .gitattributes indicate that everything but .bat files use LF. I'm not sure whether the .bat file specifically has to be CRLF, but given that it's currently the case I assumed it would have to be.
I ran git add --update --normalize to verify line endings, but all current files match this configuration.
- Make script arguments in package.json files play more nicely with Windows
Single quotes are a bit of an issue, unfortunately.
In glob-style arguments I replaced the single quotes with escaped double quotes - which are already in use in some glob-style arguments.
For the pack-destination param I removed the quotes, as some package.jsons already have that param without quotes - so I presumed it to be safe.
- Execute the correct
gradlewscript for the current OS
I added a dependency on run-script-os for this. This seems like a fairly sensible and lightweight way to handle it.
-
Non-Windows specific: document that a postgres database is used in some tests and should be available for contributors executing tests.
-
Non-Windows specific: introduce environment variables to override default postgres connection details in integration tests.
In my case, I wanted to use a user other than the default postgres user, so I could have a bit more fine-grained control to the integration tests user. And honestly, so I wouldn't inadvertedly change the password to my root user and break my tests setup.
This would also allow development on a local system, with postgres running within docker or setups like that.
- Ensure Windows paths are correctly handled in tests
Added some path normalization, because current processing was resulting in incorrect paths.
Walkthrough
Walkthrough
The recent updates bring significant enhancements to the project. Notably, improvements include the addition of a .gitattributes file for text file handling, updates in CONTRIBUTING.md for environment setup guidance, and changes in testtools package files like db.ts and schema.ts to utilize environment variables for configuration flexibility and path normalization.
Changes
| File/Path | Summary |
|---|---|
.gitattributes |
Introduces configurations for text file attributes and end-of-line settings. |
CONTRIBUTING.md |
Specifies Node.js and pnpm versions, adds PostgreSQL setup instructions, and provides Windows symlink guidance. |
packages/testtools/src/db.ts |
Updates to use environment variables for database connection, introduces connect() function for dynamic pooling. |
packages/testtools/src/schema.ts |
Modifies loadSchema function to normalize file paths during schema loading. |
[!TIP]
New Features and Improvements
Review Settings
Introduced new personality profiles for code reviews. Users can now select between "Chill" and "Assertive" review tones to tailor feedback styles according to their preferences. The "Assertive" profile posts more comments and nitpicks the code more aggressively, while the "Chill" profile is more relaxed and posts fewer comments.
AST-based Instructions
CodeRabbit offers customizing reviews based on the Abstract Syntax Tree (AST) pattern matching. Read more about AST-based instructions in the documentation.
Community-driven AST-based Rules
We are kicking off a community-driven initiative to create and share AST-based rules. Users can now contribute their AST-based rules to detect security vulnerabilities, code smells, and anti-patterns. Please see the ast-grep-essentials repository for more information.
New Static Analysis Tools
We are continually expanding our support for static analysis tools. We have added support for
biome,hadolint, andast-grep. Update the settings in your.coderabbit.yamlfile or head over to the settings page to enable or disable the tools you want to use.Tone Settings
Users can now customize CodeRabbit to review code in the style of their favorite characters or personalities. Here are some of our favorite examples:
- Mr. T: "You must talk like Mr. T in all your code reviews. I pity the fool who doesn't!"
- Pirate: "Arr, matey! Ye must talk like a pirate in all yer code reviews. Yarrr!"
- Snarky: "You must be snarky in all your code reviews. Snark, snark, snark!"
Revamped Settings Page
We have redesigned the settings page for a more intuitive layout, enabling users to find and adjust settings quickly. This change was long overdue; it not only improves the user experience but also allows our development team to add more settings in the future with ease. Going forward, the changes to
.coderabbit.yamlwill be reflected in the settings page, and vice versa.Miscellaneous
- Turn off free summarization: You can switch off free summarization of PRs opened by users not on a paid plan using the
enable_free_tiersetting.- Knowledge-base scope: You can now set the scope of the knowledge base to either the repository (
local) or the organization (global) level using theknowledge_basesetting. In addition, you can specify Jira project keys and Linear team keys to limit the knowledge base scope for those integrations.- High-level summary placement: You can now customize the location of the high-level summary in the PR description using the
high_level_summary_placeholdersetting (default@coderabbitai summary).- Revamped request changes workflow: You can now configure CodeRabbit to auto-approve or request changes on PRs based on the review feedback using the
request_changes_workflowsetting.
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?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
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 as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger a review. This is useful when automatic reviews are disabled for the repository.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@coderabbitai review
Actions Performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
As for the local publishing workflow, the suggestion in CONTRIBUTING.md to use Verdaccio seemed interesting to me so I tried it out. Two things I noted here:
- The
CONTRIBUTING.mdpoints topublish-previewbeing set up to publish to a local Verdaccio instance, but this no longer seems to be the case. - When I manually ran more or less the same script but actually pointing to my local Verdaccio I bumped into the npm policy of not allowing republishes of the same version number. The package.jsons are currently on 2.1.1 which is an actually publically existing version number that I had probably pulled in via Verdaccio already; and so I couldn't publish that same version locally.
What I ended up doing was to first bump the package.json versions locally, and then publish with that:
pnpm -r exec pnpm version prerelease --no-git-tag-version && pnpm --filter "./packages/**" -r publish
This way, I could then install the prerelease version in my actual project and see my changes. What's the current workflow you all are using for local development? Am I doing something wrong here, or is everyone using the linking workflow for local development?