Skip to content

VIDSOL-501: Embed config.json into build#382

Merged
OscarFava merged 5 commits intodevelopfrom
vidsol-501/embed-configjson-build
Mar 4, 2026
Merged

VIDSOL-501: Embed config.json into build#382
OscarFava merged 5 commits intodevelopfrom
vidsol-501/embed-configjson-build

Conversation

@OscarFava
Copy link
Copy Markdown
Contributor

@OscarFava OscarFava commented Feb 24, 2026

What is this PR doing?

  • Removed appConfig context and its associated actions, hooks, and types.
  • Updated tests to eliminate dependencies on appConfig context.
  • Refactored components to use environment variables for configuration instead of appConfig.
  • Adjusted test providers to reflect the removal of appConfig context.
  • Enhanced environment variable setup for consistent testing across environments.
  • Updated environment variable keys to remove the VITE_ prefix for consistency.
  • Refactored the Env class to streamline parsing and initialization of environment variables.
  • Added an ErrorPage component to handle unrecoverable errors gracefully.
  • Updated tests to reflect changes in environment variable structure and ensure proper functionality.

How should this be manually tested?

General testing of appConfig (now, you can modify it in vcrBuild.env.sh)

What are the relevant tickets?

A maintainer will add this ticket number.

Resolves VIDSOL-501

Checklist

[ ] Branch is based on develop (not main).
[ ] Resolves a Known Issue.
[ ] If yes, did you remove the item from the docs/KNOWN_ISSUES.md?
[ ] Resolves an item reported in Issues.
If yes, which issue? Issue Number?

- Removed appConfig context and its associated actions, hooks, and types.
- Updated tests to eliminate dependencies on appConfig context.
- Refactored components to use environment variables for configuration instead of appConfig.
- Adjusted test providers to reflect the removal of appConfig context.
- Enhanced environment variable setup for consistent testing across environments.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 removes the runtime config.json/appConfig store approach and moves the application’s feature/config flags into Vite environment variables (sourced via vcrBuild.env.sh), updating the frontend code and tests to read from env instead of an AppConfig context.

Changes:

  • Removed frontend/src/stores/appConfig (store, actions, hooks, types) and deleted frontend/public/config.json.
  • Expanded frontend/src/env.ts with feature flags + added partialUpdate/reset to support tests, then refactored components/hooks to use env.VITE_*.
  • Updated test providers and many unit tests to stop depending on the appConfig provider wrapper; adjusted scripts/Nx targets to source vcrBuild.env.sh.

Reviewed changes

