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

Edited deploy to staging and readme for website2 #2243

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

Psalmz777
Copy link
Contributor

@Psalmz777 Psalmz777 commented Nov 19, 2024

Summary of Changes (What does this PR do?)

  • Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Status of maturity (all need to be checked before merging):

  • I've tested this locally
  • I consider this code done
  • This change ready to hit production in its current state
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included issue number in the "Closes #ISSUE-NUMBER" part of the "What are the relevant tickets?" section to link the issue.
  • I've updated corresponding documentation for the changes in this PR.
  • I have written unit and/or e2e tests for my change(s).

How should this be manually tested?

  • Please include the steps to be done inorder to setup and test this PR.

What are the relevant tickets?

Screenshots (optional)

Summary by CodeRabbit

  • New Features

    • Added deployment support for a new frontend application, website2.
    • Introduced conditional deployment logic based on file changes for website2.
  • Bug Fixes

    • Corrected Docker image tagging for website2 to ensure proper versioning.
  • Documentation

    • Minor update to the "Getting Started" section in website2/README.md for improved clarity.

Copy link

coderabbitai bot commented Nov 19, 2024

📝 Walkthrough

Walkthrough

The changes in this pull request primarily enhance the deployment workflow for frontend applications by introducing a new job for website2 in the .github/workflows/deploy-frontends-to-staging.yml file. This job includes specific configurations for deploying website2, correcting the Docker image tagging to ensure proper versioning. Additionally, the check job has been updated to include outputs for run_website2, allowing conditional execution based on file changes. Overall, these modifications maintain the existing workflow structure while expanding deployment capabilities.

Changes

File Path Change Summary
.github/workflows/deploy-frontends-to-staging.yml Added new job website2 for deployment, corrected Docker image tagging, and updated check job to include run_website2 output.
website2/README.md Minor modification by removing an extraneous period from the "Getting Started" section header.

Possibly related PRs

  • Website2 deployment1 #2241: This PR is directly related as it also introduces a new job for deploying website2 in the .github/workflows/deploy-frontends-to-staging.yml file, mirroring the changes made in the main PR.

Suggested labels

ready for review

Suggested reviewers

  • Baalmart

Poem

In the workflow's dance, a new step we see,
website2 joins, as bright as can be.
With tags aligned, and checks in their place,
Deployments now flow with a seamless grace.
A period gone, clarity shines,
Frontend adventures, where code intertwines! 🌟


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

New Website2 changes available for preview here

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

🧹 Outside diff range and nitpick comments (3)
.github/workflows/deploy-frontends-to-staging.yml (3)

343-343: Fix indentation in Docker commands

The Docker tag and push commands are not properly aligned with the build command.

Apply this diff to fix the indentation:

-          docker tag ${{ env.REGISTRY_URL }}/${{ secrets.FRONTEND_PROJECT_ID }}/airqo-stage-website2:${{ needs.image-tag.outputs.build_id }} ${{ env.REGISTRY_URL }}/${{ secrets.FRONTEND_PROJECT_ID }}/airqo-stage-website2:latest
-          docker push ${{ env.REGISTRY_URL }}/${{ secrets.FRONTEND_PROJECT_ID }}/airqo-stage-website2:latest
+    docker tag ${{ env.REGISTRY_URL }}/${{ secrets.FRONTEND_PROJECT_ID }}/airqo-stage-website2:${{ needs.image-tag.outputs.build_id }} ${{ env.REGISTRY_URL }}/${{ secrets.FRONTEND_PROJECT_ID }}/airqo-stage-website2:latest
+    docker push ${{ env.REGISTRY_URL }}/${{ secrets.FRONTEND_PROJECT_ID }}/airqo-stage-website2:latest

Line range hint 319-334: Consider consolidating environment variables

The environment setup for website2 shares several variables with the website job. Consider creating a reusable composite action or workflow template to reduce duplication.

Create a new composite action in .github/actions/setup-website-env that can be shared between both website deployments.


Line range hint 360-367: Improve version cleanup logic

The version cleanup script could be enhanced to handle errors and provide better feedback.

Consider this improved version:

-      - name: Delete Old Versions
-        run: |-
-          service="staging"
-            versions=$(gcloud app versions list --service=$service --sort-by '~LAST_DEPLOYED' --format 'value(VERSION.ID)' | grep -v 'maintenance' | sort -r | tail -n +4)
-            for version in $versions; do
-              echo "Deleting version: $version for service: $service"
-              gcloud app versions delete "$version" --service=$service --quiet
-            done            
+      - name: Delete Old Versions
+        run: |-
+          service="staging"
+          echo "Fetching versions for service: $service"
+          versions=$(gcloud app versions list --service=$service --sort-by '~LAST_DEPLOYED' --format 'value(VERSION.ID)' | grep -v 'maintenance' | sort -r | tail -n +4) || exit 1
+          if [ -z "$versions" ]; then
+            echo "No old versions to clean up"
+            exit 0
+          fi
+          for version in $versions; do
+            echo "Deleting version: $version for service: $service"
+            if ! gcloud app versions delete "$version" --service=$service --quiet; then
+              echo "Failed to delete version: $version"
+              exit 1
+            fi
+          done
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 3568284 and b8d167d.

📒 Files selected for processing (2)
  • .github/workflows/deploy-frontends-to-staging.yml (1 hunks)
  • website2/README.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • website2/README.md
🔇 Additional comments (2)
.github/workflows/deploy-frontends-to-staging.yml (2)

Line range hint 29-29: LGTM: Check job modifications for website2

The changes to the check job correctly implement the website2 detection logic, maintaining consistency with other frontend applications.

Also applies to: 52-61


Line range hint 341-359: Verify service name conflicts in App Engine

Both website and website2 are using the same service name "staging" in App Engine. This could lead to deployment conflicts.

Consider using a unique service name for website2, for example:

-service: staging
+service: staging-website2

@Baalmart Baalmart merged commit 6cf68ca into staging Nov 19, 2024
31 checks passed
@Baalmart Baalmart deleted the Website2-deployment2 branch November 19, 2024 10:42
@Baalmart Baalmart mentioned this pull request Nov 19, 2024
1 task
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