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: Add 10UP Deploy #2469

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

shohag121
Copy link
Member

@shohag121 shohag121 commented Dec 6, 2024

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Related Pull Request(s)

  • Full PR Link

Closes

How to test the changes in this Pull Request:

  • Steps or issue link

Changelog entry

Title

Detailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.

Before Changes

Describe the issue before changes with screenshots(s).

After Changes

Describe the issue after changes with screenshot(s).

Feature Video (optional)

Link of detailed video if this PR is for a feature.

PR Self Review Checklist:

  • Code is not following code style guidelines
  • Bad naming: make sure you would understand your code if you read it a few months from now.
  • KISS: Keep it simple, Sweetie (not stupid!).
  • DRY: Don't Repeat Yourself.
  • Code that is not readable: too many nested 'if's are a bad sign.
  • Performance issues
  • Complicated constructions that need refactoring or comments: code should almost always be self-explanatory.
  • Grammar errors.

FOR PR REVIEWER ONLY:

As a reviewer, your feedback should be focused on the idea, not the person. Seek to understand, be respectful, and focus on constructive dialog.

As a contributor, your responsibility is to learn from suggestions and iterate your pull request should it be needed based on feedback. Seek to collaborate and produce the best possible contribution to the greater whole.

  • Correct — Does the change do what it’s supposed to? ie: code 100% fulfilling the requirements?
  • Secure — Would a nefarious party find some way to exploit this change? ie: everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities?
  • Readable — Will your future self be able to understand this change months down the road?
  • Elegant — Does the change fit aesthetically within the overall style and architecture?

Summary by CodeRabbit

  • New Features
    • Introduced a .distignore file to streamline the distribution process by excluding unnecessary files and directories.
    • Added a GitHub Actions workflow to automate the deployment and release of the WordPress plugin to WordPress.org.

These enhancements improve the efficiency and organization of the plugin's deployment process.

@shohag121 shohag121 added Needs: Dev Review It requires a developer review and approval Need Dev Review Only labels Dec 6, 2024
@shohag121 shohag121 requested a review from mrabbani December 6, 2024 12:14
@shohag121 shohag121 self-assigned this Dec 6, 2024
Copy link
Contributor

coderabbitai bot commented Dec 6, 2024

Walkthrough

This pull request introduces two significant changes: the addition of a .distignore file, which specifies files and directories to be excluded from distribution packages, and a new GitHub Actions workflow file named deploy.yml. The workflow automates the deployment and release process of a WordPress plugin to WordPress.org, triggered by tag pushes, and includes steps for code checkout, PHP setup, dependency installation, SVN installation, plugin deployment, asset updates, and GitHub release creation.

Changes

File Change Summary
.distignore New file added to specify files and directories to ignore in distribution packages.
.github/workflows/deploy.yml New workflow added to automate the deployment and release of a WordPress plugin to WordPress.org.

Assessment against linked issues

