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

fix: Remove expired envs #291

Merged
merged 2 commits into from
Jan 23, 2025
Merged

fix: Remove expired envs #291

merged 2 commits into from
Jan 23, 2025

Conversation

adityachoudhari26
Copy link
Contributor

@adityachoudhari26 adityachoudhari26 commented Jan 23, 2025

Summary by CodeRabbit

  • Removal of Features

    • Removed expired environment checker job
    • Eliminated environment expiration tracking functionality
    • Removed ephemeral environment toggle in deployment page
  • Database Changes

    • Deleted expiresAt field from environment schema
  • Code Cleanup

    • Simplified deployment page rendering logic
    • Removed related test cases for expired environment functionality

Copy link
Contributor

coderabbitai bot commented Jan 23, 2025

Warning

Rate limit exceeded

@adityachoudhari26 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 23 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

Reviewing files that changed from the base of the PR and between 74752af and bac737f.

📒 Files selected for processing (4)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-drawer/Overview.tsx (1 hunks)
  • apps/webservice/src/app/api/v1/environments/route.ts (1 hunks)
  • packages/db/drizzle/0063_mute_william_stryker.sql (1 hunks)
  • packages/db/drizzle/meta/_journal.json (1 hunks)

Walkthrough

This pull request focuses on removing functionality related to expired environments across multiple components of the system. The changes include deleting the expired-env-checker job, removing the expiresAt field from the environment database schema, and simplifying the deployment page content component. These modifications eliminate the ability to track and automatically manage environment expiration, effectively removing the concept of time-limited environments from the application.

Changes

File Change Summary
apps/jobs/src/expired-env-checker/index.ts Entire file deleted - removed function for checking and handling expired environments
apps/jobs/src/index.ts Removed expired-env-checker job from job configuration
apps/webservice/src/.../DeploymentPageContent.tsx Removed showEphemeralEnvs state and related conditional rendering logic
packages/db/src/schema/environment.ts Deleted expiresAt field from environment table schema
packages/job-dispatch/src/__test__/job-variables-deployment.test.ts Removed expiresAt property from test environment objects

Possibly related PRs

Suggested reviewers

  • jsbroks

Poem

🐰 Environments free from time's tight reign,
No more expiring, breaking the chain!
Deleted code, a rabbit's delight,
Simplicity dancing in pure white
Freedom rings in our system's domain! 🕒✨


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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 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: 2

🔭 Outside diff range comments (1)
apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/[deploymentSlug]/releases/DeploymentPageContent.tsx (1)

Line range hint 202-214: Remove commented out UI elements.

Remove the commented out Switch component and its label as they're no longer needed with the removal of expired environments feature.

-          {/* <div className="flex items-center gap-2">
-            <Switch
-              checked={showEphemeralEnvs}
-              id="show-ephemeral-envs"
-              onCheckedChange={setShowEphemeralEnvs}
-            />
-            <Label
-              htmlFor="show-ephemeral-envs"
-              className="text-sm text-muted-foreground"
-            >
-              Show ephemeral environments
-            </Label>
-          </div> */}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2957560 and 74752af.

📒 Files selected for processing (5)
  • apps/jobs/src/expired-env-checker/index.ts (0 hunks)
  • apps/jobs/src/index.ts (0 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/[deploymentSlug]/releases/DeploymentPageContent.tsx (5 hunks)
  • packages/db/src/schema/environment.ts (0 hunks)
  • packages/job-dispatch/src/__test__/job-variables-deployment.test.ts (0 hunks)
💤 Files with no reviewable changes (4)
  • packages/db/src/schema/environment.ts
  • apps/jobs/src/expired-env-checker/index.ts
  • apps/jobs/src/index.ts
  • packages/job-dispatch/src/test/job-variables-deployment.test.ts
🧰 Additional context used
📓 Path-based instructions (1)
apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/[deploymentSlug]/releases/DeploymentPageContent.tsx (1)

Pattern **/*.{ts,tsx}: Note on Error Handling:
Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error handling. These are acceptable as long as they maintain clarity and predictability.

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Typecheck
  • GitHub Check: Lint
  • GitHub Check: build (linux/amd64)
  • GitHub Check: build (linux/amd64)
🔇 Additional comments (2)
apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/[deploymentSlug]/releases/DeploymentPageContent.tsx (2)

161-161: LGTM! Environment blocks calculation is correctly simplified.

The calculation now properly uses the full environments array without filtering.


Line range hint 271-276: LGTM! Environment mapping is correctly simplified.

The code now properly iterates over all environments without filtering, which is consistent with the removal of expired environments feature.

Also applies to: 336-351

Comment on lines +157 to +159
// const selectedEnvironments = showEphemeralEnvs
// ? environments
// : environments.filter((e) => e.expiresAt == null);
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove commented out environment filtering logic.

Remove the commented out filtering logic as it's no longer needed with the removal of expired environments feature.

-  // const selectedEnvironments = showEphemeralEnvs
-  //   ? environments
-  //   : environments.filter((e) => e.expiresAt == null);

@@ -155,13 +152,13 @@
const loading = releases.isLoading;
const router = useRouter();

const [showEphemeralEnvs, setShowEphemeralEnvs] = useState(false);
// const [showEphemeralEnvs, setShowEphemeralEnvs] = useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove commented out code.

Instead of keeping commented out code, remove it entirely since we're removing the expired environments feature.

-  // const [showEphemeralEnvs, setShowEphemeralEnvs] = useState(false);

@adityachoudhari26 adityachoudhari26 merged commit bece65a into main Jan 23, 2025
11 checks passed
@adityachoudhari26 adityachoudhari26 deleted the remove-expired-envs branch January 23, 2025 19:55
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