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

chore:semver_automations #46

Merged
merged 1 commit into from
Sep 10, 2024
Merged

chore:semver_automations #46

merged 1 commit into from
Sep 10, 2024

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Sep 10, 2024

Summary by CodeRabbit

  • New Features

    • Introduced automated labeling for pull requests to enhance organization and clarity.
    • Established a CI/CD pipeline for automated stable releases and synchronization between branches.
    • Implemented a workflow for managing alpha releases, notifications, and proposing stable releases.
  • Bug Fixes

    • Improved the automation of the release process to ensure smoother deployments.
  • Documentation

    • Added descriptions for new workflows to clarify their purpose and functionality.

Copy link

coderabbitai bot commented Sep 10, 2024

Walkthrough

The changes introduce three new GitHub Actions workflows: conventional-release-labels, publish_stable.yml, and release_workflow.yml. The first automates the labeling of pull requests based on conventional practices. The second establishes a CI/CD pipeline for stable releases, including publishing to PyPI and syncing branches. The third orchestrates the release process by publishing alpha versions, notifying channels, and proposing stable releases upon merging pull requests to the dev branch.

Changes

Files Change Summary
.github/workflows/conventional-label.yaml Added a workflow to automatically label pull requests based on conventional release practices.
.github/workflows/publish_stable.yml Introduced a CI/CD pipeline for stable releases, including jobs for publishing to PyPI and syncing branches.
.github/workflows/release_workflow.yml Created a workflow to manage the release process, including publishing alpha versions and proposing stable releases.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub
    participant CI/CD Pipeline
    participant PyPI
    participant Matrix

    User->>GitHub: Open Pull Request
    GitHub->>CI/CD Pipeline: Trigger on PR Merge
    CI/CD Pipeline->>CI/CD Pipeline: Publish Alpha
    CI/CD Pipeline->>Matrix: Notify Merge
    CI/CD Pipeline->>CI/CD Pipeline: Publish to PyPI
    CI/CD Pipeline->>CI/CD Pipeline: Propose Release
Loading

🐇 In the garden, we hop and play,
New workflows bloom, brightening the day!
Labels and releases, all in a line,
With CI/CD magic, everything's fine!
Hooray for the changes, let's dance and cheer,
For a smoother release, we hold so dear! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2085be9 and e1bdd51.

Files selected for processing (3)
  • .github/workflows/conventional-label.yaml (1 hunks)
  • .github/workflows/publish_stable.yml (1 hunks)
  • .github/workflows/release_workflow.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/conventional-label.yaml
Additional context used
actionlint
.github/workflows/publish_stable.yml

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)

.github/workflows/release_workflow.yml

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)

Additional comments not posted (4)
.github/workflows/publish_stable.yml (1)

9-12: Verify external workflow source and secret handling.

The job uses a workflow from TigreGotico/gh-automations. Ensure that this repository is trusted and maintained. Also, verify that the secrets being inherited are managed securely.

.github/workflows/release_workflow.yml (3)

11-19: Verify external workflow source and secret handling.

The job uses a workflow from TigreGotico/gh-automations. Ensure that this repository is trusted and maintained. Also, verify that the secrets being inherited are managed securely.


27-33: Verify third-party action and secure token handling.

The job uses fadenb/[email protected] for sending notifications. Verify that this action is secure and maintained. Also, ensure that the MATRIX_TOKEN is handled securely, possibly using environment secrets.


86-107: Address script issues and verify token handling.

Address the following script issues:

  • Use double quotes to prevent globbing and word splitting in shell scripts.
  • Ensure that the BRANCH_NAME variable is used or removed if unnecessary.

Also, verify that the GITHUB_TOKEN is handled securely and has the necessary permissions for operations performed by this job.

- VERSION=$(python setup.py --version)
+ VERSION="$(python setup.py --version)"

- git checkout -b release-${{ env.VERSION }}
+ git checkout -b "release-${{ env.VERSION }}"

- git push origin release-${{ env.VERSION }}
+ git push origin "release-${{ env.VERSION }}"
Tools
actionlint

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

(shellcheck)


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

@JarbasAl JarbasAl merged commit cf567a0 into dev Sep 10, 2024
1 check passed
@JarbasAl JarbasAl deleted the autos branch September 10, 2024 18:19
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.

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2085be9 and e1bdd51.

Files selected for processing (3)
  • .github/workflows/conventional-label.yaml (1 hunks)
  • .github/workflows/publish_stable.yml (1 hunks)
  • .github/workflows/release_workflow.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/conventional-label.yaml
Additional context used
actionlint
.github/workflows/publish_stable.yml

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)

.github/workflows/release_workflow.yml

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)

Additional comments not posted (4)
.github/workflows/publish_stable.yml (1)

9-12: Verify external workflow source and secret handling.

The job uses a workflow from TigreGotico/gh-automations. Ensure that this repository is trusted and maintained. Also, verify that the secrets being inherited are managed securely.

.github/workflows/release_workflow.yml (3)

11-19: Verify external workflow source and secret handling.

The job uses a workflow from TigreGotico/gh-automations. Ensure that this repository is trusted and maintained. Also, verify that the secrets being inherited are managed securely.


27-33: Verify third-party action and secure token handling.

The job uses fadenb/[email protected] for sending notifications. Verify that this action is secure and maintained. Also, ensure that the MATRIX_TOKEN is handled securely, possibly using environment secrets.


86-107: Address script issues and verify token handling.

Address the following script issues:

  • Use double quotes to prevent globbing and word splitting in shell scripts.
  • Ensure that the BRANCH_NAME variable is used or removed if unnecessary.

Also, verify that the GITHUB_TOKEN is handled securely and has the necessary permissions for operations performed by this job.

- VERSION=$(python setup.py --version)
+ VERSION="$(python setup.py --version)"

- git checkout -b release-${{ env.VERSION }}
+ git checkout -b "release-${{ env.VERSION }}"

- git push origin release-${{ env.VERSION }}
+ git push origin "release-${{ env.VERSION }}"
Tools
actionlint

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

(shellcheck)

Comment on lines +45 to +58
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@v2
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
Copy link

Choose a reason for hiding this comment

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

Update GitHub Actions for branch synchronization.

Update the actions/checkout action to its latest version to ensure compatibility and security:

- uses: actions/checkout@v2
+ uses: actions/checkout@v3

Also, verify that the GITHUB_TOKEN is handled securely and has the necessary permissions for branch operations.

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.

Suggested change
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@v2
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
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@v3
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
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)

Comment on lines +20 to +42
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: dev
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: version
run: echo "::set-output name=version::$(python setup.py --version)"
id: version
- name: Build Distribution Packages
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{secrets.PYPI_TOKEN}}
Copy link

Choose a reason for hiding this comment

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

Update GitHub Actions and ensure secure PyPI token handling.

Update the following actions to their latest versions to avoid deprecation issues and potential security vulnerabilities:

  • actions/checkout@v2 to actions/checkout@v3
  • actions/setup-python@v1 to actions/setup-python@v3

Also, ensure that the PyPI token is handled securely and consider using environment secrets if not already done.

- uses: actions/checkout@v2
+ uses: actions/checkout@v3

- uses: actions/setup-python@v1
+ uses: actions/setup-python@v3

Committable suggestion was skipped due to low confidence.

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)

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