Copilot reviewed 105 out of 106 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vcrBuild.env.sh Adds VITE_* config flags used by the frontend.
scripts/testFrontend.ts Sources vcrBuild.env.sh before running vitest/nx tests.
frontend/src/test/setup.ts Resets env between tests for isolation.
frontend/src/test/providers/makersIndex.ts Removes appConfig provider wrapper export.
frontend/src/test/providers/makeTestProvider.ts Removes appConfig provider + updates dependency graph.
frontend/src/test/providers/makeAppConfigProviderWrapper.ts Removes appConfig provider wrapper (deleted).
frontend/src/stores/appConfig/types/index.ts Removes appConfig types barrel (deleted).
frontend/src/stores/appConfig/types/WaitingRoomSettings.ts Removes type (deleted).
frontend/src/stores/appConfig/types/VideoSettings.ts Removes type (deleted).
frontend/src/stores/appConfig/types/MeetingRoomSettings.ts Removes type (deleted).
frontend/src/stores/appConfig/types/AudioSettings.ts Removes type (deleted).
frontend/src/stores/appConfig/types/AppConfig.ts Removes type (deleted).
frontend/src/stores/appConfig/index.tsx Removes store export entrypoint (deleted).
frontend/src/stores/appConfig/hooks/useSuspenseUntilAppConfigReady/useSuspenseUntilAppConfigReady.ts Removes suspense hook (deleted).
frontend/src/stores/appConfig/hooks/useSuspenseUntilAppConfigReady/useSuspenseUntilAppConfigReady.test.tsx Removes tests for removed hook (deleted).
frontend/src/stores/appConfig/hooks/useSuspenseUntilAppConfigReady/index.ts Removes barrel export (deleted).
frontend/src/stores/appConfig/hooks/useShouldShowParticipantList.ts Removes selector hook (deleted).
frontend/src/stores/appConfig/hooks/useIsMicrophoneControlAllowed.ts Removes selector hook (deleted).
frontend/src/stores/appConfig/hooks/useIsMeetingChatAllowed.ts Removes selector hook (deleted).
frontend/src/stores/appConfig/hooks/useIsMeetingCaptionsAllowed.ts Removes selector hook (deleted).
frontend/src/stores/appConfig/hooks/useIsCameraControlAllowed.ts Removes selector hook (deleted).
frontend/src/stores/appConfig/hooks/useIsBackgroundEffectsAllowed.ts Removes selector hook (deleted).
frontend/src/stores/appConfig/hooks/index.ts Removes hooks barrel (deleted).
frontend/src/stores/appConfig/helpers/mergeAppConfigs.ts Removes merge helper (deleted).
frontend/src/stores/appConfig/helpers/index.ts Removes helpers barrel (deleted).
frontend/src/stores/appConfig/helpers/defaultAppConfig.ts Removes default config (deleted).
frontend/src/stores/appConfig/appConfigStore.ts Removes store definition (deleted).
frontend/src/stores/appConfig/appConfigStore.spec.tsx Removes store tests (deleted).
frontend/src/stores/appConfig/appConfig$.ts Removes store “$” facade (deleted).
frontend/src/stores/appConfig/actions/updateAppConfig.ts Removes action (deleted).
frontend/src/stores/appConfig/actions/loadAppConfig.ts Removes fetch-from-config.json action (deleted).
frontend/src/pages/WaitingRoom/WaitingRoom.tsx Uses env for waiting-room device selection.
frontend/src/pages/WaitingRoom/WaitingRoom.spec.tsx Updates tests to set env flags instead of appConfig context.
frontend/src/pages/MeetingRoom/MeetingRoom.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/hooks/tests/useScreenShare.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/hooks/tests/useCollectBrowserInformation.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/env.ts Adds many VITE_* flags + test-time mutation/reset helpers.
frontend/src/components/WaitingRoom/MicButton/MicButton.tsx Gates rendering via env flag.
frontend/src/components/WaitingRoom/MicButton/MicButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/WaitingRoom/ControlPanel/ControlPanel.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/WaitingRoom/CameraButton/CameraButton.tsx Uses env for camera-control gating.
frontend/src/components/WaitingRoom/CameraButton/CameraButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/WaitingRoom/BackgroundEffects/BackgroundEffectsDialog/BackgroundEffectsDialog.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/WaitingRoom/BackgroundEffects/BackgroundEffectsButton/BackgroundEffectsButton.tsx Uses env for background-effects gating.
frontend/src/components/WaitingRoom/BackgroundEffects/BackgroundEffectsButton/BackgroundEffectsButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/SoundTest/SoundTest.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/ScreenSharingButton/ScreenSharingButton.tsx Uses env for screenshare gating.
frontend/src/components/ScreenSharingButton/ScreenSharingButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/VideoDevices/VideoDevices.tsx Uses env for meeting-room device selection gating.
frontend/src/components/MeetingRoom/VideoDevices/VideoDevices.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/UnreadMessagesBadge/UnreadMessagesBadge.tsx Uses env for chat gating.
frontend/src/components/MeetingRoom/UnreadMessagesBadge/UnreadMessagesBadge.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/ToolbarOverflowMenu/ToolbarOverflowMenu.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/ToolbarOverflowButton/ToolbarOverflowButton.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/Toolbar/Toolbar.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/ReduceNoiseTestSpeakers/ReduceNoiseTestSpeakers.tsx Uses env for ANS gating.
frontend/src/components/MeetingRoom/ReduceNoiseTestSpeakers/ReduceNoiseTestSpeakers.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/ParticipantListItemMenu/ParticipantListItemMenu.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/ParticipantListButton/ParticipantsListButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/ParticipantListButton/ParticipantListButton.tsx Uses env for participant list gating.
frontend/src/components/MeetingRoom/ParticipantList/ParticipantList.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/OutputAudioDevices/OutputDevices.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/OutputAudioDevices/OutputAudioDevices.tsx Uses env for meeting-room device selection gating.
frontend/src/components/MeetingRoom/MutingDialog/MutingDialog.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/LayoutButton/LayoutButton.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/InputAudioDevices/InputAudioDevices.tsx Uses env for meeting-room device selection gating.
frontend/src/components/MeetingRoom/InputAudioDevices/InputAudioDevices.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/EmojiGridButton/EmojiGridButton.tsx Uses env for emojis gating.
frontend/src/components/MeetingRoom/EmojiGridButton/EmojiGridButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/DeviceSettingsMenu/DeviceSettingsMenu.tsx Uses env for background-effects gating.
frontend/src/components/MeetingRoom/DeviceSettingsMenu/DeviceSettingsMenu.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/DeviceControlButton/DeviceControlButton.tsx Uses env for mic/camera gating.
frontend/src/components/MeetingRoom/DeviceControlButton/DeviceControlButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/ChatInput/ChatInput.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/ChatButton/ChatButton.tsx Uses env for chat gating.
frontend/src/components/MeetingRoom/ChatButton/ChatButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/Chat/Chat.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/CaptionsButton/CaptionsButton.tsx Uses env for captions gating.
frontend/src/components/MeetingRoom/CaptionsButton/CaptionsButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/MeetingRoom/AudioIndicator/AudioIndicator.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/MeetingRoom/ArchivingButton/ArchivingButton.tsx Uses env for archiving gating.
frontend/src/components/MeetingRoom/ArchivingButton/ArchivingButton.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/HiddenParticipantsTile/HiddenParticipantsTile.tsx Uses env for participant list gating.
frontend/src/components/HiddenParticipantsTile/HiddenParticipantsTile.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/components/BackgroundEffects/EffectOptionButtons/EffectOptionButtons.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/BackgroundEffects/BackgroundGallery/BackgroundGallery.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/BackgroundEffects/BackgroundEffectsLayout/BackgroundEffectsLayout.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/components/BackgroundEffects/BackgroundEffectOptions/BackgroundEffectOptions.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/Context/tests/RoomContext.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/Context/SessionProvider/session.tsx Reads default layout mode from env instead of appConfig.
frontend/src/Context/SessionProvider/session.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/Context/PublisherProvider/usePublisherOptions/usePublisherOptions.tsx Uses env for join defaults and resolution.
frontend/src/Context/PublisherProvider/usePublisherOptions/usePublisherOptions.spec.tsx Updates tests to use env.partialUpdate.
frontend/src/Context/PublisherProvider/usePublisher/usePublisher.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/Context/PreviewPublisherProvider/usePreviewPublisher/usePreviewPublisher.tsx Uses env for default resolution.
frontend/src/Context/PreviewPublisherProvider/usePreviewPublisher/usePreviewPublisher.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/Context/BackgroundPublisherProvider/useBackgroundPublisher/useBackgroundPublisher.spec.tsx Removes appConfig provider usage in test wrapper.
frontend/src/AppContextProvider.tsx Removes appConfig provider wrapper from app root.
frontend/src/App.tsx Removes appConfigValue prop plumbing.
frontend/public/config.json Removes config.json (deleted).
frontend/project.json Attempts to source vcrBuild.env.sh for multiple targets; updates test target correctly.
frontend/.env.example Removes example env file (deleted).
docs/TESTING.md Updates docs to reflect removal of appConfig test wrapper.
config.example.json Removes example config.json (deleted).

