Repository navigation
feat(environments): explain policy and sign-in failures in Settings and offer only configured channels - #166
Draft
romulorosa wants to merge 11 commits into
Conversation
Create environment and Add packages now offer exactly the configured channels, by their canonical names from conda_tools.list_channels, in configured order. defaults and conda-forge are offered only when no channel is configured, and no Anaconda alias is folded into defaults. While the channel list loads, search and preview wait; when it fails the dialogs say so with Try again instead of falling back to fixed channels. An install link's channel is still offered and selected first.
… changes repo.anaconda.cloud filters repodata for the Anaconda account whose key the bridge sends, so a cached lookup may belong to the previous account. Main now clears the conda read cache on kilo.anaconda's account changed event through a new JobQueue.clearReadCache, which also keeps reads that started before the clear out of the cache. Settings keys package search on the account and refreshes its account-filtered reads when it changes.
A failed package search is no longer shown as 'No results': an Anaconda sign-in refusal names the refused channel and offers Sign in to Anaconda, which searches again; other failures say what went wrong with Try again. The no-results copy only says to check the spelling. The Python picker no longer starts from made-up versions: when the lookup fails it offers only Latest and shows why. An environment whose update check failed says 'Couldn't check for updates' instead of looking up to date. Each failure is reported as environment-policy-blocked (surface ui) when it is one.
Add a channelPolicies read to kilo.environments/conda over the bridge's auth.channel_policies (cached like findRepodata, cleared by writes and Anaconda account changes; older bridges report no channels). Under the package search, Create environment and Add packages say 'Your organization's package policy may hide some packages on <channel>' for selected channels with a policy. It is only a 'may', never waits before results, and stays out of the channel chooser.
…ailure The Add packages footer error, the clone, remove and bulk-remove dialogs and the install link's check step now show the blocked packages, the policy note and Sign in to Anaconda under their message (a sign-in in a removal dialog retries the removal). Job failure toasts show a one-line summary and a Details action that opens the full explanation. A removal refused while signed out asks to sign in to change the environment, a failed clone or backup is no longer called a dependency conflict, and Import from file notes that the file's own channels and its pip: section are not covered by the organization's policy.
…ount changes Cover the account key and the refresh of account-filtered reads, which also found channelPolicies missing from them. Invalidate them in parallel rather than one after another.
…ror-handling-and-n' into kilo/policy-settings-states # Conflicts: # plugins/environments/src/web/providers/conda/CreateEnvironmentDialog.tsx # plugins/environments/src/web/providers/conda/environments-toasts.tsx
…ror-handling-and-n' into kilo/policy-settings-states
…ror-handling-and-n' into kilo/policy-settings-states # Conflicts: # plugins/environments/src/web/providers/conda/PolicyErrorDetails.tsx
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #163 (policy error codes and the 0.1.23 bridge payload). Review that first; this PR's base is its branch.
What and why
Settings → Conda Environments explained policy and Anaconda sign-in failures badly: a refused search looked like "No results… check the spelling or choose other channels", the Python picker kept made-up versions, a failed update check looked like "up to date", and most dialogs and toasts showed one generic line. The channel chooser also always added
conda-forgeanddefaults, so a person whose org configured only policy channels still got an unfilteredconda-forge, and configured channels showed up as raw per-subdir URLs.This PR, all in kilo.environments:
prefixOptions().channelsnow comes fromconda_tools.list_channels(canonical names, in configured order) instead ofconda.info's per-subdir URLs. Create environment and Add packages offer exactly those channels, all selected;defaultsandconda-forgeare offered only when no channel is configured. No Anaconda alias is folded intodefaultsany more (isAnacondaChannelis presentation only). While the list loads, search and preview wait; if it fails, the dialogs say so with "Try again" and never fall back to fixed channels. An install link's channel is still offered and selected first.NOT_SIGNED_IN/CHANNEL_ACCESS_DENIEDshow a "Sign in to Anaconda" state naming the refused channel (signing in searches again); other failures show the message with "Try again". The no-results copy only says "Check the spelling."PolicyErrorDetailsunder the message. Signing in from a removal dialog retries the removal.pip:section are not covered by the org's policy.environment-policy-blocked(surface: "ui"), once per shown failure. The footer error skips it because its toast already reports it.kilo.environments/conda.channelPoliciesread over the bridge'sauth.channel_policies. It is cached likefindRepodata,allowMissingMethodkeeps older bridges silent, and it is not an agent tool. Under the search it says "Your organization's package policy may hide some packages on ." It is only a "may", never holds results, and stays out of the chooser.JobQueue.clearReadCache(provider?)drops cached reads and, like a write, keeps reads already in flight out of the cache. Main calls it onkilo.anaconda/account'schanged. Settings keys package search on the account and refreshes its account-filtered reads when the account changes.Docs:
docs/plugins/schema.md(new method), open follow-ups indocs/plugin-architecture.md, anddocs/security-architecture-overview.md1.6 (the bridge's policy lookups use the same key).Behaviour change (release note)
Settings → Conda Environments now offers only the conda channels you have configured.
conda-forgeand Anaconda'sdefaultsare no longer added automatically, except when no channel is configured at all. To search or install from another channel, add it to your conda channels.Deviations from the plan
["defaults", "conda-forge"](Anaconda's vetted channel wins), rather than the plan's["conda-forge", "defaults"].Tests
pnpm lint(oxlint, boundaries, schema doc, React Compiler) andpnpm format:checkpass.pnpm checkpasses for all 28 packages.pnpm --filter @kilo-desktop/plugin-environments coveragepasses: 46 files and 1010 tests across unit, integration and browser. Coverage: statements 96.2%, branches 87.9%, functions 92.4%, lines 97.2%.selectableChannels(empty fallback,["defaults"],["conda-forge","bioconda"], org channels only, aliases kept);SidecarCondaBackendprefixOptionsfromlist_channels, andchannelPoliciesmapping plus the missing-method fallback;JobQueue.clearReadCache(per provider, all, in-flight read not cached); friendly copy for remove and clone; the backup toast using clone copy.entry.test.ts). Integration: thechannelPoliciesread caching.useChannelSelectionloading, empty, failed and link-first. AddPackage and Create request only configured channels, and a failed channel list holds the search until "Try again". Also covered:Live checks still to do (payload 0.1.23,
environments-featureon, an API key scoped to a policy org)channels: [defaults]on repo.anaconda.cloud, the chooser shows only "Anaconda Main" (noconda-forge, no raw subdir URLs), and a version the policy blocks (e.g.pillow8.4.0) is not offered.channelsin any condarc, the chooser showsconda-forgeanddefaults, both preselected.channels: [conda-forge, bioconda], it shows exactly those two.defaultsselected, the blocked version is missing from the version menu, and an install link for it shows the policy card in its preview.conda-forge.