Skip to content
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

[WIP] Update continuous integration and contributing guide #368

Merged
merged 4 commits into from
Jan 28, 2025

Conversation

AntObi
Copy link
Collaborator

@AntObi AntObi commented Jan 17, 2025

Update continuous integration and contributing guide

Description

  • Fixes failing pre-commit.ci bot
  • Updates contributing guide for new contributors

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

How Has This Been Tested?

N/A

Test Configuration:

  • Python version: 3.10
  • Operating System: macOS

Reviewers

N/A

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Summary by CodeRabbit

  • Chores
    • Updated pre-commit configuration with monthly auto-update schedule
    • Added custom commit messages for automatic pre-commit fixes and updates
    • Configured to skip specific pre-commit hooks during continuous integration processes
  • Documentation
    • Enhanced contribution guidelines with detailed workflow and setup instructions
    • Introduced a comprehensive contributing guide for the SMACT project
    • Added a "CONTRIBUTING" section to the documentation structure

Copy link
Contributor

coderabbitai bot commented Jan 17, 2025

Walkthrough

The pull request introduces configuration updates to the .pre-commit-config.yaml file, specifically adding a new ci section. This section defines parameters for pre-commit hook management, including an autoupdate schedule set to monthly, skipping the pyright hook, and specifying custom commit messages for automatic fixes and updates. Additionally, the contribution guidelines have been significantly restructured in CONTRIBUTING.md and docs/CONTRIBUTING.md, providing clearer instructions for contributors. A new entry for contribution guidelines has also been added to the documentation's table of contents.

Changes

File Change Summary
.pre-commit-config.yaml Added new ci configuration section with monthly autoupdate schedule, hook skipping, and custom commit messages.
CONTRIBUTING.md Restructured contribution workflow with detailed instructions for setup, branching, and pushing changes.
docs/CONTRIBUTING.md Introduced a comprehensive contributing guide detailing the GitHub flow, environment setup, and testing.
docs/index.rst Added a new entry titled "CONTRIBUTING" to the toctree for enhanced documentation structure.

Possibly related PRs

  • Migrate CI dependency installation from pip to uv #338: The changes in this PR involve modifications to the CI workflow configuration, which may relate to the new ci section added in the main PR's .pre-commit-config.yaml file, as both are focused on enhancing the continuous integration process.
  • Add a Changelog to the Documentation #364: This PR introduces a changelog and updates the documentation structure, which could be relevant to the main PR's changes in .pre-commit-config.yaml as it also aims to improve project management and documentation practices.

Suggested labels

github_actions, docs, enhancement

Poem

🐰 A pre-commit rabbit's delight,
Hooks configured with care so bright.
Monthly updates, smooth and clean,
Skipping checks with a playful sheen.
Commit messages crisp and neat,
Continuous integration's sweet treat! 🔧


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in 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 @coderabbitai in 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
.pre-commit-config.yaml (1)

Line range hint 15-15: Address the TODO comment regarding notebook formatting.

There's a pending task to fix notebooks so that the types_or configuration can be simplified. Would you like assistance in creating a tracking issue for this?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9551abd and 5dec6ab.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml (1 hunks)
🔇 Additional comments (2)
.pre-commit-config.yaml (2)

1-5: Well-structured CI configuration section.

The new CI configuration provides clear automation settings with descriptive commit messages and a reasonable monthly update schedule.


3-3: Verify the necessity of skipping pyright checks.

Skipping the pyright hook in CI might lead to type-related issues being missed. Could you please clarify why this skip is necessary?

Let's check if there are any recent pyright-related issues:

✅ Verification successful

Skipping pyright checks is consistent with project configuration

The project explicitly configures typeCheckingMode = "off" in pyproject.toml, indicating a deliberate choice for gradual typing adoption. The skip in pre-commit aligns with this configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for pyright-related issues in recent commits and PR discussions

# Search for pyright-related comments in recent PRs
gh pr list --state all --limit 10 --json number,title,body | \
  jq '.[] | select(.title | test("pyright"; "i") or .body | test("pyright"; "i"))'

# Search for pyright-related commits
git log --grep="pyright" --since="1 month ago" --pretty=format:"%h %s"

Length of output: 208


Script:

#!/bin/bash
# Check for Python files and type-checking configuration
echo "=== Python Files ==="
fd -e py --type f

echo -e "\n=== Pyright Configuration ==="
fd -g 'pyrightconfig.json'
fd -g 'pyproject.toml' -x cat {}
fd -g 'setup.cfg' -x cat {}

echo -e "\n=== Type Hints Usage ==="
rg "from typing import" -l
rg "import typing" -l

Length of output: 10859

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.04%. Comparing base (5aa7757) to head (6025033).
Report is 6 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #368   +/-   ##
========================================
  Coverage    78.04%   78.04%           
========================================
  Files           31       31           
  Lines         2642     2642           
========================================
  Hits          2062     2062           
  Misses         580      580           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (5)
CONTRIBUTING.md (4)

71-71: Fix typographical error in the instruction.

There's an extra space before the closing parenthesis.

-Fetch the latest changes from the master branch to keep it up to date (make sure you are on the master branch ).
+Fetch the latest changes from the master branch to keep it up to date (make sure you are on the master branch).

Line range hint 82-82: Add missing comma for better readability.

