Command Palette

Search for a command to run...

Назад к скиллам
скилл № 20894

api-reorders-unordered-list

Use when apply fails with 'inconsistent result' where list items swap places (targets[0] now holds targets[1]'s value), or a plan shows reorder-only diffs…

БесплатноБез исполняемых скриптов
coralogixот coralogix★ 22 звезды на GitHub

Установить api-reorders-unordered-list в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

API returns an unordered list in a different order

Trigger: "Provider produced inconsistent result after apply" where x[0].id, x[1].id, ... hold the same values as the plan, but at other indexes. Often intermittent: the same fixture passes in one test and fails in another.

Fix: When order has no meaning and the attribute is an already-released ListNestedAttribute, compare the API list with the prior list before flatten. Use the plan in Create/Update and the state in Read. Compare them as a multiset of the full item content. Same items in a different order: return the prior list. Different items: keep the API order, so the plan shows the drift. Compare full content, not a key, because keys can repeat (the API accepts two targets with the same connector and preset). See orderTargetsLike in internal/provider/notifications/resource_coralogix_global_router.go.

alignRuleTargets(result.Router.GetRules(), router.Rules) // router = extracted from plan
plan, diags = flattenGlobalRouter(ctx, result.Router)

Do not change a released list to SetNestedAttribute for this: it needs a new schema version and breaks index references like targets[0]. For a new attribute, prefer a set.

An import has no prior list, so it keeps the API order. In an acceptance test, skip the list in ImportStateVerifyIgnore and compare it as a multiset in ImportStateCheck against targets saved in the apply step, see ruleTargets in internal/provider/resource_coralogix_global_router_test.go. Skip .#/.% entries equal to "0", as ImportStateVerify does.

Why: A Terraform list is ordered, so any order change counts as a change, even when the backend treats the items as a set.

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл api-reorders-unordered-list?

Use when apply fails with 'inconsistent result' where list items swap places (targets[0] now holds targets[1]'s value), or a plan shows reorder-only diffs. Keep prior order when the items match as a set.

Как установить скилл api-reorders-unordered-list?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл api-reorders-unordered-list запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить api-reorders-unordered-list с