Repository navigation
feat(deploy): add local LAB runtime deployment - #3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fc4a8287e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case "$plugin_path" in | ||
| "$wp_root"/wp-content/plugins/*) | ||
| return 0 |
There was a problem hiding this comment.
Reject path traversal before cleaning the plugin target
When CC_D5SR_LOCAL_PLUGIN_PATH contains traversal components, this lexical prefix check still accepts it; for example, /var/www/html/wp-content/plugins/../../ matches the pattern but resolves to /var/www/html. The identical container-side check then allows line 242 to delete every top-level entry in the WordPress root. Canonicalize both paths and require a non-empty direct child of the plugins directory before performing the cleanup.
Useful? React with 👍 / 👎.
| installed_version="$( | ||
| docker compose -f "$compose_file" exec -T "$service" \ | ||
| wp --allow-root plugin get cc-divi5-search-results --field=version \ |
There was a problem hiding this comment.
Pass the configured WordPress root to WP-CLI
When CC_D5SR_LOCAL_WP_ROOT points anywhere other than the service's working directory, all of these WP-CLI calls ignore the validated root and may fail or inspect a different WordPress installation. The existing Docker deployment correctly supplies --path="$wp_root" in bin/cc-deploy-vm:435; the activation, active-state, eval, and version commands here need the same global parameter.
Useful? React with 👍 / 👎.
| docker compose -f "$compose_file" exec -T "$service" \ | ||
| wp --allow-root plugin activate cc-divi5-search-results || return 1 |
There was a problem hiding this comment.
Derive the plugin identifier from the overridden target
When CC_D5SR_LOCAL_PLUGIN_PATH uses a directory name other than cc-divi5-search-results, the package is copied to that overridden path but this command still activates the hard-coded default slug; the verification commands also query that default slug. The deploy therefore either fails after replacing the requested target or verifies an unrelated pre-existing installation instead of the deployed directory.
Useful? React with 👍 / 👎.
| cc_d5sr_local_info "PUBLIC API" | ||
|
|
||
| docker compose -f "$compose_file" exec -T "$service" \ | ||
| wp --allow-root eval ' |
There was a problem hiding this comment.
Skip the loaded API check when activation is disabled
When CC_D5SR_LOCAL_ACTIVATE=0 and the target plugin is inactive, wp eval does not load this plugin's entrypoint or register its autoloader, so SearchEngine cannot exist and the deployment always reports failure after modifying the LAB. Either gate this runtime API check on activation, as the active-state check already is, or explicitly load the deployed plugin for verification.
Useful? React with 👍 / 👎.
Obiettivo
Aggiunge un deploy locale corretto per il LAB Barbagia Musei senza copiare l'intero repository di sviluppo dentro WordPress.
Comandi
Contratto
deploy:local:check:deploy:local:cc-divi5-search-results;SearchEngine;Default:
$HOME/Documents/barbagiamusei-lab-wpcompose.yamlwp_cron/var/www/html/wp-content/plugins/cc-divi5-search-resultsAggiunti contract test e
bash -nin CI.