-For a general overview of using pull requests on GitHub look [in the GitHub docs]
+For a general overview of using pull requests on GitHub, look [in the GitHub docs]
🧰 Tools
🪛 LanguageTool

[style] ~10-~10: Would you like to use the Oxford spelling “summarized”? The spelling ‘summarised’ is also correct.
Context: ...he steps for a new piece of work can be summarised as follows: 1. Push up or create [an i...

(OXFORD_SPELLING_Z_NOT_S)


[style] ~61-~61: Consider removing “of” to be more concise
Context: ...are finished with the work, ensure that all of the unit tests pass on your own machine by ...

(ALL_OF_THE)


[style] ~78-~78: Consider shortening or rephrasing this to strengthen your wording.
Context: ...uld lead to merge conflicts if you have made changes to the master branch. ## Pull requests F...

(MAKE_CHANGES)


96-96: Fix grammatical error in the comment.

-pip install -e ".[dev,docs]" # Should be ran from the root of the repository
+pip install -e ".[dev,docs]" # Should be run from the root of the repository

21-43: Consider adding a note about uv's installation requirements.

The guide should mention that uv requires Python 3.8+ and pip to be installed. Also, consider adding platform-specific activation commands for Windows users.

docs/CONTRIBUTING.md (1)

1-117: Consider using a symbolic link or documentation include directive.

To avoid maintaining identical content in two locations, consider either:

  1. Using a symbolic link from docs/CONTRIBUTING.md to CONTRIBUTING.md
  2. Using Sphinx's include directive to include CONTRIBUTING.md in the documentation

This would reduce maintenance overhead and prevent potential inconsistencies.

Example using Sphinx's include directive:

.. include:: ../CONTRIBUTING.md
   :parser: myst_parser.sphinx_
🧰 Tools
🪛 LanguageTool

[style] ~10-~10: Would you like to use the Oxford spelling “summarized”? The spelling ‘summarised’ is also correct.
Context: ...he steps for a new piece of work can be summarised as follows: 1. Push up or create [an i...

(OXFORD_SPELLING_Z_NOT_S)


[style] ~61-~61: Consider removing “of” to be more concise
Context: ...are finished with the work, ensure that all of the unit tests pass on your own machine by ...

(ALL_OF_THE)


[style] ~78-~78: Consider shortening or rephrasing this to strengthen your wording.
Context: ...uld lead to merge conflicts if you have made changes to the master branch. ## Pull requests F...

(MAKE_CHANGES)


[uncategorized] ~82-~82: Possible missing comma found.
Context: ...eral overview of using pull requests on GitHub look [in the GitHub docs](https://help....

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5dec6ab and 6025033.

📒 Files selected for processing (3)
  • CONTRIBUTING.md (3 hunks)
  • docs/CONTRIBUTING.md (1 hunks)
  • docs/index.rst (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/CONTRIBUTING.md

[style] ~10-~10: Would you like to use the Oxford spelling “summarized”? The spelling ‘summarised’ is also correct.
Context: ...he steps for a new piece of work can be summarised as follows: 1. Push up or create [an i...

(OXFORD_SPELLING_Z_NOT_S)


[style] ~61-~61: Consider removing “of” to be more concise
Context: ...are finished with the work, ensure that all of the unit tests pass on your own machine by ...

(ALL_OF_THE)


[style] ~78-~78: Consider shortening or rephrasing this to strengthen your wording.
Context: ...uld lead to merge conflicts if you have made changes to the master branch. ## Pull requests F...

(MAKE_CHANGES)


[uncategorized] ~82-~82: Possible missing comma found.
Context: ...eral overview of using pull requests on GitHub look [in the GitHub docs](https://help....

(AI_HYDRA_LEO_MISSING_COMMA)

CONTRIBUTING.md

[style] ~61-~61: Consider removing “of” to be more concise
Context: ...are finished with the work, ensure that all of the unit tests pass on your own machine by ...

(ALL_OF_THE)


[style] ~78-~78: Consider shortening or rephrasing this to strengthen your wording.
Context: ...uld lead to merge conflicts if you have made changes to the master branch. ## Pull requests F...

(MAKE_CHANGES)

🔇 Additional comments (2)
docs/index.rst (1)

60-60: LGTM! Good addition to the documentation structure.

The CONTRIBUTING entry is properly added to the toctree, making the contribution guidelines easily accessible through the documentation.

CONTRIBUTING.md (1)

38-43: Verify the optional dependencies.

Let's verify that all optional dependencies are properly defined in setup.py.

✅ Verification successful

Optional dependencies are properly defined in pyproject.toml

The optional dependencies mentioned in CONTRIBUTING.md (.[dev,docs,optional]) are all correctly defined in the project configuration file.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if optional dependencies are defined in setup.py
rg -A 5 'optional.*=.*\[' setup.py

Length of output: 85


Script:

#!/bin/bash
# Find package configuration files
echo "=== Package configuration files ==="
fd -e toml -e cfg -e py "^(pyproject|setup)"

# If files are found, search for optional dependencies
echo -e "\n=== Optional dependencies configuration ==="
fd -e toml -e cfg -e py "^(pyproject|setup)" -x cat {}

Length of output: 9391

@AntObi AntObi merged commit f801b90 into develop Jan 28, 2025
15 checks passed
@AntObi AntObi deleted the fix-pre-commit.ci branch January 28, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant