feat(x2a): push images to quay#2453
Conversation
Review Summary by Qodo
WalkthroughsDescription• Add optional --push flag to push built images to registry • Introduce push_plugin() function to handle image pushing • Implement argument parsing with parse_args() function • Update script documentation with usage options Diagramflowchart LR
A["Script execution"] --> B["Parse arguments"]
B --> C["Build and package plugins"]
C --> D{Push flag enabled?}
D -->|Yes| E["Push images to registry"]
D -->|No| F["Complete"]
E --> F
File Changes1. workspaces/x2a/scripts/build-dynamic-plugins.sh
|
Code Review by Qodo
1. Hardcoded push registry
|
|
| push_plugin() { | ||
| local plugin_dir="$1" | ||
| local image_name="${PLUGIN_IMAGES[$plugin_dir]}" | ||
| local version | ||
| version="$(get_plugin_version "$plugin_dir")" | ||
| local image_tag="${IMAGE_REGISTRY}/${image_name}:${version}" | ||
|
|
||
| log "Pushing image: ${image_tag}" | ||
| podman push "$image_tag" |
There was a problem hiding this comment.
1. Hardcoded push registry 🐞 Bug ⛨ Security
With --push, the script always pushes to the hardcoded quay.io/x2ansible registry/org, making it easy for forks/CI to publish to the wrong place and impossible to redirect without editing the script.
Agent Prompt
### Issue description
`--push` always publishes to `quay.io/x2ansible` because `IMAGE_REGISTRY` is hardcoded. This is risky in forks/CI and prevents pushing to test registries.
### Issue Context
The script already tags images with `${IMAGE_REGISTRY}/...` and `--push` simply runs `podman push` for those tags.
### Fix Focus Areas
- workspaces/x2a/scripts/build-dynamic-plugins.sh[19-29]
- workspaces/x2a/scripts/build-dynamic-plugins.sh[122-129]
- workspaces/x2a/scripts/build-dynamic-plugins.sh[107-116]
### Suggested change
- Change to `IMAGE_REGISTRY="${IMAGE_REGISTRY:-quay.io/x2ansible}"` (env override).
- Extend `parse_args` to support `--registry <value>` (or `--image-registry <value>`), validate non-empty.
- (Optional safety) If `--push` is set and `IMAGE_REGISTRY` is still the default, require a `--confirm-upstream` flag or print a prominent warning and ask for confirmation (only if interactive).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Small commit to push images directly to quay.