-
Notifications
You must be signed in to change notification settings - Fork 3
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
automations #16
automations #16
Conversation
Warning Rate limit exceeded@JarbasAl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 43 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. WalkthroughThis pull request introduces multiple new GitHub Actions workflows and modifies existing ones to automate build tests, license checks, and release publishing. It includes new workflows for managing versioning and publishing to PyPI, alongside streamlined installation processes and enhanced license checking. The updates adhere to Semantic Versioning principles, ensuring a structured and efficient development workflow. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub Actions
participant PyPI
Developer->>GitHub Actions: Push changes to dev branch
GitHub Actions->>GitHub Actions: Run tests and label PR
GitHub Actions->>GitHub Actions: Check for alpha release
GitHub Actions->>PyPI: Publish alpha release
Developer->>GitHub Actions: Merge to master
GitHub Actions->>GitHub Actions: Run stable release workflow
GitHub Actions->>PyPI: Publish stable release
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 11
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- .github/workflows/build_tests.yml (1 hunks)
- .github/workflows/conventional-label.yml (1 hunks)
- .github/workflows/dev2master.yml (1 hunks)
- .github/workflows/license_tests.yml (2 hunks)
- .github/workflows/publish_alpha.yml (1 hunks)
- .github/workflows/publish_stable.yml (1 hunks)
- ovos_PHAL_plugin_mk1/mk1_serial.py (1 hunks)
- scripts/remove_alpha.py (1 hunks)
- scripts/update_version.py (1 hunks)
- version.py (1 hunks)
Files skipped from review due to trivial changes (2)
- .github/workflows/conventional-label.yml
- version.py
Additional context used
actionlint
.github/workflows/dev2master.yml
11-11: 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/build_tests.yml
19-19: 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)
21-21: 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)
.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: shellcheck reported issue in this script: SC2086:info:1:47: Double quote to prevent globbing and word splitting
(shellcheck)
55-55: 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/publish_alpha.yml
24-24: 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)
30-30: 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)
55-55: 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)
55-55: 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)
55-55: 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)
55-55: 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)
95-95: shellcheck reported issue in this script: SC2086:info:1:88: Double quote to prevent globbing and word splitting
(shellcheck)
112-112: 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)
Ruff
scripts/remove_alpha.py
6-6:
sys
imported but unusedRemove unused import:
sys
(F401)
7-7:
os.path.join
imported but unusedRemove unused import
(F401)
7-7:
os.path.dirname
imported but unusedRemove unused import
(F401)
ovos_PHAL_plugin_mk1/mk1_serial.py
10-10: SyntaxError: Expected a statement
10-11: SyntaxError: Expected a statement
scripts/update_version.py
7-7:
sys
imported but unusedRemove unused import:
sys
(F401)
19-19: Ambiguous variable name:
l
(E741)
20-20: Ambiguous variable name:
l
(E741)
Additional comments not posted (5)
.github/workflows/dev2master.yml (1)
3-20
: Workflow setup looks good.The configuration for triggering the workflow and the job setup is appropriate for the intended purpose of pushing changes from
dev
tomaster
.Tools
actionlint
11-11: 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/license_tests.yml (3)
4-8
: Good practice: Explicit branch targeting for workflow triggers.The changes to trigger the workflow only on specific branches (
master
for push anddev
for pull requests) are a good practice as they help in managing CI resources more efficiently.
37-39
: Good practice: Printing the license check report.Adding a step to always print the license check report enhances transparency and aids in debugging. This is a good practice.
30-36
: Enhanced license checking using a dedicated action.The use of
pilosus/[email protected]
for license checking is a good practice as it simplifies the workflow. However, ensure that the versionv0.5.0
of the action is the most stable and appropriate for your needs.Run the following script to verify the action's version:
scripts/update_version.py (1)
32-57
: Well-implemented version update logic.The logic to update the version components based on the specified part (major, minor, build, alpha) is correctly implemented. Resetting the lower version components when updating a higher component is a good practice and is well followed here.
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/build_tests.yml (1 hunks)
Additional context used
actionlint
.github/workflows/build_tests.yml
19-19: 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)
21-21: 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)
Additional comments not posted (5)
.github/workflows/build_tests.yml (5)
4-5
: Branch specification for push events is correctly set.The workflow is now configured to trigger on pushes to the
master
branch, which is a standard practice for mainline development.
7-8
: Branch specification for pull request events is correctly set.The workflow is now configured to trigger on pull requests to the
dev
branch, ensuring that all changes are tested before merging.
13-16
: Job strategy configuration is well-defined.The strategy allows for parallel execution with a matrix of Python versions, enhancing the testing process across multiple environments.
23-23
: Dynamic Python version setup is implemented correctly.The use of
${{ matrix.python-version }}
allows for dynamic selection of Python versions, which is a significant improvement for flexibility in testing.
37-37
: Installation step name change enhances clarity.Renaming the step to "Install skill" better describes the action being performed, improving the readability and maintainability of the workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/build_tests.yml (1 hunks)
Additional context used
actionlint
.github/workflows/build_tests.yml
19-19: 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)
21-21: 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)
Additional comments not posted (6)
.github/workflows/build_tests.yml (6)
4-8
: Branch specifications added for workflow triggers.The addition of specific branches (
master
anddev
) for both push and pull request events is a good practice as it prevents unnecessary workflow runs on branches that do not require these checks. This change aligns with the PR's objective to enhance automation efficiently.
13-16
: Strategy for parallel execution and Python version matrix defined.Setting
max-parallel: 2
and defining a matrix for Python versions (3.7, 3.8, 3.9, "3.10") are significant improvements. These changes allow for more efficient testing across multiple versions of Python, ensuring compatibility and catching potential issues across versions.
23-23
: Dynamic Python version setup.Updating the Python version setup to utilize the matrix version (
${{ matrix.python-version }}
) instead of a fixed version enhances the flexibility of the workflow. This allows each job to run with the specified version in the matrix, improving test coverage across different Python environments.
30-30
: Streamlined installation of system dependencies.The removal of some packages (
libfann-dev
,portaudio19-dev
,libpulse-dev
) and the removal of the workaround fortflite_runtime
indicate an optimization of the build environment. This should lead to faster build times and less maintenance overhead.
37-39
: Renamed installation step to 'Install skill'.Renaming the step from "Install core repo" to "Install skill" while retaining the installation command (
pip install .
) clarifies the purpose of the step without altering its functionality. This change improves the readability and understandability of the workflow file.
40-49
: Added package auditing step usingpypa/gh-action-pip-audit
.The inclusion of a step to audit installed packages using
pypa/gh-action-pip-audit
is a proactive measure to ensure security. The specified ignore list for vulnerabilities that are irrelevant to the project is a thoughtful addition, although it's important to periodically review these exceptions to ensure they remain valid.
There was a problem hiding this 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
Outside diff range, codebase verification and nitpick comments (1)
.github/workflows/license_tests.yml (1)
30-39
: Approved new steps for license checking and report printing.The use of
pilosus/[email protected]
for license checking is a streamlined approach. The step to print the report usingalways()
ensures that the output is visible regardless of previous steps' success or failure.Consider adding a brief comment before the
echo
command in the report printing step to clarify what is being printed for better maintainability.+ # Print the license check report echo "${{ steps.license_check_report.outputs.report }}"
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- .github/workflows/build_tests.yml (1 hunks)
- .github/workflows/dev2master.yml (1 hunks)
- .github/workflows/license_tests.yml (2 hunks)
- .github/workflows/publish_alpha.yml (1 hunks)
- .github/workflows/publish_stable.yml (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- .github/workflows/build_tests.yml
- .github/workflows/dev2master.yml
Additional context used
actionlint
.github/workflows/publish_stable.yml
34-34: shellcheck reported issue in this script: SC2086:info:1:47: Double quote to prevent globbing and word splitting
(shellcheck)
55-55: 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/publish_alpha.yml
55-55: 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)
55-55: 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)
55-55: 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)
55-55: 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)
95-95: shellcheck reported issue in this script: SC2086:info:1:88: Double quote to prevent globbing and word splitting
(shellcheck)
112-112: 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)
Additional comments not posted (1)
.github/workflows/license_tests.yml (1)
4-8
: Approved trigger conditions.The addition of specific branches (
master
forpush
anddev
forpull_request
) is a good practice to ensure the workflow runs only on relevant branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- .github/workflows/publish_alpha.yml (1 hunks)
- .github/workflows/publish_stable.yml (1 hunks)
- scripts/remove_alpha.py (1 hunks)
- scripts/update_version.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- scripts/remove_alpha.py
Additional context used
Ruff
scripts/update_version.py
18-18: Ambiguous variable name:
l
(E741)
19-19: Ambiguous variable name:
l
(E741)
actionlint
.github/workflows/publish_stable.yml
55-55: 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/publish_alpha.yml
55-55: 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)
55-55: 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)
55-55: 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)
55-55: 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)
112-112: 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)
Additional comments not posted (2)
scripts/update_version.py (2)
31-56
: LGTM!The logic to update version components based on the specified part is correctly implemented.
58-65
: Well-implemented CLI handling.The command-line interface setup and function invocation are correctly implemented using
argparse
andabspath
.
There was a problem hiding this 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
Files selected for processing (3)
- .github/workflows/publish_stable.yml (1 hunks)
- .github/workflows/release_workflow.yml (1 hunks)
- ovos_PHAL_plugin_mk1/version.py (1 hunks)
Files skipped from review due to trivial changes (1)
- ovos_PHAL_plugin_mk1/version.py
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)
.github/workflows/release_workflow.yml
31-31: 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)
37-37: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting
(shellcheck)
49-49: 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 (1)
.github/workflows/release_workflow.yml (1)
49-55
: TheBRANCH_NAME
variable flagged as unused by shellcheck is likely used for documentation purposes or for future use. No action needed.Tools
actionlint
49-49: shellcheck reported issue in this script: SC2034:warning:2:1: BRANCH_NAME appears unused. Verify use (or export if used externally)
(shellcheck)
ref: dev | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update GitHub Action to the latest version.
The actions/setup-python@v2
action is outdated. Consider updating it to the latest version to ensure compatibility and access to the latest features.
Apply this update:
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v3
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.
uses: actions/setup-python@v2 | |
uses: actions/setup-python@v3 |
Tools
actionlint
31-31: 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)
run: | | ||
VERSION=$(python setup.py --version) | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote variable in shell script to prevent issues.
The shell script does not quote the $VERSION
variable, which could lead to word splitting or globbing issues.
Apply this fix:
- echo "VERSION=$VERSION" >> $GITHUB_ENV
+ echo "VERSION=$VERSION" >> "$GITHUB_ENV"
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.
run: | | |
VERSION=$(python setup.py --version) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
run: | | |
VERSION=$(python setup.py --version) | |
echo "VERSION=$VERSION" >> "$GITHUB_ENV" |
Tools
actionlint
37-37: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting
(shellcheck)
There was a problem hiding this 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
Outside diff range, codebase verification and nitpick comments (1)
setup.py (1)
7-28
: LGTM! Suggestions to enhance error handling.The
get_version
function looks good. It provides a centralized way to manage versioning by reading from a dedicated version file. This approach enhances maintainability as the version only needs to be updated in one place.However, consider the following enhancements to improve error handling:
- Validate the existence of the version file before reading. Raise an error or return a default version if the file is missing.
- Handle missing version components gracefully by providing default values. This will prevent the function from breaking if the version file format changes.
Here's an updated version of the function with the suggested enhancements:
def get_version(): """ Find the version of this skill""" version_file = join(dirname(__file__), 'ovos_PHAL_plugin_mk1/version.py') major, minor, build, alpha = (0, 0, 0, 0) # Default values try: with open(version_file) as f: for line in f: if 'VERSION_MAJOR' in line: major = line.split('=')[1].strip() elif 'VERSION_MINOR' in line: minor = line.split('=')[1].strip() elif 'VERSION_BUILD' in line: build = line.split('=')[1].strip() elif 'VERSION_ALPHA' in line: alpha = line.split('=')[1].strip() if ((major and minor and build and alpha) or '# END_VERSION_BLOCK' in line): break except FileNotFoundError: print(f"Version file not found: {version_file}. Using default version.") version = f"{major}.{minor}.{build}" if int(alpha): version += f"a{alpha}" return version
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/build_tests.yml (1 hunks)
- setup.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/build_tests.yml
Additional comments not posted (1)
setup.py (1)
34-34
: LGTM!Replacing the hardcoded version string with a call to
get_version()
is a good change. It ensures that the version specified insetup()
is always in sync with the version defined in the version file. This eliminates the need to manually update the version insetup.py
every time it changes.
Summary by CodeRabbit
New Features
dev
branch to themaster
branch.Bug Fixes
Chores