Skip to content

Added Github Action to verify that the devcontainer starts (Fixes #3414) #3454

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

Conversation

adithyanotfound
Copy link

@adithyanotfound adithyanotfound commented Apr 15, 2025

What kind of change does this PR introduce?

Feature

Issue Number:

Fixes #3414

Summary

Added workflow to verify that the devcontainer starts

Does this PR introduce a breaking change?

Yes

Checklist

CodeRabbit AI Review

  • I have reviewed and addressed all critical issues flagged by CodeRabbit AI
  • I have implemented or provided justification for each non-critical suggestion
  • I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

Test Coverage

  • I have written tests for all new changes/features
  • I have verified that test coverage meets or exceeds 95%
  • I have run the test suite locally and all tests pass

Have you read the contributing guide?

Yes

Summary by CodeRabbit

  • New Features

    • Introduced an automated check to verify the application starts up and its GraphQL endpoint is accessible in a development container environment during pull requests.
  • Chores

    • Enhanced the workflow to automatically clean up resources after checks are completed.

Copy link

coderabbitai bot commented Apr 15, 2025

## Walkthrough

A new job named `Check-App-Startup` has been added to the GitHub Actions workflow configuration. This job is set to run after the completion of the `Run-Tests` job. It automates the process of starting the application's devcontainer, verifies that the container is running, installs necessary dependencies, and checks the availability of the GraphQL endpoint. The job includes logic for waiting and retrying the endpoint check, as well as cleanup steps to stop the Docker Compose environment after execution.

## Changes

| File(s)                    | Change Summary                                                                                                   |
|----------------------------|------------------------------------------------------------------------------------------------------------------|
| .github/workflows/pull-request.yml | Added a new job (`Check-App-Startup`) to the workflow to verify devcontainer startup and GraphQL endpoint health |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant GitHub Actions
    participant Devcontainer
    participant Docker
    participant GraphQL Endpoint

    GitHub Actions->>GitHub Actions: Run Run-Tests job
    GitHub Actions->>GitHub Actions: Start Check-App-Startup job
    GitHub Actions->>GitHub Actions: Checkout repository
    GitHub Actions->>GitHub Actions: Install Devcontainer CLI
    GitHub Actions->>Devcontainer: Copy environment file and bring up devcontainer
    GitHub Actions->>Docker: Verify container is running
    GitHub Actions->>Devcontainer: Install dependencies
    GitHub Actions->>Devcontainer: Start development server (async)
    loop Up to 60 attempts
        GitHub Actions->>GraphQL Endpoint: Send test query
        alt Endpoint available
            GitHub Actions->>GitHub Actions: Exit with success
        else
            GitHub Actions->>GitHub Actions: Wait 2 seconds
        end
    end
    GitHub Actions->>Docker: Stop Docker Compose environment (cleanup)

Assessment against linked issues

Objective Addressed Explanation
Validate that the devcontainer starts as part of the GitHub Action (#3414)
Ensure this validation runs after the production container startup check (#3414)

Suggested labels

ignore-sensitive-files-pr

Suggested reviewers

  • palisadoes

<!-- walkthrough_end -->

<!-- announcements_start -->

> [!TIP]
> <details>
> <summary>⚡💬 Agentic Chat (Pro Plan, General Availability)</summary>
> 
> - We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
> 
> </details>

<!-- announcements_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNxU3bABsvkCiQBHbGlcABpIcVwvOkgAIgBBWiV6AHF1WGwBSHixeHwsAkgpCngAM3lcWGoI2BJIJQkmDFxtcj5EFopcZAAKADF4AA9pSDMAZgAWAEYJgEpQ2MgAdzRkBwFmdRp6ORq67ERKdFp02Ux8XFL8bAx6Ves7DEcBI8mAVgmUAtrrNC8kNC0fDSPrXW7UPIYAD0LS8aBWYDQ3B0/m4+EQ6nwLg0MB+zFakFKJGo2H8X1wFEU2AYMV2lVQthQyDQkHIS0gaVwAAlMtlcvlkEssQBrUpefDspQYojkeiFYplCpVXB7eokKTi7hsZoKZqtI49BpNFrwNqz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QeP/ygBMAQDA3hvBILil4Ewxj1LUqSkgEw0BqRIKS2gAhSilAmLiiYbxSUCDeGpKYOqdVTDQAADgEDq6TlGdWkpMwwXFuKGBTCM7QMYDTLOlHqSQeptBcWAlxQZxtakdXKamCQN4gWhoUb42HdQgnWkiYrouWgBap48aAA -->

<!-- internal state end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=PalisadoesFoundation/talawa-api&utm_content=3454):

- 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 generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this 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.

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0fac5c2 and 4bc55e6.

📒 Files selected for processing (1)
  • .github/workflows/pull-request.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Run tests for talawa api
  • GitHub Check: Analyse Code With CodeQL (typescript)

Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.60%. Comparing base (b92360e) to head (72f4c66).
Report is 1 commits behind head on develop-postgres.

Additional details and impacted files
@@                Coverage Diff                @@
##           develop-postgres    #3454   +/-   ##
=================================================
  Coverage             59.60%   59.60%           
=================================================
  Files                   523      523           
  Lines                 40782    40782           
  Branches               1786     1786           
=================================================
  Hits                  24307    24307           
  Misses                16464    16464           
  Partials                 11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adithyanotfound
Copy link
Author

@palisadoes PR is ready for review.

@palisadoes palisadoes added the ignore-sensitive-files-pr The contributor has a legitimate reason for editiing protected files label Apr 20, 2025
@palisadoes
Copy link
Contributor

@coderabbitai full review

Copy link

coderabbitai bot commented Apr 20, 2025

✅ Actions performed

Full review triggered.

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

♻️ Duplicate comments (1)
.github/workflows/pull-request.yml (1)

372-373: Parameterize or derive the container name.

Hard‑coding talawa-api-1 makes the workflow brittle if the Compose project or service name changes. As suggested previously, parameterize this name or derive it dynamically, for example:

CONTAINER=$(docker ps --format '{{.Names}}' --filter 'ancestor=talawa_api' | head -n1)
docker exec $CONTAINER pnpm install

Also applies to: 383-384

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b92360e and 72f4c66.

📒 Files selected for processing (1)
  • .github/workflows/pull-request.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Run tests for talawa api
🔇 Additional comments (1)
.github/workflows/pull-request.yml (1)

378-398: Health‐check loop is robust.

The retry logic with container existence checks, conditional curl installation, and polling up to 60 times provides a solid mechanism to wait for the GraphQL endpoint. Good job including descriptive logs and exit codes.

@palisadoes palisadoes merged commit 33d5b7b into PalisadoesFoundation:develop-postgres Apr 21, 2025
19 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-sensitive-files-pr The contributor has a legitimate reason for editiing protected files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants