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 Deployment Website #2503

Merged
merged 1 commit into from
Feb 24, 2025
Merged

Fix Deployment Website #2503

merged 1 commit into from
Feb 24, 2025

Conversation

BenjaminSsempala
Copy link
Contributor

@BenjaminSsempala BenjaminSsempala commented Feb 23, 2025

Summary of Changes (What does this PR do?)

  • Fix deployment frontend

Summary by CodeRabbit

  • Chores
    • Enhanced the deployment process to improve the reliability of version clean-up operations. The update includes a more robust error handling and retry mechanism, resulting in smoother updates and improved overall application stability.

Copy link

coderabbitai bot commented Feb 23, 2025

📝 Walkthrough

Walkthrough

The workflow file has been updated to improve the deletion process for old application versions. The changes add a retry mechanism with checks for ongoing operations using gcloud app operations list, incorporating delays of 30 seconds before retries if operations are active and 10 seconds between deletion attempts. The process now logs clear messages for successful deletions, failures, or skipped deletions after three unsuccessful attempts. No changes were made to public API declarations.

Changes

File Path Change Summary
.github/.../deploy-frontends-to-production.yml Enhanced deletion process for old versions with retry logic, incorporating 30-second delays when operations are active, 10-second delays between retries, and improved logging for each outcome.

Sequence Diagram(s)

sequenceDiagram
    participant WF as Workflow
    participant GC as GCloud
    participant LM as Logger
    Note over WF: Start deletion for a version
    WF->>GC: List ongoing operations
    GC-->>WF: Return operations list
    alt Operations in progress
      WF->>WF: Wait 30 seconds
    else No operations
      WF->>GC: Attempt deletion (try 1/3)
      GC-->>WF: Deletion result
      alt Deletion failed
         WF->>WF: Wait 10 seconds and retry
         WF->>GC: Attempt deletion (try 2/3)
         GC-->>WF: Deletion result
         alt Deletion failed again
            WF->>WF: Wait 10 seconds and retry
            WF->>GC: Attempt deletion (try 3/3)
            GC-->>WF: Final deletion result
         end
      else Deletion succeeded
         WF->>LM: Log success message
      end
    end
Loading

Possibly related PRs

Suggested reviewers

  • OchiengPaul442
  • Psalmz777
  • Baalmart

Poem

In lines of code where logic flows,
A retry dance is now composed.
Old versions fade with each attempt,
Delays and checks perfectly exempt.
Logging tales of success and strife,
A rhythmic ode to our deploy-life.
🚀 Cheers to code that sings in life!

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

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 or @coderabbitai title 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

@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: 0

🧹 Nitpick comments (1)
.github/workflows/deploy-frontends-to-production.yml (1)

327-357: Enhanced Retry Mechanism for Deleting Old Versions in Website2 Job

The new logic here introduces a robust retry loop that checks for any ongoing operations before attempting to delete old versions. The mechanism retries deletion up to three times—with a 30-second wait when another operation is detected (line 337–340) and a 10-second delay between deletion attempts (line 346–348). This significantly improves the resilience of the deployment process.

I recommend, as a refinement, considering capturing the output of the gcloud app operations list command into a variable before the loop to avoid executing it repeatedly in each iteration. This could improve performance and readability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e301887 and c544b22.

📒 Files selected for processing (1)
  • .github/workflows/deploy-frontends-to-production.yml (1 hunks)

Copy link
Collaborator

@Baalmart Baalmart left a comment

Choose a reason for hiding this comment

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

Thanks @BenjaminSsempala , let me merge. cc: @OchiengPaul442

@Baalmart Baalmart merged commit ff3a7c4 into staging Feb 24, 2025
31 checks passed
@Baalmart Baalmart deleted the fix-deploy-web branch February 24, 2025 07:01
@Baalmart Baalmart mentioned this pull request Feb 24, 2025
1 task
@coderabbitai coderabbitai bot mentioned this pull request Feb 24, 2025
7 tasks
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.

2 participants