Skip to content

feat(UI): update .env file and action for new staging environment#1295

Merged
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main
Jul 31, 2025
Merged

feat(UI): update .env file and action for new staging environment#1295
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main

Conversation

@benjamin-747

Copy link
Copy Markdown
Collaborator

No description provided.

@vercel

vercel Bot commented Jul 31, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2025 11:56am

@genedna
genedna requested a review from Copilot July 31, 2025 11:58
@genedna
genedna added this pull request to the merge queue Jul 31, 2025
Merged via the queue into gitmono-dev:main with commit 0216733 Jul 31, 2025
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the configuration to support a new staging environment by simplifying environment-based URL handling and adding new environment configurations. The changes remove production/development conditionals in favor of environment variable-based configuration and add support for both standard staging and a new staging-nju environment.

Key changes:

  • Simplifies URL configuration by removing production/development conditionals and relying on environment variables
  • Adds new staging environment files for both standard and NJU-specific configurations
  • Updates Docker build and deployment workflow to support multiple environment builds

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
moon/packages/config/src/index.ts Removes production/development URL conditionals and simplifies to environment variable-based configuration
moon/apps/web/utils/queryClient.ts Updates import to use renamed MONO_API_URL constant
moon/apps/web/next.config.js Adds new staging environment URLs to CSP configuration
moon/apps/web/components/CodeView/TreeView/CloneTabs.tsx Updates to use renamed MONO_API_URL constant
moon/apps/web/Dockerfile Adds APP_ENV build argument and copies environment-specific .env files
moon/apps/web/.env.staging-nju Adds new staging environment configuration for NJU deployment
moon/apps/web/.env.staging Adds standard staging environment configuration
.github/workflows/web-deploy.yml Updates workflow to build multiple environment-specific Docker images
Comments suppressed due to low confidence (1)

moon/packages/config/src/index.ts:19

  • [nitpick] The variable name MONO_API_URL is inconsistent with the naming pattern. Consider renaming to LEGACY_API_URL to maintain consistency with the original variable name and avoid confusion, since this appears to be replacing LEGACY_API_URL functionality.
export const MONO_API_URL = process.env.NEXT_PUBLIC_MONO_API_URL || 'https://git.gitmega.com'

Comment thread moon/apps/web/Dockerfile

COPY --from=builder /app/out/full/ .

RUN cp /app/apps/web/.env.${APP_ENV} /app/apps/web/.env.production

Copilot AI Jul 31, 2025

Copy link

Choose a reason for hiding this comment

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

The copy command will fail if the source file doesn't exist. For example, if APP_ENV is set to a value that doesn't have a corresponding .env file, the build will fail. Consider adding a check to ensure the source file exists before copying, or provide a fallback mechanism.

Suggested change
RUN cp /app/apps/web/.env.${APP_ENV} /app/apps/web/.env.production
RUN if [ -f /app/apps/web/.env.${APP_ENV} ]; then \
cp /app/apps/web/.env.${APP_ENV} /app/apps/web/.env.production; \
else \
cp /app/apps/web/.env.default /app/apps/web/.env.production; \
fi

Copilot uses AI. Check for mistakes.
needs: build
runs-on: ubuntu-latest
steps:
- name: Force ECS redeploy

Copilot AI Jul 31, 2025

Copy link

Choose a reason for hiding this comment

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

The ECS redeploy step in the deploy job will fail because it references variables (REGISTRY, REGISTRY_ALIAS, REPOSITORY, IMAGE_TAG) that are only defined in the build job's matrix strategy. These variables need to be passed to the deploy job or redefined in the deploy job context.

Copilot uses AI. Check for mistakes.
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.

3 participants