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

Add ZO release #2605

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Add ZO release #2605

merged 2 commits into from
Jan 24, 2025

Conversation

nguyentvan7
Copy link
Collaborator

@nguyentvan7 nguyentvan7 commented Jan 24, 2025

Describe your changes

  • Adjust release yaml to be more dynamic, taking in repo name and key name as inputs
  • Add ZO release yaml, which just builds and deploys to specified repo

Issue or discord link

Testing/validation

Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)

  • I have commented my code in hard-to understand areas.
  • I have made corresponding changes to README or wiki.
  • For front-end changes, I have updated the corresponding English translations.
  • I have run yarn run mini-ci locally to validate format and lint.
  • If I have added a new library or app, I have updated the deployment scripts to ignore changes as needed

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflows across multiple files to enhance configuration and deployment processes
    • Added new workflow parameters for repository name and deployment secret handling
    • Introduced a new manual release workflow for ZO frontend deployment

Copy link
Contributor

coderabbitai bot commented Jan 24, 2025

Walkthrough

The changes primarily involve updating multiple GitHub Actions workflows across various repositories to introduce two new parameters: repo_name and repo_deploy_secret_name. These parameters enhance the configuration of build and deployment workflows, allowing more dynamic handling of repository names and deployment secrets. A new workflow for ZO release has also been added, which can be manually triggered and uses the updated build frontend workflow.

Changes

File Change Summary
.github/workflows/beta-*-release.yml (GO, SRO, ZO) Added repo_name and repo_deploy_secret_name parameters to call-build-frontend job
.github/workflows/build-frontend.yml Added required inputs for repo_name, repo_deploy_secret_name; updated frontend_name to be required
.github/workflows/build-*-pr.yml (GO, SRO, ZO) Added repo_name and repo_deploy_secret_name parameters to call-build job
.github/workflows/deploy-frontend.yml Added new workflow trigger, output variables for repository and secret handling
.github/workflows/new-zo-release.yml New workflow with manual trigger for ZO release, calling build frontend workflow

Poem

🐰 Workflows hopping, parameters new,
Secrets and repos in GitHub's view
Deployment dancing with dynamic flair
Builds and releases beyond compare
A rabbit's code, precise and bright! 🚀


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.

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

github-actions bot commented Jan 24, 2025

[zzz-frontend] [Fri Jan 24 00:13:51 UTC 2025] - Deployed ef49ab3 to https://genshin-optimizer-prs.github.io/pr/2605/zzz-frontend (Takes 3-5 minutes after this completes to be available)

[sr-frontend] [Fri Jan 24 00:14:57 UTC 2025] - Deployed ef49ab3 to https://genshin-optimizer-prs.github.io/pr/2605/sr-frontend (Takes 3-5 minutes after this completes to be available)

[Fri Jan 24 01:48:29 UTC 2025] - Deleted deployment

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

🧹 Nitpick comments (2)
.github/workflows/new-zo-release.yml (1)

1-5: Consider adding concurrency configuration
If multiple releases can be triggered in parallel, adding a concurrency group under the on or jobs section will help avoid collisions.

.github/workflows/build-frontend.yml (1)

15-22: Validate or provide fallback defaults for new inputs.
Providing these inputs as required is helpful; however, consider adding validation steps or fallback defaults to handle potential misconfigurations in external calls.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4d74491 and 16bf2b9.

📒 Files selected for processing (9)
  • .github/workflows/beta-go-release.yml (1 hunks)
  • .github/workflows/beta-sro-release.yml (1 hunks)
  • .github/workflows/beta-zo-release.yml (1 hunks)
  • .github/workflows/build-frontend.yml (3 hunks)
  • .github/workflows/build-go-next-pr.yml (1 hunks)
  • .github/workflows/build-sro-pr.yml (1 hunks)
  • .github/workflows/build-zo-pr.yml (1 hunks)
  • .github/workflows/deploy-frontend.yml (2 hunks)
  • .github/workflows/new-zo-release.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: lint
  • GitHub Check: call-build / build
  • GitHub Check: call-build / build
🔇 Additional comments (13)
.github/workflows/new-zo-release.yml (1)

6-14: Verify repository variable and secret usage
Ensure ${{ vars.ZO_REPO }} is defined as a repository variable and 'ZO_REPO_SSH_KEY' is set as a repository secret. Otherwise, deployments will fail at checkout.

.github/workflows/beta-go-release.yml (1)

19-20: Confirm that PR_REPO variable and PR_REPO_SSH_KEY secret are correctly configured
These new parameters require ${{ vars.PR_REPO }} and the 'PR_REPO_SSH_KEY' secret. Missing or misconfigured values can cause the build to fail when checking out the target repo.

.github/workflows/beta-zo-release.yml (1)

