yeatmanlab / roar-dashboard

A dashboard to administer ROAR assessments
https://roar.education
Other
4 stars 4 forks source link

Remove hard-coded configs in favour of env variables #848

Open maximilianoertel opened 1 week ago

maximilianoertel commented 1 week ago

Proposed changes

This PR removes hardcoded Firebase configuration values from the codebase and replaces them with environment variables. This change provides improved security by preventing accidental exposure of sensitive data and allows for easier configuration management across different deployment environments.

Additionally, this PR removes the .firebaserc configuration file, following Google's recommendation to exclude it from public repositories to prevent accidental exposure of sensitive information.

Key highlights

Given the changes in how environment configurations are handled, this PR also restructures the npm commands available on the repo. More specifically, it removes all dev and build command variants in favor of two simple npm run dev and npm run build commands. This is done to avoid accidentally running the command with the wrong environment configuration and better support forks and alternative environments such as ROAR Clinic or Levante.

Should you wish to execute a dev or production build with an alternative env configuration, it is recommended to use the --mode flag, for example npm run build -- --mode production which would use the .env.production config.

This approach promotes better separation of concerns, improves maintainability, and enhances the overall security posture of the application.

Types of changes

Checklist

Justification of missing checklist items

n/a

Further comments

n/a

github-actions[bot] commented 1 week ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 0.98% 73 / 7421
🔵 Statements 0.9% 74 / 8156
🔵 Functions 0.77% 14 / 1806
🔵 Branches 0.44% 20 / 4456
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/firekit.js 0% 0% 0% 0% 5-6, 10-27, 30, 30-31, 31, 52, 59-63, 68-111, 119-129, 131
src/store/auth.js 0% 0% 0% 0% 10-247, 11-246, 14-35, 39, 42, 45, 48, 51, 54, 57, 60, 60-61, 61-62, 64, 68-73, 69, 72, 76-77, 80-87, 81-86, 82-83, 85, 88-95, 89-94, 90-91, 93, 98, 101-109, 102-106, 104-105, 108, 112, 115, 118-126, 119-125, 123-124, 129-134, 130-133, 132, 137-141, 138-140, 139, 144-146, 145, 149-152, 151, 155-158, 157, 161, 164-165, 168-169, 172-176, 174-175, 177-186, 178-185, 180-184, 181, 183, 189, 192-194, 197-220, 198-217, 199-208, 210-213, 215-216, 219, 223-230, 224-226, 225, 228-229, 233, 238, 249-251, 250
Generated in workflow #582 for commit 8e476b6 by the Vitest Coverage Report Action
cypress[bot] commented 1 week ago

roar-dashboard-e2e    Run #8168

Run Properties:  status check failed Failed #8168  •  git commit fc05e78f1c: E2E Tests for PR 848 "Remove hard-coded configs in favour of env variables" from...
Project roar-dashboard-e2e
Run status status check failed Failed #8168
Run duration 03m 16s
Commit git commit fc05e78f1c: E2E Tests for PR 848 "Remove hard-coded configs in favour of env variables" from...
Committer Maximilian Oertel
View all properties for this run ↗︎

Test results
Tests that failed  Failures 21
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 0


Tests for review

Failed  cleverSignIn.cy.js • 1 failed test View Output
Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  playVideo.cy.js • 1 failed test View Output
Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  checkLegalDoc.cy.js • 1 failed test View Output
Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  playSWR.cy.js • 1 failed test View Output
Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  playSRE.cy.js • 1 failed test View Output
Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots

The first 5 failed specs are shown, see all 21 specs in Cypress Cloud.