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

chore: dotenv integrations update #538

Merged
merged 13 commits into from
Feb 14, 2025
Merged

Conversation

cswni
Copy link
Contributor

@cswni cswni commented Feb 13, 2025

This pull request includes various updates and improvements across multiple files, focusing on configuration changes, dependency updates, and enhancements to the codebase. The most important changes include updates to environment variables, workflow adjustments, and the addition of a code coverage badge.

Environment and configuration updates:

  • .env.vault: Updated the development, CI, staging, and production vault keys and their respective versions.

Workflow adjustments:

Dependency updates:

  • package.json: Added the dotenv package as a new dependency.

Documentation and testing improvements:

  • README.md: Added a Codecov badge to the README file to display code coverage status.
  • setupTest.ts: Added a mock for the react-i18next module to improve testing.This pull request includes multiple changes across various files to update environment variables, improve CI workflows, add a badge to the README, and update dependencies.

Environment Variables:

  • Updated DOTENV_VAULT_DEVELOPMENT, DOTENV_VAULT_CI, DOTENV_VAULT_STAGING, DOTENV_VAULT_PRODUCTION and their versions in .env.vault.

CI Workflow Improvements:

  • Removed the "Build analysis" step from the CI workflow in .github/workflows/ci.yml.
  • Changed the job name from "Release" to "Semver Release" in .github/workflows/release.yml.

Documentation:

  • Added a Codecov badge to the README.md file.

Dependencies:

  • Added the dotenv package to package.json.

Codebase Updates:

  • Updated the URL in the handleClick function in src/sections/finance/components/finance-earn-tokens.tsx and added a TODO comment to move it to environment variables.
  • Re-added the codecovVitePlugin configuration in vite.config.ts after the nodePolyfills plugin.

geolffreym and others added 9 commits February 7, 2025 10:09
- Updated `package.json`:
  - Added `dotenv` library (`^16.4.7`) as a new dependency.

This enables the use of environment variables to enhance configuration management and improve project flexibility.
- `.env.vault`: Updated secrets and versions for `development`, `ci`, and `staging` environments.
  - `DOTENV_VAULT_DEVELOPMENT`: Replaced secret and updated to version 2.
  - `DOTENV_VAULT_CI`: Replaced secret and updated to version 3.
  - `DOTENV_VAULT_STAGING`: Replaced secret and updated to version 2.
- Updated `finance-earn-tokens.tsx` to use `EARN_TOKEN_SERVICE_URL` from `GLOBAL_CONSTANTS` instead of hardcoding the URL.
- Added `EARN_TOKEN_SERVICE_URL` constant definition in `config-global.ts` with fallback to environment variables.
This ensures better maintainability and configuration flexibility.
@cswni cswni added the Refactor label Feb 13, 2025
@cswni cswni requested review from geolffreym and Jadapema February 13, 2025 00:21
@cswni cswni self-assigned this Feb 13, 2025
@cswni cswni changed the title chore: dotenv integrations updates chore: dotenv integrations update Feb 13, 2025
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 8.30%. Comparing base (537b029) to head (7ce1454).
Report is 19 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff            @@
##            next    #538      +/-   ##
========================================
+ Coverage   0.03%   8.30%   +8.26%     
========================================
  Files        557     558       +1     
  Lines      30734   30752      +18     
  Branches     557     618      +61     
========================================
+ Hits          11    2553    +2542     
+ Misses     30167   27729    -2438     
+ Partials     556     470      -86     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- Create `src/test/config-global.test.ts` to validate the presence of critical properties in `GLOBAL_CONSTANTS`.
- Ensure all required properties, such as `MMC_ADDRESS`, `EMAIL_API_KEY`, and `BASE_URL`, are defined.
- Export `FinanceEarnTokensProps` for external usage in other modules/files.
- Add `data-testid="earn-tokens-image"` to the relevant `Stack` component for improved testability in `finance-earn-tokens.tsx`.
- Updated `setupTest.ts` to include `vi` from `vitest` and mock `react-i18next`.
- Added a `__mocks__/react-i18next.js` file to mock `useTranslation`, providing basic functionality for `t` and `i18n`.
This ensures compatibility in tests that rely on i18n translations.
- Created `finance-earn-token.test.tsx` to cover functionality.
- Verified snapshot rendering for consistent UI structure.
- Tested presence and correctness of title, subtitle, and description.
- Ensured button click triggers `window.open` with expected URL.
- Confirmed image visibility on large screens.
Copy link
Member

@Jadapema Jadapema left a comment

Choose a reason for hiding this comment

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

LGTM

@Jadapema Jadapema merged commit 4752c28 into next Feb 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
3 participants