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

Set envName(production or preview) to cliVersion #343

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

hoshinotsuyoshi
Copy link
Member

@hoshinotsuyoshi hoshinotsuyoshi commented Dec 20, 2024

Summary

Integrates the current envName(production or preview) into the React component's environment variables.

There is no change to the visual behavior of the ERD HTML.

Related Issue

Changes

Testing

In local , make this diff

--- a/frontend/packages/erd-core/src/components/ERDRenderer/AppBar/HelpButton/ReleaseVersion.tsx
+++ b/frontend/packages/erd-core/src/components/ERDRenderer/AppBar/HelpButton/ReleaseVersion.tsx
@@ -5,6 +5,8 @@ import styles from './ReleaseVersion.module.css'
 export const ReleaseVersion: FC = () => {
   const { cliVersion } = useCliVersion()

+  console.log('cliVersion:', cliVersion)
+
   // Example output for cliVersion:
   // - Released version:
   //   v0.0.11 (2024-12-19)

and pnpm dev ,

I found that envName set to cliVersion

スクリーンショット 2024-12-20 17 10 56

Other Information

@hoshinotsuyoshi hoshinotsuyoshi self-assigned this Dec 20, 2024
@hoshinotsuyoshi hoshinotsuyoshi force-pushed the pass-branch-name-to-react-component branch from a672599 to 8eb12f6 Compare December 20, 2024 08:03
@hoshinotsuyoshi hoshinotsuyoshi changed the title Pass branch name to React component(work in progress) Pass envName(production or preview) to React component Dec 20, 2024
Integrates the current envName(production/preview) into cliVersion
@hoshinotsuyoshi hoshinotsuyoshi force-pushed the pass-branch-name-to-react-component branch from 8eb12f6 to afdad64 Compare December 20, 2024 08:07
@hoshinotsuyoshi hoshinotsuyoshi changed the title Pass envName(production or preview) to React component Set envName(production or preview) to cliVersion Dec 20, 2024
@hoshinotsuyoshi hoshinotsuyoshi marked this pull request as ready for review December 20, 2024 08:15
@hoshinotsuyoshi hoshinotsuyoshi requested a review from a team as a code owner December 20, 2024 08:15
@hoshinotsuyoshi hoshinotsuyoshi requested review from FunamaYukina, junkisai, MH4GF and sasamuku and removed request for a team December 20, 2024 08:15
Copy link
Member

@MH4GF MH4GF left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

Comment on lines +71 to +73
// The main branch is considered production, all other branches are treated as previews.
// This alignment is done to match the deployment settings to Vercel specified in .github/workflows.
const envName = gitBranch === 'main' ? 'production' : 'preview'
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if I should write about it here, since it's information only our team uses.
But once it's done, it looks good!

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, there seems to be some merit to that opinion! :) I believe managing the envName value within the CLI package is necessary for our team's dogfooding. Conversely, it might be a good idea to move this // comment to the .github/workflows side.

@MH4GF MH4GF added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 7fb934e Dec 20, 2024
12 checks passed
@MH4GF MH4GF deleted the pass-branch-name-to-react-component branch December 20, 2024 08:32
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