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

ci(documentation-website): lighthouse check with nginx #11

Open
wants to merge 6 commits into
base: the-one
Choose a base branch
from

Conversation

itsmacr8
Copy link
Member

Replace nodejs lighthouse test with nginx because of poor performance score.

Closes #953

The Pull Request is ready

  • fixes #
  • all actions are passing
  • only fixes a single issue

Overview

Review points

Documentation-Website

  • mobile view is usable
  • desktop view is usable
  • no a-tags are used directly (NavLink, MailLink, ExternalLink instead)
  • all new texts are added to the translation files (at least the english one)
  • tests have been added (if required)
  • shared code has been extracted in a different file

Notes

Replace nodejs lighthouse test with nginx because of poor performance score.

Closes #953
Copy link
Contributor

coderabbitai bot commented May 12, 2024

Walkthrough

The changes involve transitioning from a Node.js environment to an Nginx-based setup for running Lighthouse checks on the documentation website. This includes configuring Nginx, modifying the workflow to support these changes, and simplifying the Lighthouse script in the package.json file.

Changes

Files Change Summary
.github/workflows/documentation-website... Removed Node.js setup, added Nginx installation, configuration, and Lighthouse Check steps.
nginx.conf Added configurations for user, worker settings, event handling, HTTP settings, logging, and gzip.
package.json Simplified lighthouse script by removing start-server-and-test and directly running Lighthouse.

Poem

In the web's vast, endless night,
Nginx takes flight, a beacon bright.
Node.js steps back, its task complete,
Lighthouse shines, the circle's neat.
CodeRabbit's path, now clear and true,
Efficiency, the goal in view.
🚀✨


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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for contributing!
Please make sure the actions pass. Once your pull request has been merged, you will automatically be added to the contributor's list on the website.
If you want to be shouted out on Linkedin, have a look for the shoutout issue of the specific version.

You can also find us on slack at idrinth-api-bench.

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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 4ac0b83 and 55f885c.
Files selected for processing (2)
  • .github/workflows/documentation-website.lighthouse-check.yml (2 hunks)
  • nginx.conf (1 hunks)
Additional comments not posted (1)
.github/workflows/documentation-website.lighthouse-check.yml (1)

48-49: Consider verifying the installation of dependencies before running the Lighthouse check.

nginx.conf Outdated Show resolved Hide resolved
nginx.conf Outdated Show resolved Hide resolved
nginx.conf Outdated Show resolved Hide resolved
nginx.conf Outdated Show resolved Hide resolved
nginx.conf Outdated Show resolved Hide resolved
nginx.conf Outdated Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes May 13, 2024
Idrinth and others added 3 commits May 20, 2024 06:57
- Removed unnecessary settings from nginx file such as SSL Settings, Virtual Host Configs, Proxy pass to the Node.js application
- Update npm script from lighthouse-check file

Closes #953

Co-Authored-By: Björn Büttner <[email protected]>
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: 1

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 55f885c and 79627dc.
Files selected for processing (2)
  • .github/workflows/documentation-website.lighthouse-check.yml (2 hunks)
  • nginx.conf (1 hunks)
Files skipped from review due to trivial changes (1)
  • nginx.conf
Additional comments not posted (2)
.github/workflows/documentation-website.lighthouse-check.yml (2)

39-45: CodeRabbit observes that the installation and configuration of Nginx are correctly implemented.


46-49: CodeRabbit queries the execution of Node.js commands under Nginx environment. Clarify the integration between Nginx and Node.js in this context.

@itsmacr8
Copy link
Member Author

Let me know if more changes are needed, @Idrinth

coderabbitai[bot]
coderabbitai bot previously approved these changes May 20, 2024
Copy link
Member

@Idrinth Idrinth left a comment

Choose a reason for hiding this comment

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

There is a merge conflict as well, please fix that :)

nginx.conf Outdated Show resolved Hide resolved
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: 2

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 79627dc and a971d63.

Files selected for processing (2)
  • nginx.conf (1 hunks)
  • package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • package.json
Additional comments not posted (3)
nginx.conf (3)

2-4: User and worker settings are correctly configured for Nginx.


16-21: HTTP settings are optimized for performance. Disabling server_tokens enhances security by not sending server version information.


35-42: The root directory is set to serve static files from the dist directory, which aligns with the static nature of the documentation website. Cache control headers are appropriately set to prevent caching during development.

Comment on lines +32 to +33
gzip on;
gzip_disable "msie6";
Copy link
Contributor

Choose a reason for hiding this comment

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

Gzip compression is enabled, which is beneficial for performance. However, consider updating the gzip_disable directive to reflect more current browsers.

-    gzip_disable "msie6";
+    gzip_disable "msie6|msie7";

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.

Suggested change
gzip on;
gzip_disable "msie6";
gzip on;
gzip_disable "msie6|msie7";


# Events block for handling connections
events {
worker_connections 768;
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider enabling multi_accept to handle multiple connections more efficiently.

-    # multi_accept on;
+    multi_accept on;

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.

Suggested change
worker_connections 768;
worker_connections 768;
multi_accept on;

Comment on lines +7 to +22
- 'documentation-website/**.ts'
- 'documentation-website/**.tsx'
- 'documentation-website/**.js'
- 'documentation-website/**.cjs'
- 'documentation-website/package-lock.json'
- '.github/workflows/documentation-website.lighthouse-check.yml'
pull_request:
branches:
- the-one
paths:
- 'documentation-website/**.ts'
- 'documentation-website/**.tsx'
- 'documentation-website/**.js'
- 'documentation-website/**.cjs'
- 'documentation-website/package-lock.json'
- '.github/workflows/documentation-website.lighthouse-check.yml'
Copy link
Member

Choose a reason for hiding this comment

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

why is that pointing to documentation-website? That folder exists nowhere

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.

2 participants