19-20: Validate environment references for repo_name and repo_deploy_secret_name
Ensure ${{ vars.PR_REPO }} is a valid repository variable and 'PR_REPO_SSH_KEY' is properly set as a secret. This alignment is essential for the workflow to run without checkout or deployment errors.

.github/workflows/beta-sro-release.yml (1)

19-20: Double-check PR_REPO and PR_REPO_SSH_KEY definitions
The new parameters repo_name and repo_deploy_secret_name depend on ${{ vars.PR_REPO }} and 'PR_REPO_SSH_KEY'. Confirm they are present and correctly configured in the repository.

.github/workflows/build-zo-pr.yml (1)

28-29: Confirm usage of new variables in the build job
Providing repo_name and repo_deploy_secret_name requires ${{ vars.PR_REPO }} and 'PR_REPO_SSH_KEY' to be valid. Missing them can break the build or deployment steps.

.github/workflows/build-sro-pr.yml (1)

28-29: Ensure the environment variable and secret are defined.
You’re referencing vars.PR_REPO and using a literal 'PR_REPO_SSH_KEY'. If PR_REPO is missing or the secret doesn't exist, this step will fail.

As a follow-up, consider verifying references to PR_REPO and PR_REPO_SSH_KEY across the repo:

.github/workflows/build-go-next-pr.yml (1)

29-30: Validate usage of repo variables and secrets.
Similarly to the SRO workflow, ensure vars.PR_REPO and 'PR_REPO_SSH_KEY' exist and point to valid resources for this specific environment.

✅ Verification successful

Variables are properly configured and follow established patterns
The usage of vars.PR_REPO and PR_REPO_SSH_KEY follows the repository's established deployment configuration pattern, matching the implementation in other working workflows including beta releases and PR deployments.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Searching references to PR_REPO and PR_REPO_SSH_KEY in the codebase.
rg 'PR_REPO|PR_REPO_SSH_KEY'

Length of output: 30


Script:

#!/bin/bash
# Search specifically in workflow files with case-insensitive pattern
fd -e yml -e yaml . .github/workflows/ --exec rg -i 'repo|ssh_key|deploy'

# List all workflow files to ensure we don't miss any
fd -e yml -e yaml . .github/workflows/

Length of output: 6899

.github/workflows/build-frontend.yml (3)

10-10: Good practice to make frontend_name required.
Marking frontend_name as required helps avoid misconfigurations when running the workflow.


76-77: Check for accidental leakage.
Storing repo_name and repo_deploy_secret_name in plain text is typically safe since they’re not actual credentials, but carefully confirm that no sensitive information is inadvertently included.


87-88: Be mindful of artifact contents.
Archiving repo_name and repo_deploy_secret_name might be necessary for downstream steps, but double-check that nothing sensitive is included in case you share or retain these artifacts long-term.

.github/workflows/deploy-frontend.yml (3)

13-13: Trigger inclusion for "New ZO Release" looks correct.
Having this new workflow trigger ensures the newly introduced ZO release flow integrates with existing deployment steps.


33-34: Outputs look good; watch for misconfigurations.
Exposing repo_name and repo_deploy_secret_name as outputs is reasonable. Just confirm these values are valid in the artifact.


39-40: Verify external repository and secret references.
Pulling repo_name from the artifact and using ssh-key: ${{ secrets[steps.vars.outputs.repo_deploy_secret_name] }} can fail if the secret does not exist. Ensure that appropriate secrets are set in the repository’s settings.

✅ Verification successful

Repository and secret references are properly configured

The workflow uses repository variables (vars.PR_REPO) and secrets (PR_REPO_SSH_KEY) correctly. If the secret is missing, the workflow will fail fast with a clear error message, preventing any incomplete deployments. This is a secure setup following GitHub Actions best practices for GitHub Pages deployments.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Listing available repository secrets to confirm that outputs.repo_deploy_secret_name is defined.
gh secret list

Length of output: 172


Script:

#!/bin/bash
# Check the full workflow file to understand variable setup
cat .github/workflows/deploy-frontend.yml

# Look for any related configuration files
fd -t f -e yml -e yaml . .github/

Length of output: 4505


Script:

#!/bin/bash
# Check one of the build workflows that creates the artifacts
cat .github/workflows/build-go-wr-pr.yml

# Also check the main build workflow
cat .github/workflows/build-frontend.yml

Length of output: 4169


Script:

#!/bin/bash
# Check release workflows that might show how these parameters are configured
cat .github/workflows/beta-go-release.yml
cat .github/workflows/new-release.yml

Length of output: 2244

@nguyentvan7 nguyentvan7 merged commit d03973c into master Jan 24, 2025
10 checks passed
@nguyentvan7 nguyentvan7 deleted the van/zo/addRelease branch January 24, 2025 01:47
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