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

fix: allow latest bus client version #18

Merged
merged 3 commits into from
Nov 6, 2024
Merged

fix: allow latest bus client version #18

merged 3 commits into from
Nov 6, 2024

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Nov 6, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new workflow for automating the addition of labels to pull requests.
    • Added a workflow for publishing stable releases and synchronizing branches after a successful release.
    • Added a release workflow that automates the release process triggered by merged pull requests.
  • Bug Fixes

    • Updated the version specification for the ovos-bus-client dependency to ensure compatibility.
  • Chores

    • Removed outdated workflows that automated publishing alpha, minor, major, and build releases.

Copy link

coderabbitai bot commented Nov 6, 2024

Warning

Rate limit exceeded

@github-actions[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 16 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 3228484 and e15e13a.

Walkthrough

The changes in this pull request involve the addition of a new GitHub Actions workflow for automating label management on pull requests and the introduction of a workflow for stable releases. Several existing workflows related to publishing and version management have been deleted. Additionally, a modification has been made to the requirements.txt file to adjust the version constraints for a specific dependency.

Changes

File Path Change Summary
.github/workflows/conventional-label.yml New workflow added: conventional-release-labels for automating label addition on PRs.
.github/workflows/dev2master.yml Workflow removed: Push dev -> master.
.github/workflows/publish_alpha.yml Workflow removed: defined publishing alpha builds to PyPI.
.github/workflows/publish_build.yml Workflow removed: defined generating and publishing distribution packages to PyPI.
.github/workflows/publish_major.yml Workflow removed: defined publishing major releases to PyPI.
.github/workflows/publish_minor.yml Workflow removed: defined publishing minor releases to PyPI.
.github/workflows/publish_stable.yml New workflow added: automates publishing stable releases and syncing branches.
.github/workflows/release_workflow.yml New workflow added: automates the release process triggered by closed PRs on the dev branch.
requirements.txt Dependency version updated: ovos-bus-client from >=0.0.6a22 to >=0.0.6,<2.0.0.
scripts/bump_alpha.py File removed: script for incrementing alpha version in a version file.
scripts/bump_build.py File removed: script for incrementing build version in a version file.
scripts/bump_major.py File removed: script for incrementing major version in a version file.
scripts/bump_minor.py File removed: script for incrementing minor version in a version file.
scripts/remove_alpha.py File removed: script for removing or altering alpha version in a version file.

Poem

In the meadow where changes bloom,
A new workflow dispels the gloom.
Labels dance on PRs bright,
While stable releases take flight.
Old scripts gone, a fresh new start,
Automation sings, a work of art! 🌼✨


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 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 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.

@github-actions github-actions bot added feature and removed feature labels Nov 6, 2024
@JarbasAl JarbasAl merged commit 8460e4f into dev Nov 6, 2024
5 of 6 checks passed
@JarbasAl JarbasAl deleted the reqs branch November 6, 2024 01:31
@JarbasAl JarbasAl changed the title feat:semver fix: allow latest bus client version Nov 6, 2024
@github-actions github-actions bot added fix and removed feature labels Nov 6, 2024
Copy link

@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.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.

Actionable comments posted: 5

🧹 Outside diff range and nitpick comments (3)
requirements.txt (1)

2-2: Excellent improvement to version constraints!

The change from >=0.0.6a22 to >=0.0.6,<2.0.0 is a significant improvement because it:

  • Moves away from alpha/unstable versions
  • Prevents breaking changes by capping at major version 2.0.0
  • Follows semantic versioning best practices

Consider applying similar version constraints to other dependencies in the file (e.g., ovos-plugin-manager, ovos_utils) to ensure consistent version control across all dependencies.

.github/workflows/publish_stable.yml (1)

1-58: Consider adding workflow safeguards and monitoring

While the workflow structure is solid, consider these improvements:

  1. Add timeout-minutes to each job to prevent hung workflows
  2. Consider adding status notifications (e.g., Slack, Discord) for failed releases
  3. Add environment protection rules for PyPI deployments

Example configuration for environment protection:

publish_pypi:
  environment:
    name: production
    url: https://pypi.org/project/${{ github.event.repository.name }}
🧰 Tools
🪛 actionlint

22-22: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


27-27: the runner of "actions/setup-python@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


34-34: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


50-50: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 yamllint

[error] 58-58: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/release_workflow.yml (1)

1-108: Consider adding semantic version validation

Given that this PR is titled "feat:semver", consider adding a step to validate that version bumps comply with semantic versioning rules based on PR labels (e.g., major, minor, patch). This could prevent accidental version mismatches.

Example validation:

  • feat: minor version bump
  • fix: patch version bump
  • BREAKING CHANGE: major version bump

Would you like me to provide an implementation for semantic version validation?

🧰 Tools
🪛 actionlint

26-26: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


42-42: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


47-47: the runner of "actions/setup-python@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


54-54: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


76-76: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


82-82: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


94-94: shellcheck reported issue in this script: SC2034:warning:2:1: BRANCH_NAME appears unused. Verify use (or export if used externally)

(shellcheck)

🛑 Comments failed to post (5)
.github/workflows/publish_stable.yml (2)

45-58: 🛠️ Refactor suggestion

Update checkout action and add error handling

The sync_dev job needs some improvements:

Apply these changes:

     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
         with:
           fetch-depth: 0
           ref: master
       - name: Push master -> dev
         uses: ad-m/github-push-action@master
         with:
           github_token: ${{ secrets.GITHUB_TOKEN }}
           branch: dev
+          force: false
+

The changes:

  1. Update checkout action to v4
  2. Add force: false to prevent accidental force pushes
  3. Add newline at end of file
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  sync_dev:
    needs: publish_stable
    if: success()  # Ensure this job only runs if the previous job succeeds
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
          ref: master
      - name: Push master -> dev
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: dev
          force: false

🧰 Tools
🪛 actionlint

50-50: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 yamllint

[error] 58-58: no new line character at the end of file

(new-line-at-end-of-file)


17-43: ⚠️ Potential issue

Update deprecated GitHub Actions and commands

Several components need to be updated to their latest versions:

Apply these changes:

-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
         with:
           ref: dev
           fetch-depth: 0
-      - name: Setup Python
-        uses: actions/setup-python@v1
+      - name: Setup Python
+        uses: actions/setup-python@v4
         with:
           python-version: 3.8
       - name: version
-        run: echo "::set-output name=version::$(python setup.py --version)"
+        run: echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT
         id: version
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  publish_pypi:
    needs: publish_stable
    if: success()  # Ensure this job only runs if the previous job succeeds
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: dev
          fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.8
      - name: Install Build Tools
        run: |
          python -m pip install build wheel
      - name: version
        run: echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT
        id: version
      - name: Build Distribution Packages
        run: |
          python setup.py sdist bdist_wheel
      - name: Publish to Test PyPI
        uses: pypa/gh-action-pypi-publish@master
        with:
          password: ${{secrets.PYPI_TOKEN}}
🧰 Tools
🪛 actionlint

22-22: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


27-27: the runner of "actions/setup-python@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


34-34: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)

