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

ci: remove web assets from API Docker image #1293

Closed
wants to merge 2 commits into from

Conversation

KeisukeYamashita
Copy link
Contributor

@KeisukeYamashita KeisukeYamashita commented Oct 31, 2024

Overview

Because the web has it's own Docker image, there is no need to include it with it in the API's Docker image.
I also remove the CI for the web (GCS).

What I've done

What I haven't done

How I tested

Screenshot

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • New Features

    • Streamlined workflows for building and deploying applications.
  • Bug Fixes

    • Removed unnecessary artifact handling in Docker and CI workflows.
  • Chores

    • Eliminated steps related to web deployment and artifact management, enhancing workflow efficiency.

@KeisukeYamashita KeisukeYamashita self-assigned this Oct 31, 2024
Copy link
Contributor

coderabbitai bot commented Oct 31, 2024

Walkthrough

The pull request includes modifications to multiple GitHub Actions workflow files and a Dockerfile. Key changes involve the removal of artifact handling steps from the docker and ci_web workflows, streamlining the processes for building and deploying applications. The deploy_test workflow has also been updated to eliminate the web deployment job. Additionally, the Dockerfile has been adjusted to exclude web files from the final image build. Overall, these changes aim to simplify the workflows while retaining essential functionalities.

Changes

File Change Summary
.github/workflows/build_server.yml Clarified logic for new_tag and name outputs; modified info job conditions; removed artifact fetching in docker job.
.github/workflows/ci_web.yml Removed steps for packaging and uploading artifacts; other steps remain unchanged.
.github/workflows/deploy_test.yml Removed deploy_web_gcs job and associated steps; retained other deployment jobs.
server/Dockerfile Removed line copying web files into the Docker image.

Possibly related PRs

Suggested reviewers

  • rot1024

🐇 In the land of code, where workflows flow,
Artifacts vanished, like whispers in snow.
Docker's now lighter, no web files in sight,
Simplifying paths, making futures bright.
With each little change, a hop and a cheer,
For a cleaner build, let’s all give a cheer! 🎉


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

@github-actions github-actions bot added the ci label Oct 31, 2024
Copy link

netlify bot commented Oct 31, 2024

Deploy Preview for reearth-cms ready!

Name Link
🔨 Latest commit c759d94
🔍 Latest deploy log https://app.netlify.com/sites/reearth-cms/deploys/67246d271128c2000898862c
😎 Deploy Preview https://deploy-preview-1293--reearth-cms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: KeisukeYamashita <[email protected]>
@KeisukeYamashita KeisukeYamashita force-pushed the remove-frontend-assets-from-api branch from 0190e2a to 9d234f2 Compare October 31, 2024 21:03
@KeisukeYamashita KeisukeYamashita marked this pull request as ready for review October 31, 2024 22:07
with:
name: reearth-cms-web
path: web/reearth-cms-web.tar.gz
if-no-files-found: error
Copy link
Member

Choose a reason for hiding this comment

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

These steps can remain beccause it is helpful to investigate issue on build results.

Signed-off-by: KeisukeYamashita <[email protected]>
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9d234f2 and c759d94.

📒 Files selected for processing (1)
  • .github/workflows/ci_web.yml (1 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/ci_web.yml

[error] 41-41: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
.github/workflows/ci_web.yml (1)

Line range hint 1-41: Verify dependent workflow changes.

The removal of artifact packaging and uploading steps aligns with the PR objective of separating web assets. However, let's verify that all dependent workflows have been updated accordingly.

✅ Verification successful

Update required in dependent workflows for web asset changes

The verification has revealed that several workflows still reference the web assets and need to be updated:

  • deploy_test.yml: References web deployment but uses Docker images, not the removed artifact
  • build_web.yml: Handles Docker image building and pushing, aligned with the new approach
  • cron_ion_token_test.yml: Only references the web service name, no artifact dependencies

The removal of artifact packaging is consistent with the shift to container-based deployments, and no workflows are attempting to download the removed artifact. The changes are safe.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the removed web artifact

# Test 1: Search for workflow files that might download the web artifact
echo "Checking for workflows that attempt to download web artifacts..."
rg -l --type yaml 'reearth-cms-web' .github/workflows/

# Test 2: Search for any remaining references to the web artifact name
echo "Checking for any remaining references to the web artifact..."
rg -l 'reearth-cms-web.tar.gz' .

Length of output: 494


Script:

#!/bin/bash
# Let's examine the content of the identified workflow files to understand their dependencies

echo "=== Content of deploy_test.yml ==="
cat .github/workflows/deploy_test.yml

echo -e "\n=== Content of build_web.yml ==="
cat .github/workflows/build_web.yml

echo -e "\n=== Content of cron_ion_token_test.yml ==="
cat .github/workflows/cron_ion_token_test.yml

Length of output: 10715

🧰 Tools
🪛 yamllint

[error] 41-41: no new line character at the end of file

(new-line-at-end-of-file)

- uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release'
with:
name: reearth-cms-web
path: web/reearth-cms-web.tar.gz
if-no-files-found: error
if-no-files-found: error
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add newline at end of file.

Add a newline character at the end of the file to comply with POSIX standards.

   if-no-files-found: error
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if-no-files-found: error
if-no-files-found: error
🧰 Tools
🪛 yamllint

[error] 41-41: no new line character at the end of file

(new-line-at-end-of-file)

@KeisukeYamashita KeisukeYamashita deleted the remove-frontend-assets-from-api branch November 1, 2024 11:50
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.

3 participants