Objective Addressed Explanation
Implement GH Action for Dokan Lite Release (Issue #138)
Implement a smooth release process to WP ORG SVN (Issue #138)

Suggested labels

QA approved, :+1: Dev Review Done, Upcoming Release

Suggested reviewers

  • mrabbani

Poem

🐰 In a burrow deep, where the code does play,
A .distignore hops in, keeping clutter at bay.
With deploy.yml ready, our plugin takes flight,
To WordPress.org, it shines ever so bright!
So let’s cheer for the changes, with a twitch of our ears,
For a smooth release journey, let’s raise our cheers! 🎉


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.

Copy link
Contributor

@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 (3)
.github/workflows/deploy.yml (3)

3-6: Consider restricting tag pattern to semantic versioning

The current configuration triggers on any tag. Consider restricting it to semantic versioning pattern to prevent accidental deployments.

 on:
     push:
         tags:
-            - "*"
+            - "v[0-9]+.[0-9]+.[0-9]+*"

20-24: Optimize npm installation and build process

Consider adding npm caching and version pinning for faster and more reliable builds.

+ - name: Setup Node.js
+   uses: actions/setup-node@v4
+   with:
+     node-version: '18'
+     cache: 'npm'
  - name: Build
    run: |
      composer install --no-dev
-     npm install
+     npm ci
      npm run build

1-50: Consider adding post-deployment verification and notifications

To enhance the deployment workflow, consider:

  1. Adding a post-deployment verification step to ensure the plugin is accessible on WordPress.org
  2. Implementing Slack/Discord notifications for deployment status
  3. Adding timeout configurations for long-running steps
  4. Implementing retry logic for potentially flaky operations

Would you like assistance in implementing any of these improvements?

🧰 Tools
🪛 actionlint (1.7.4)

13-13: 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)


46-46: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 608d126 and 9d2a6d7.

⛔ Files ignored due to path filters (23)
  • .wordpress-org/banner-1544x500.png is excluded by !**/*.png
  • .wordpress-org/banner-772x250.png is excluded by !**/*.png
  • .wordpress-org/icon-128x128.gif is excluded by !**/*.gif
  • .wordpress-org/icon-256x256.gif is excluded by !**/*.gif
  • .wordpress-org/screenshot-1.png is excluded by !**/*.png
  • .wordpress-org/screenshot-10.png is excluded by !**/*.png
  • .wordpress-org/screenshot-11.png is excluded by !**/*.png
  • .wordpress-org/screenshot-12.png is excluded by !**/*.png
  • .wordpress-org/screenshot-13.png is excluded by !**/*.png
  • .wordpress-org/screenshot-14.png is excluded by !**/*.png
  • .wordpress-org/screenshot-15.png is excluded by !**/*.png
  • .wordpress-org/screenshot-16.png is excluded by !**/*.png
  • .wordpress-org/screenshot-17.png is excluded by !**/*.png
  • .wordpress-org/screenshot-18.png is excluded by !**/*.png
  • .wordpress-org/screenshot-19.png is excluded by !**/*.png
  • .wordpress-org/screenshot-2.png is excluded by !**/*.png
  • .wordpress-org/screenshot-3.png is excluded by !**/*.png
  • .wordpress-org/screenshot-4.png is excluded by !**/*.png
  • .wordpress-org/screenshot-5.png is excluded by !**/*.png
  • .wordpress-org/screenshot-6.png is excluded by !**/*.png
  • .wordpress-org/screenshot-7.png is excluded by !**/*.png
  • .wordpress-org/screenshot-8.png is excluded by !**/*.png
  • .wordpress-org/screenshot-9.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • .distignore (1 hunks)
  • .github/workflows/deploy.yml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .distignore
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/deploy.yml

13-13: 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)


46-46: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🔇 Additional comments (3)
.github/workflows/deploy.yml (3)

25-28: LGTM!

The SVN installation steps are properly implemented with update and install commands.


38-44: LGTM!

The asset update configuration is properly implemented with appropriate settings.


29-37: LGTM! Verify secrets configuration

The deployment configuration looks good with proper secret handling.

Comment on lines +12 to +13
- name: Checkout code
uses: actions/checkout@v2
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update checkout action to latest version

The actions/checkout@v2 is outdated. Update to the latest stable version to ensure security and compatibility.

 - name: Checkout code
-  uses: actions/checkout@v2
+  uses: actions/checkout@v4
📝 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
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4
🧰 Tools
🪛 actionlint (1.7.4)

13-13: 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 +45 to +50
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: ${{github.workspace}}/${{ github.event.repository.name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update GitHub release action to latest version

The softprops/action-gh-release@v1 is outdated. Update to the latest stable version.

 - name: Create GitHub release
-  uses: softprops/action-gh-release@v1
+  uses: softprops/action-gh-release@v2
   with:
     files: ${{github.workspace}}/${{ github.event.repository.name }}.zip
   env:
     GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 actionlint (1.7.4)

46-46: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

Comment on lines +14 to +19
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer:v2
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update PHP version to supported release

PHP 7.4 has reached end of life. Consider updating to a supported PHP version (8.1 or 8.2) for security and performance benefits.

 - name: Setup PHP 7.4
   uses: shivammathur/setup-php@v2
   with:
-    php-version: '7.4'
+    php-version: '8.1'
     coverage: none
     tools: composer:v2
📝 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
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer:v2
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: composer:v2

Copy link
Member

@mrabbani mrabbani left a comment

Choose a reason for hiding this comment

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

Pls consult with @getdokan/product to update images.

@mrabbani mrabbani added Needs: Author Reply and removed Needs: Dev Review It requires a developer review and approval labels Dec 11, 2024
@jamil-mahmud
Copy link

@mrabbani vai, I have already given a task to marketing team to provide me some updated image of dokan plugin for wp org few days back and probably they will provide the images to me on next week. If this 10UP related deployment dependency is very urgent then kindly proceed onto that for now. Once the updated screenshot images will be available to me I will provide those resources at that time and on following deployment images can be updated as well.

Copy link
Member

@mrabbani mrabbani left a comment

Choose a reason for hiding this comment

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

Pls check CodeRabbit recommendations for the version of Github actions.

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

Successfully merging this pull request may close these issues.

3 participants