- Changed imports of environment variables from default to named imports across multiple components and tests.
- Updated environment variable keys to remove the VITE_ prefix for consistency.
- Refactored the Env class to streamline parsing and initialization of environment variables.
- Added an ErrorPage component to handle unrecoverable errors gracefully.
- Enhanced localization files with error messages for better user experience.
- Updated tests to reflect changes in environment variable structure and ensure proper functionality.
@OscarFava
Copy link
Copy Markdown
Contributor Author

vcr:deploy

@OscarFava
Copy link
Copy Markdown
Contributor Author

vcr:deploy

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

❌ Deployment to VCR Failed

Commit: 8ff6b5d4c1a655a673f11b87b3c0f349787e4974

View build logs

@OscarFava
Copy link
Copy Markdown
Contributor Author

vcr:deploy

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

❌ Deployment to VCR Failed

Commit: 8ff6b5d4c1a655a673f11b87b3c0f349787e4974

View build logs

@sharad-srivastava2
Copy link
Copy Markdown
Contributor

General QA looks good.

@OscarFava OscarFava merged commit d76a90e into develop Mar 4, 2026
17 checks passed
@OscarFava OscarFava deleted the vidsol-501/embed-configjson-build branch March 4, 2026 08:28
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 4, 2026

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.

5 participants