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

feature: support new plugins api #122

Merged
merged 3 commits into from
Jun 26, 2024
Merged

feature: support new plugins api #122

merged 3 commits into from
Jun 26, 2024

Conversation

rustatian
Copy link
Member

@rustatian rustatian commented Jun 25, 2024

Reason for This PR

ref: roadrunner-server/roadrunner#1941

Description of Changes

  • Support NackWithOptions option.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

Summary by CodeRabbit

  • New Features

    • Added pre-commit hook to check and run golangci-lint.
    • Introduced Githooks installer script for copying pre-commit hooks.
  • Updates

    • Updated the linter tool in GitHub Actions workflow to version v1.59.
    • Updated PHP versions in GitHub Actions workflow to 8.3.
    • Updated import paths and package versions for improved compatibility.
    • Bumped github.com/roadrunner-server/api/v4 to version v4.13.0.
    • Incremental updates to various packages in the tests directory.
  • Improvements

    • Adjusted linter settings for better code quality and consistency.

Signed-off-by: Valery Piashchynski <[email protected]>
@rustatian rustatian added the enhancement New feature or request label Jun 25, 2024
@rustatian rustatian requested a review from wolfy-j June 25, 2024 14:04
@rustatian rustatian self-assigned this Jun 25, 2024
Copy link

coderabbitai bot commented Jun 25, 2024

Walkthrough

The updates encompass various improvements and adjustments to the CI/CD pipeline, version upgrades, and configuration changes. Key modifications include incrementing Go and PHP versions, enhancing linter configurations and checks, updating import paths for compatibility with new package versions, and adding scripts for git hooks and pre-commit enforcement.

Changes

Files Change Summary
.githooks/pre-commit, pre-commit Introduced scripts to enforce linting using golangci-lint.
.github/workflows/linters.yml, .github/workflows/linux.yml Updated linter and PHP versions, respectively.
.golangci.yml Refined linter settings and directory exclusions.
beanstalkjobs/driver.go, beanstalkjobs/item.go, plugin.go Updated import paths for roadrunner-server packages; modified struct and method signatures.
githooks-installer.sh Introduced to set up pre-commit hooks.
go.mod, tests/go.mod Bumped versions of various dependencies under roadrunner-server.

Poem

In codes we trust, the changes flow,
From PHP and Go, upgraded so.
Linters guarding every gate,
Ensuring that our commits are great.
Import paths refreshed, now up to date,
🎉 Cheers to CI/CD's fate! 🐇🚀

Warning

Review ran into problems

Problems (1)
  • Git: Failed to clone repository. Please contact CodeRabbit support.

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.

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: 3

Outside diff range and nitpick comments (1)
plugin.go (1)

[!TIP]
Codebase Verification

Line range hint 44-44:

The functions DriverFromConfig and DriverFromPipeline are crucial for the plugin's functionality, but there are no direct unit tests found for them. To ensure these methods are well-tested and handle all potential edge cases, especially with the new API changes, consider adding explicit unit tests for these functions.

  • File: plugin.go
  • Functions: DriverFromConfig, DriverFromPipeline
Analysis chain

Line range hint 44-44: Review driver construction functions for potential improvements

Both DriverFromConfig and DriverFromPipeline are central to the plugin's functionality. It's important to ensure that these methods are well-tested and handle all potential edge cases, especially with the new API changes.

Also applies to: 54-54


[observations] The initial script did not return any results, which suggests that there may not be explicit tests for the DriverFromConfig and DriverFromPipeline methods.
[analysis] To ensure comprehensive verification, it's important to check if these methods are indirectly tested or if they are covered within other test files.
[actions] We should perform a deeper search to locate any references to these methods within the test files and determine if they are being tested indirectly.
[task review_file_1/3 function_analysis_2/5 sub-task_1/2] Search for references to DriverFromConfig and DriverFromPipeline within the test files.

[observations] Searching for references within the test files can help identify if these methods are being tested indirectly.
[analysis] We need to use a command that searches for these method names across all Go files, including test files.
[actions] Generate a new shell script to search for references to DriverFromConfig and DriverFromPipeline within the Go files.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for unit tests covering the `DriverFromConfig` and `DriverFromPipeline` methods.

# Test: Search for unit tests related to these methods.
rg --type go "Test.*DriverFrom(Config|Pipeline)"

Length of output: 50



Script:

#!/bin/bash
# Description: Search for references to `DriverFromConfig` and `DriverFromPipeline` within the Go files.

# Search for references to `DriverFromConfig`.
rg --type go "DriverFromConfig"

# Search for references to `DriverFromPipeline`.
rg --type go "DriverFromPipeline"

Length of output: 499

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b14d034 and 2df9e0c.

Files ignored due to path filters (3)
  • go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
Files selected for processing (11)
  • .githooks/pre-commit (1 hunks)
  • .github/workflows/linters.yml (1 hunks)
  • .github/workflows/linux.yml (1 hunks)
  • .golangci.yml (3 hunks)
  • beanstalkjobs/driver.go (1 hunks)
  • beanstalkjobs/item.go (4 hunks)
  • githooks-installer.sh (1 hunks)
  • go.mod (1 hunks)
  • plugin.go (1 hunks)
  • pre-commit (1 hunks)
  • tests/go.mod (2 hunks)
Files skipped from review due to trivial changes (8)
  • .githooks/pre-commit
  • .github/workflows/linters.yml
  • .github/workflows/linux.yml
  • .golangci.yml
  • githooks-installer.sh
  • go.mod
  • pre-commit
  • tests/go.mod
Additional comments not posted (5)
plugin.go (2)

4-4: Updated import paths to reflect API changes

The change from v3 to v4 in the jobs API import path is in line with the PR's objectives to support the new plugin API. Ensure that all related code is compatible with this new version.


Line range hint 24-33: Ensure robust initialization and error handling

The initialization function correctly checks for the presence of the plugin configuration and initializes the logger. This is a critical setup step and appears to be handled appropriately.

beanstalkjobs/item.go (2)

14-14: Updated import paths to reflect API changes

This change is consistent with the updates in plugin.go and aligns with the overall objective of supporting the new plugin API version.


7-7: Updated import path for utility functions

The addition of the maps package is likely for the maps.Copy function used later. Ensure that this package is part of the standard library or a well-maintained third-party library to avoid potential future deprecations or issues.

beanstalkjobs/driver.go (1)

12-12: Updated import paths to reflect API changes

This change is consistent with the updates in the other files and aligns with the overall objective of supporting the new plugin API version.

beanstalkjobs/item.go Show resolved Hide resolved
beanstalkjobs/item.go Show resolved Hide resolved
beanstalkjobs/item.go Show resolved Hide resolved
Signed-off-by: Valery Piashchynski <[email protected]>
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2df9e0c and 963b186.

Files ignored due to path filters (1)
  • tests/go.sum is excluded by !**/*.sum
Files selected for processing (1)
  • tests/go.mod (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/go.mod

Signed-off-by: Valery Piashchynski <[email protected]>
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 963b186 and d54d6e0.

Files ignored due to path filters (2)
  • go.work.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
Files selected for processing (1)
  • tests/go.mod (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/go.mod

@rustatian rustatian merged commit d31b630 into master Jun 26, 2024
8 checks passed
@rustatian rustatian deleted the feature/new-jobs-api branch June 26, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant