Skip to content

Automatic releases#42

Merged
pateash merged 3 commits into
mainfrom
automatic-releases
Jun 27, 2024
Merged

Automatic releases#42
pateash merged 3 commits into
mainfrom
automatic-releases

Conversation

@pateash

@pateash pateash commented Jun 27, 2024

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Introduced a GitHub Actions workflow for automatic releases on tag push.
    • CLI now includes an update check with a message when no update is available.

@coderabbitai

coderabbitai Bot commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The recent updates introduce a new GitHub Actions workflow for managing releases and enhance the check_update function within the CliUtils module for improved feedback. In addition, a call to this function has been integrated into the version() command of the CLI to ensure users are informed about updates.

Changes

File(s) Change Summary
.github/workflows/release.yml Introduced a GitHub Actions workflow that triggers on tag pushes, sets up Python, installs dependencies, builds a package, and automates releases.
src/hckr/cli/info.py Added a call to check_update(show_no_update=True) in the version() function to notify users of updates.
src/hckr/utils/CliUtils.py Modified check_update to optionally show a no-update message, updated logging to use debug, and refined success messages.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant CliUtils

    User->>CLI: Run `hckr version`
    CLI->>CliUtils: Call `check_update(show_no_update=True)`
    CliUtils->>CLI: Return update status
    CLI->>User: Display version and update status
Loading

Poem

🐰✨ In code's quiet, a rabbit sings,
Releases bloom with digital wings.
Updates check with version's glow,
Debugging tales in logs do show.
Python paths and patches blend,
In this dance, new features ascend. 🌟


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>.
    • 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 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.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to 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.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.

@github-actions github-actions Bot added enhancement New feature or request github-actions Changes in CICD labels Jun 27, 2024
@github-actions

Copy link
Copy Markdown

Qodana for Python

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Detected 20 dependencies

Third-party software list

This page lists the third-party software dependencies used in project

Dependency Version Licenses
Brotli 1.0.9 MIT
PySocks 1.7.1 BSD-3-Clause
certifi 2024.2.2 MPL-2.0
cffi 1.16.0 MIT
colorama 0.4.6 BSD-3-Clause
conda-content-trust 0.2.0 BSD-3-Clause
cryptography 41.0.7 BSD-3-Clause
distlib 0.3.8 PSF-2.0
filelock 3.14.0 Unlicense
numpy 1.26.4 BSD-3-Clause
pip 23.3.1 MIT
pipenv 2023.12.1 MIT
platformdirs 3.10.0 MIT
pyOpenSSL 23.2.0 Apache-2.0
pycparser 2.21 BSD-3-Clause
setuptools 68.2.2 MIT
tomli 2.0.1 MIT
virtualenv-clone 0.5.4 MIT
virtualenv 20.26.2 MIT
wheel 0.41.2 MIT
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range and nitpick comments (1)
src/hckr/utils/CliUtils.py (1)

Line range hint 33-49: Refactoring and enhancement of check_update function.

The addition of the show_no_update parameter adds flexibility to the function, allowing it to handle user feedback more gracefully. The logic inside the function is clear and maintains good separation of concerns. However, consider handling potential exceptions that might occur during the version check to improve robustness.

def check_update(show_no_update=False):
    try:
        needs_update, latest_version = check_latest_version()
        if needs_update:
            warning(...)
            rich.print(...)
        elif show_no_update:
            success(...)
    except Exception as e:
        logging.error(f"Failed to check update: {e}")
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 915cc44 and e8faf46.

Files selected for processing (3)
  • .github/workflows/release.yml (1 hunks)
  • src/hckr/cli/info.py (2 hunks)
  • src/hckr/utils/CliUtils.py (3 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/release.yml
Additional context used
Ruff
src/hckr/cli/info.py

72-72: f-string without any placeholders

Remove extraneous f prefix

(F541)


75-75: f-string without any placeholders

Remove extraneous f prefix

(F541)

Additional comments not posted (4)
src/hckr/utils/CliUtils.py (2)

8-8: Update on import statements.

The new import for warning from MessageUtils is appropriate for the added functionality in this file. Ensure that MessageUtils is properly tested to avoid any runtime errors.


27-27: Change in logging level from info to debug.

This change is suitable for reducing log verbosity in production environments. However, ensure that this change aligns with the overall logging strategy of the application.

src/hckr/cli/info.py (2)

8-8: New import for check_update.

The import of check_update from CliUtils is correctly placed and used in the version command to check for updates. Ensure that this dependency is well-maintained and tested.


70-70: Integration of update check in the version command.

The call to check_update with show_no_update=True is a thoughtful addition, enhancing the user experience by providing immediate feedback about software updates.

Comment thread src/hckr/cli/info.py
click.secho(f"=={__version__} ", fg="blue", bold=False, nl=True)
check_update(show_no_update=True)
click.secho(
f"Github: https://github.com/pateash/hckr", fg="red", bold=True, nl=True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extraneous f prefix from strings.

The f prefix is used without placeholders, which is unnecessary and could lead to confusion.

-    click.secho(f"Github: https://github.com/pateash/hckr", fg="red", bold=True, nl=True)
+    click.secho("Github: https://github.com/pateash/hckr", fg="red", bold=True, nl=True)
-    click.secho(f"PyPi: https://pypi.org/project/hckr/", fg="yellow", bold=True, nl=True)
+    click.secho("PyPi: https://pypi.org/project/hckr/", fg="yellow", bold=True, nl=True)

Also applies to: 75-75

Tools
Ruff

72-72: f-string without any placeholders

Remove extraneous f prefix

(F541)

@pateash
pateash merged commit 618c99f into main Jun 27, 2024
@pateash
pateash deleted the automatic-releases branch June 27, 2024 06:00
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request github-actions Changes in CICD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant