Skip to content

feat: add environment variables when installing#1239

Merged
hwbrzzl merged 5 commits intomasterfrom
bowen/optimize-install-2
Oct 20, 2025
Merged

feat: add environment variables when installing#1239
hwbrzzl merged 5 commits intomasterfrom
bowen/optimize-install-2

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Oct 19, 2025

📑 Description

image

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl requested a review from a team as a code owner October 19, 2025 15:26
Copilot AI review requested due to automatic review settings October 19, 2025 15:26
Copy link
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 adds automatic environment variable configuration during package installation. When installing framework packages (session, route, mail, log, grpc, database), the setup scripts now append required environment variables to .env and .env.example files if they don't already exist.

Key changes:

  • Adds Append method to the File interface for appending content to files
  • Introduces WhenFileContains and WhenFileNotContains conditional modifiers
  • Updates all package setup scripts to append environment variables during installation

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
contracts/packages/modify/modify.go Adds Append method to File interface
packages/modify/modify.go Implements Append, WhenFileContains, and WhenFileNotContains functions with debug logging
packages/modify/modify_test.go Adds test coverage for new conditional modifiers
session/setup/setup.go Adds session environment variables during installation
route/setup/setup.go Adds route environment variables during installation
mail/setup/setup.go Adds mail environment variables during installation
log/setup/setup.go Adds log environment variables during installation
grpc/setup/setup.go Adds grpc environment variables during installation
database/setup/setup.go Adds database environment variables and refactors config content retrieval
errors/list.go Adds FileNotExist error for better error handling
foundation/application.go Adds newline to error messages for better formatting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 11.68831% with 136 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.73%. Comparing base (cfae10b) to head (62a87c2).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
mail/setup/setup.go 0.00% 36 Missing ⚠️
log/setup/setup.go 0.00% 34 Missing ⚠️
session/setup/setup.go 0.00% 34 Missing ⚠️
route/setup/setup.go 0.00% 23 Missing ⚠️
grpc/setup/setup.go 0.00% 8 Missing ⚠️
foundation/application.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1239      +/-   ##
==========================================
- Coverage   66.09%   65.73%   -0.36%     
==========================================
  Files         248      248              
  Lines       17069    17185     +116     
==========================================
+ Hits        11282    11297      +15     
- Misses       5410     5511     +101     
  Partials      377      377              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hwbrzzl hwbrzzl merged commit 68906f1 into master Oct 20, 2025
15 of 22 checks passed
@hwbrzzl hwbrzzl deleted the bowen/optimize-install-2 branch October 20, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant