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

Created site reporter #3

Merged
merged 49 commits into from
Aug 6, 2024
Merged

Created site reporter #3

merged 49 commits into from
Aug 6, 2024

Conversation

Bullrich
Copy link
Owner

@Bullrich Bullrich commented Jul 31, 2024

Created a GitHub action that downloads the previous artifacts, download the current status, and then checks on the servers.

After each run it writes the updated information to the reports, removing outdated reports (default to 45 days).

Once this is done, the build process runs normally, using the updated log file.

Summary by CodeRabbit

  • New Features

    • Introduced a new GitHub Action for monitoring and reporting health check statuses of specified URLs.
    • Added a metrics collection and reporting step to the CI/CD workflow.
    • Implemented artifact management for storing and retrieving health check reports.
  • Bug Fixes

    • Updated logging and error handling for health checks, ensuring clearer status reporting.
  • Documentation

    • Created a new .gitignore file to enhance project cleanliness.
  • Tests

    • Added unit tests to validate functionality for the newly introduced components.

Copy link

coderabbitai bot commented Jul 31, 2024

Warning

Rate limit exceeded

@Bullrich has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 33 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Commits

Files that changed from the base of the PR and between 1593644 and 99b0964.

Walkthrough

The changes introduce significant enhancements to the CI/CD workflow, adding a metrics collection job and structured testing for improved reliability. New utility classes and interfaces facilitate artifact management and status checking, while logging and configuration files ensure streamlined operations. This comprehensive update establishes a more robust foundation for monitoring site health and managing artifacts in GitHub Actions.

Changes

File(s) Change Summary
.github/workflows/deploy-site.yml, .github/workflows/tests.yml Added get-metrics job for collecting metrics and action-test job for structured testing and linting; updated dependencies in build-site and conclude jobs accordingly.
.prettierignore, eslint.config.js Updated to exclude "log" directory from formatting and linting processes.
log/.gitignore, log/Dockerfile, log/package.json, log/jest.config.js Created a .gitignore to manage version control exclusions; defined a multi-stage Docker build for the Node.js application; configured Jest for testing; and set up project metadata in package.json.
log/src/github/artifact.ts, log/src/github/types.ts Introduced ArtifactManager class for artifact management and added types/interfaces for logging actions and GitHub client interactions.
log/src/index.ts, log/src/status.ts Implemented the main GitHub Action for health checks and added StatusChecker class for monitoring web service health endpoints.
log/src/test/index.test.ts Created unit tests for StatusChecker and ArtifactManager, ensuring functionality and integration.
src/lib/logs.json, src/lib/metrics/index.ts, src/lib/types.ts Modified status reporting format from integer to boolean for clarity; updated internal handling of boolean results; introduced ReportFile interface for structured reporting.
log/src/util.ts, log/tsconfig.json Added utility function for standardized logging operations and configured TypeScript compiler options for improved type safety and organization.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub Actions
    participant ArtifactManager
    participant StatusChecker

    User->>GitHub Actions: Trigger workflow
    GitHub Actions->>ArtifactManager: Retrieve previous artifacts
    ArtifactManager-->>GitHub Actions: Return artifacts
    GitHub Actions->>StatusChecker: Check health endpoints
    StatusChecker-->>GitHub Actions: Return health status
    GitHub Actions->>ArtifactManager: Generate new artifact from results
    ArtifactManager-->>GitHub Actions: New artifact ready
    GitHub Actions-->>User: Workflow completed
Loading

🐰 In fields of code so bright and clear,
New metrics and tests bring us cheer!
With Health Check hops and Logs that flow,
Our CI/CD garden begins to grow.
Let's celebrate with a joyful leap,
For changes made, our code runs deep! 🥕✨


Note

Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@Bullrich Bullrich marked this pull request as ready for review August 6, 2024 09:27
@Bullrich
Copy link
Owner Author

Bullrich commented Aug 6, 2024

@coderabbitai full review

Copy link

coderabbitai bot commented Aug 6, 2024

Actions performed

Full review triggered.

Before it was running in the main directory instead of the action's
@Bullrich Bullrich merged commit 718ac19 into main Aug 6, 2024
8 checks passed
@Bullrich Bullrich deleted the status-fetcher branch August 6, 2024 09:35
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