feat(nixidy-switch): Support multiple environments #50
No reviewers
Labels
No labels
automerge
bug
dependencies
duplicate
enhancement
help wanted
invalid
migrations
question
vulnerability
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
Personal/woodpecker-plugins!50
Loading…
Reference in a new issue
No description provided.
Delete branch "nixidy-switch/multi-env"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PLUGIN_ENVIRONMENTS_FILEto switch multiple Nixidy environments from a whitespace-separated file.Verification
nix build .#nixidy-switchbash -n ./result/bin/nixidy-switchgit diff --checkReview Summary
Strengths
git config/cdside effects.[A-Za-z0-9_-]), then quoted with an explicit.#prefix — no shell or flake-ref injection.countrejects an empty file with a friendly message, andwhile read -ra … || [ "${#environments[@]}" -gt 0 ]correctly picks up a final line with no trailing newline without looping forever (bash clears a-aarray even on EOF) and isset -u-safe (the@-subscript exemption covers an unset array).Blocking
plugins/nixidy-switch/default.nix:31vs:55: the environments file is checked beforecd "$CI_WORKSPACE"but opened after it, so the two resolve relative paths against different directories whenever the container's initial working directory differs fromCI_WORKSPACE(a step-leveldirectory:, or running the image manually where CWD is the image WORKDIR). README:34-35 promises the path is "resolved before changing to CI_WORKSPACE", which only describes the check. See comment 1 — please make code and docs consistent (one-line fix either way).Optional / non-blocking
nixidy switchcan never consume the remaining entries.\rin the error message; strip it or document LF-only files..#prefix in the file for symmetry withenvironment, and consider anintegration.yamlcovering the multi-env path (flake-checker sets the precedent in this repo).*🤖 Review by opencode (opencode/mimo-v2.6-flash-free) — verdict: changes
Code review findings from opencode.
@ -20,0 +28,4 @@exit 1fiif [ -n "$env_file" ] && [ ! -r "$env_file" ]; then@ -23,0 +41,4 @@ficount=0while read -ra environments || [ "''${#environments[@]}" -gt 0 ]; do@ -23,0 +49,4 @@exit 1;;esacnixidy switch ".#$env"View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.