.github/workflows/release_workflow.yml (3)

21-36: 🛠️ Refactor suggestion

Update checkout action and review Matrix token usage

  1. The checkout action is using an outdated version. Update to the latest version:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
  1. Consider moving the Matrix channel ID to repository secrets for better maintainability.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  notify:
    if: github.event.pull_request.merged == true
    needs: publish_alpha
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Send message to Matrix bots channel
        id: matrix-chat-message
        uses: fadenb/[email protected]
        with:
          homeserver: 'matrix.org'
          token: ${{ secrets.MATRIX_TOKEN }}
          channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org'
          message: |
            new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }}
🧰 Tools
🪛 actionlint

26-26: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


37-63: 🛠️ Refactor suggestion

Multiple improvements needed for PyPI publishing job

  1. Update outdated actions:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
-      - uses: actions/setup-python@v1
+      - uses: actions/setup-python@v4
  1. Replace deprecated set-output command:
-        run: echo "::set-output name=version::$(python setup.py --version)"
+        run: echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT
  1. Add error handling for the PyPI publish step:
       - name: Publish to Test PyPI
         uses: pypa/gh-action-pypi-publish@master
         with:
           password: ${{secrets.PYPI_TOKEN}}
+          verify_metadata: true
+          verbose: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  publish_pypi:
    needs: publish_alpha
    if: success()  # Ensure this job only runs if the previous job succeeds
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: dev
          fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.8
      - name: Install Build Tools
        run: |
          python -m pip install build wheel
      - name: version
        run: echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT
        id: version
      - name: Build Distribution Packages
        run: |
          python setup.py sdist bdist_wheel
      - name: Publish to Test PyPI
        uses: pypa/gh-action-pypi-publish@master
        with:
          password: ${{secrets.PYPI_TOKEN}}
          verify_metadata: true
          verbose: true
🧰 Tools
🪛 actionlint

42-42: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


47-47: the runner of "actions/setup-python@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


54-54: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


65-108: 🛠️ Refactor suggestion

Modernize the release proposal process

  1. Update outdated actions:
-      - uses: actions/setup-python@v2
+      - uses: actions/setup-python@v4
  1. Fix shellcheck issues and improve version extraction:
       - name: Get version from setup.py
         id: get_version
         run: |
-          VERSION=$(python setup.py --version)
+          VERSION="$(python setup.py --version)"
           echo "VERSION=$VERSION" >> $GITHUB_ENV
  1. Replace curl with GitHub CLI for better maintainability:
-          # Create a PR using GitHub API
-          curl -X POST \
-            -H "Accept: application/vnd.github+json" \
-            -H "Authorization: token $GITHUB_TOKEN" \
-            -d "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$HEAD_BRANCH\",\"base\":\"$BASE_BRANCH\"}" \
-            https://api.github.com/repos/${{ github.repository }}/pulls
+          gh pr create \
+            --title "$PR_TITLE" \
+            --body "$PR_BODY" \
+            --base "$BASE_BRANCH" \
+            --head "$HEAD_BRANCH"
  1. Remove unused BRANCH_NAME variable.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  propose_release:
    needs: publish_alpha
    if: success()  # Ensure this job only runs if the previous job succeeds
    runs-on: ubuntu-latest
    steps:
      - name: Checkout dev branch
        uses: actions/checkout@v3
        with:
          ref: dev

      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'

      - name: Get version from setup.py
        id: get_version
        run: |
          VERSION="$(python setup.py --version)"
          echo "VERSION=$VERSION" >> $GITHUB_ENV

      - name: Create and push new branch
        run: |
          git checkout -b release-${{ env.VERSION }}
          git push origin release-${{ env.VERSION }}

      - name: Open Pull Request from dev to master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          # Variables
          BASE_BRANCH="master"
          HEAD_BRANCH="release-${{ env.VERSION }}"
          PR_TITLE="Release ${{ env.VERSION }}"
          PR_BODY="Human review requested!"

          # Create a PR using GitHub CLI
          gh pr create \
            --title "$PR_TITLE" \
            --body "$PR_BODY" \
            --base "$BASE_BRANCH" \
            --head "$HEAD_BRANCH"
🧰 Tools
🪛 actionlint

76-76: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


82-82: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


94-94: shellcheck reported issue in this script: SC2034:warning:2:1: BRANCH_NAME appears unused. Verify use (or export if used externally)

(shellcheck)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant