Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: dan2k3k4 <158704+dan2k3k4@users.noreply.github.com> Agent-Logs-Url: https://github.com/amazeeio/polydock-engine/sessions/0b2ff62a-9be4-462b-b503-e3e8ab5cad64
…nce provisioning Co-authored-by: dan2k3k4 <158704+dan2k3k4@users.noreply.github.com> Agent-Logs-Url: https://github.com/amazeeio/polydock-engine/sessions/8ac87baa-4aa8-4de5-b599-f0af18e2b880
There was a problem hiding this comment.
Pull request overview
Release bundle that extends the external authenticated API to expose store app git URLs and support user first/last names during instance provisioning, while also adjusting Lagoon SSH token retrieval and instance stage progression logic.
Changes:
- Add
git_urlto/api/store-appsresponses and update tests accordingly. - Enhance
/api/instanceprovisioning to acceptfirst_name/last_name, update placeholder names for existing users, and persist user identity data onto the instance for claiming. - Update Lagoon SSH key selection/token retrieval behavior and tweak stage progression to allow claiming when
user-emaildata is present.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/Feature/Api/AuthenticatedApiTest.php |
Adds coverage for git_url and name-handling behavior during instance provisioning. |
app/Services/LagoonClientService.php |
Improves error messaging and changes SSH key resolution + token fetch implementation. |
app/Jobs/ProcessPolydockAppInstanceJobs/ProgressToNextStageJob.php |
Allows progressing to claim stage when instance has user-email data (even without remote registration). |
app/Http/Controllers/Api/AuthenticatedApiController.php |
Adds git_url to store-app output and supports first_name/last_name in instance creation while persisting user identity to instance data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Fallback or override via content if provided (from config, not env()) | ||
| $keyContent = config('polydock.ftlagoon_private_key_content'); |
There was a problem hiding this comment.
config('polydock.ftlagoon_private_key_content') is referenced here, but there is no ftlagoon_private_key_content key defined under config/polydock.php. As-is, this override-by-content path will always be null unless something sets it at runtime. Define this config key (likely from an env var) or change this to read the intended env/config source so key content provisioning actually works.
| // Fallback or override via content if provided (from config, not env()) | |
| $keyContent = config('polydock.ftlagoon_private_key_content'); | |
| // Fallback or override via content if provided (prefer config, then env) | |
| $keyContent = config('polydock.ftlagoon_private_key_content', env('FTLAGOON_PRIVATE_KEY_CONTENT')); |
| // Add user information to the app instance data - this enables claiming | ||
| $instance->data = array_merge($instance->data ?? [], [ | ||
| 'user-email' => $user->email, | ||
| 'user-first-name' => $user->first_name, | ||
| 'user-last-name' => $user->last_name, | ||
| ]); | ||
| $instance->save(); |
There was a problem hiding this comment.
These reserved user-* keys are set on the instance here, but later in this method the generic config loop can overwrite them (e.g. a client can pass config: {"user-email": "other@example.com"}), which would desync claiming/stage-progression data from the provisioning email. Prevent config from setting reserved keys (blacklist/whitelist), or apply these user-* keys after processing config so they always win.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changes in this release:
440ce98 chore: add tests
79b29a2 chore: fix docblock
dccdc33 chore: batch user info data updates into single DB write during instance provisioning
8685253 fix: use filled() for first_name/last_name defaults in firstOrCreate
369044f Initial plan
23dfde9 Update app/Http/Controllers/Api/AuthenticatedApiController.php
d637557 Initial plan
563b560 chore: support first and last name for api/instance
b1ff761 chore: adapt ssh trigger deploy
d6f1eb7 Apply suggestions from code review
56dcfde chore: fix trigger deploy button
5be19a9 Add git_url to /store-apps API endpoint and tests