fix: detect loki prefix without requiring hyphen (case-insensitive)#29
fix: detect loki prefix without requiring hyphen (case-insensitive)#29royosherove merged 1 commit intomainfrom
Conversation
Accounts like 'loki1-xxxx' were not detected as already prefixed, causing a misleading rename suggestion to 'Loki-loki1-xxxx'. Changed the prefix check from 'loki-*' to 'loki*' so any name starting with 'loki' (case-insensitive) is recognized as already having the Loki prefix. Added tests for loki1- and LokiDev- variants.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a91a8d4e4c
ℹ️ 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".
| local lower_name | ||
| lower_name=$(printf '%s' "$current_name" | tr '[:upper:]' '[:lower:]') | ||
| if [[ "$lower_name" == loki-* ]]; then | ||
| if [[ "$lower_name" == loki* ]]; then |
There was a problem hiding this comment.
Restrict prefix detection to names with a real separator
The new loki* check marks any AccountName starting with loki as already prefixed, but this path still assumes an exact Loki- prefix when it computes stripped_original via ${current_name:5}. For inputs like loki1-MyAccount or LokiDev-SomeAccount, the installer now writes malformed /loki/original-account-name values (e.g. -MyAccount, ev-SomeAccount), which corrupts the account-rename metadata this function persists on first install.
Useful? React with 👍 / 👎.
|
Triage of Codex review 4216296891: P2 \u2014 malformed Correct bug. Broadening to Follow-up #30: only strip when the lowercase 5-char prefix is exactly |
Accounts like
loki1-xxxxwere not detected as already prefixed, causing a misleading rename suggestion toLoki-loki1-xxxx.Changed the prefix check from
loki-*toloki*so any name starting withloki(case-insensitive) is recognized as already having the Loki prefix.Changes
loki-*→loki*in_account_already_prefixed()loki1-andLokiDev-variantsAll 61 tests pass.