Commit graph

78 commits

Author SHA1 Message Date
Andras Bacsai
d67fcd1dff feat: add magic variable detection and update UI behavior accordingly 2025-12-27 15:24:09 +01:00
Andras Bacsai
e4cc5c1178 fix: update success message logic to only show when changes are made 2025-12-27 15:24:09 +01:00
Andras Bacsai
d640911bb9 fix: preserve existing comments in bulk update and always show save notification
This commit fixes two UX issues with environment variable bulk updates:

1. Comment Preservation (High Priority Bug):
   - When bulk updating environment variables via Developer view, existing
     manually-entered comments are now preserved when no inline comment is provided
   - Only overwrites existing comments when an inline comment (#comment) is explicitly
     provided in the pasted content
   - Previously: pasting "KEY=value" would erase existing comment to null
   - Now: pasting "KEY=value" preserves existing comment, "KEY=value #new" overwrites it

2. Save Notification (UX Improvement):
   - "Save all Environment variables" button now always shows success notification
   - Previously: only showed notification when changes were detected
   - Now: provides feedback even when no changes were made
   - Consistent with other save operations in the codebase

Changes:
- Modified updateOrCreateVariables() to only update comment field when inline comment
  is provided (null check prevents overwriting existing comments)
- Modified handleBulkSubmit() to always dispatch success notification unless error occurred
- Added comprehensive test coverage for bulk update comment preservation scenarios

Tests:
- Added 4 new feature tests covering comment preservation edge cases
- All 22 existing unit tests for parseEnvFormatToArray pass
- Code formatted with Pint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 15:24:09 +01:00
Andras Bacsai
0eb0dbef02 fix: save comment field when creating application environment variables
The comment field was not being saved when creating environment variables from applications, even though it worked for shared environment variables. The issue was in the createEnvironmentVariable method which was missing the comment assignment.

Added: $environment->comment = $data['comment'] ?? null;

The comment is already dispatched from the Add component and now it's properly saved to the database for application environment variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 15:24:09 +01:00
Andras Bacsai
4e329053dd feat: add comment field to shared environment variables
Add comment field support to the "New Shared Variable" modal, ensuring it's saved properly for both normal and shared environment variables at all levels (Team, Project, Environment).

Changes:
- Add comment property, validation, and dispatch to Add component (Livewire & view)
- Update saveKey methods in Team, Project, and Environment to accept comment
- Replace SharedEnvironmentVariable model's $guarded with explicit $fillable array
- Include comment field in creation flow for all shared variable types

The comment field (max 256 chars, optional) is now available when creating shared variables and is consistently saved across all variable types.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 15:24:09 +01:00
Andras Bacsai
ab472bf5ed feat: enhance environment variable handling to support mixed formats and add comprehensive tests 2025-12-27 15:24:09 +01:00
Andras Bacsai
201c9fada3 feat: limit comment field to 256 characters for environment variables 2025-12-27 15:24:09 +01:00
Andras Bacsai
e33558488e feat: add comment field to environment variables
- Add comment field to EnvironmentVariable model and database
- Update parseEnvFormatToArray to extract inline comments from env files
- Update Livewire components to handle comment field
- Add UI for displaying and editing comments
- Add tests for comment parsing functionality
2025-12-27 15:24:09 +01:00
Andras Bacsai
c2e1379ba8 feat: add availableSharedVariables method and enhance env-var-input component for better password handling 2025-11-27 10:23:46 +01:00
Andras Bacsai
0298ddffbd fix: ensure syncData is called with both true and false parameters in submit method 2025-11-27 09:26:54 +01:00
Andras Bacsai
c79b5f1e5c feat: add environment variable autocomplete component
Adds a new EnvVarInput component that provides autocomplete suggestions for shared environment variables from team, project, and environment scopes. Users can reference variables using {{ syntax.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 10:54:19 +01:00
Andras Bacsai
eb1f16b62e fix(environment): clear computed property cache after adding environment variables
- Added cache clearing for environment variables and their preview after a new variable is added to ensure the UI reflects the latest data.
- Updated the refreshEnvs method to include cache clearing, enhancing the responsiveness of the environment variable display.
2025-10-07 13:57:59 +02:00
Andras Bacsai
b1abdcee83 feat(environment-variables): implement environment variable analysis for build-time issues
- Added EnvironmentVariableAnalyzer trait to analyze and warn about problematic environment variables during the build process.
- Integrated analysis into ApplicationDeploymentJob and Livewire components to provide feedback on potential build issues.
- Introduced a new Blade component for displaying warnings related to environment variables in the UI.
2025-09-23 08:53:14 +02:00
Andras Bacsai
f33df13c4e feat(environment): replace is_buildtime_only with is_runtime and is_buildtime flags for environment variables, updating related logic and views 2025-09-18 18:14:54 +02:00
Andras Bacsai
c1bee32f09 feat(deployment): introduce 'use_build_secrets' setting for enhanced security during Docker builds and update related logic in deployment process 2025-09-17 10:34:38 +02:00
Andras Bacsai
8e155f25b3 refactor(environment): streamline environment variable handling by replacing sorting methods with direct property access and enhancing query ordering for improved performance 2025-09-12 12:09:03 +02:00
Andras Bacsai
20ad2165e7 feat(environment): introduce 'is_buildtime_only' attribute to environment variables for improved build-time configuration 2025-09-11 17:38:16 +02:00
Andras Bacsai
5b3b4bbc43 refactor(environment): remove 'is_build_time' attribute from environment variable handling across the application to simplify configuration 2025-09-11 16:51:56 +02:00
Arnaud B
e23ab1e621
feat(deployment): add SERVICE_NAME variables for service discovery
This change introduces automatically generated `SERVICE_NAME_<SERVICE>`
environment variables for each service within a Docker Compose deployment.
This allows services to reliably reference each other by name, which is particularly
useful in pull request environments where container names are dynamically suffixed.

- The application parser now generates and injects these `SERVICE_NAME` variables
   into the environment of all services in the compose file.
- `ApplicationDeploymentJob` is updated to correctly handle and filter these
  new variables during deployment.
- UI components and the `EnvironmentVariableProtection` trait have been updated
to make these generated variables read-only, preventing accidental modification.

This commit introduces two new helper functions to standardize resource naming
for pull request deployments:

-  `addPreviewDeploymentSuffix()`: Generates a consistent suffix format (-pr-{id})
   for resource names in preview deployments
-  `generateDockerComposeServiceName()`: Creates SERVICE_NAME environment variables
   for Docker Compose services
2025-09-08 15:22:44 +02:00
Andras Bacsai
63fcc0ebc3 feat(acl): Change views/backend code to able to use proper ACL's later on. Currently it is not enabled. 2025-08-26 10:27:38 +02:00
Andras Bacsai
adb8f9d88e feat(auth): implement authorization checks for database management 2025-08-23 18:50:35 +02:00
Andras Bacsai
40f108d6e1 feat(auth): implement authorization checks for application management 2025-08-22 16:47:59 +02:00
Andras Bacsai
13a9816770 fix(service): ensure configuration changes are properly tracked and dispatched 2025-07-03 15:08:13 +02:00
Andras Bacsai
9480fc2b2f refactor(environment-variables): remove debug logging from bulk submit handling for cleaner code 2025-05-30 09:11:40 +02:00
Andras Bacsai
00fe6e9003 refactor(environment-variables): remove protected variable checks from delete methods for cleaner logic 2025-04-22 11:40:35 +02:00
Andras Bacsai
f63415f027 feat(EnvironmentVariable): implement protection for critical environment variables and enhance deletion logic 2025-04-07 22:57:26 +02:00
Andras Bacsai
d383344ab9 feat(EnvironmentVariable): add handling for Redis credentials in the environment variable component 2025-04-06 21:13:11 +02:00
Andras Bacsai
0ff7c468c8 fix(ui): skip SERVICE_FQDN and SERVICE_URL variables during update 2025-02-03 15:44:15 +01:00
peaklabs-dev
9f3c6b4b76
fix(env): shared variables can not be updated 2025-01-22 17:02:11 +01:00
Andras Bacsai
1fe4dd722b Revert "rector: arrrrr"
This reverts commit 16c0cd10d8.
2025-01-07 15:31:43 +01:00
Andras Bacsai
16c0cd10d8 rector: arrrrr 2025-01-07 14:52:08 +01:00
Andras Bacsai
2a9d499251 feat: migrate env variables to polymorphic relationship
fix: proxy status query ui
2024-12-17 10:38:42 +01:00
Andras Bacsai
e76817d401 improve application view 2024-12-16 14:11:45 +01:00
Andras Bacsai
946ab81d87 is_required is not required for shared envs 2024-12-07 14:35:14 +01:00
Lucas Michot
c5403b0b3f Always prefer ::class notation 2024-10-28 14:56:13 +01:00
peaklabs-dev
1d2e9b6946
fix is required on shared variables 2024-10-18 12:29:33 +02:00
Andras Bacsai
88f1e58c63 feat: required envs 2024-10-11 14:38:22 +02:00
Andras Bacsai
c2c0afa0ba fix: service env orders, application env orders 2024-10-04 12:08:57 +02:00
Andras Bacsai
611f70d79f chore: Remove commented code for shared variable type validation 2024-10-04 12:08:06 +02:00
Andras Bacsai
bfeaae9caa fix: env variable in value parsed 2024-09-04 14:33:16 +02:00
Andras Bacsai
2227858f58 refactor: Load environment variables based on resource type in sortEnvironmentVariables() 2024-08-16 12:23:31 +02:00
Andras Bacsai
9864d380a3 fix: sync fqdn change on the UI 2024-08-15 11:23:44 +02:00
Andras Bacsai
f90316b050
Merge pull request #3062 from peaklabs-dev/fix-#3022
Fix: Environment variables are not saving and sorting is not working properly in some cases
2024-08-14 21:13:23 +02:00
ayntk-ai
4d12447715
order column added to track order of env in the UI 2024-08-14 20:35:08 +02:00
ayntk-ai
fbde257166
fix disable/enable environment variabel sorting 2024-08-12 23:00:08 +02:00
ayntk-ai
e28289ce1e
cleanup all.php 2024-08-12 14:46:30 +02:00
ayntk-ai
122491808c
fix env deletion and sorting of locked envs 2024-08-12 14:44:18 +02:00
ayntk-ai
1d7c833b7c
fix sort alphabetically 2024-08-12 14:13:03 +02:00
ayntk-ai
93444ea872
fix manual safe button and few simplifications 2024-08-12 14:06:00 +02:00
ayntk-ai
c5aba34a6f
new submit logic 2024-08-12 13:23:36 +02:00