Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdc51a8f2a | ||
|
|
2303aa2c7e | ||
|
|
807d9bf839 | ||
|
|
bb056c511d | ||
|
|
2539950cd5 | ||
|
|
a85242db1a | ||
|
|
567142901f | ||
|
|
e15d1637b0 | ||
|
|
11a643777b | ||
|
|
957343c07b | ||
|
|
b0b5d5e25c | ||
|
|
f21329b1f8 | ||
|
|
38e0226878 | ||
|
|
39be719b22 | ||
|
|
61e5e26c4e | ||
|
|
cfa5b4e1be | ||
|
|
9f9efbba79 | ||
|
|
c9128e479e | ||
|
|
ab16742989 | ||
|
|
ccae96dbeb | ||
|
|
efee3ca8d9 |
No files matched your search
@@ -45,6 +45,15 @@ ignore = [
|
||||
"RUSTSEC-2026-0371", # zbus_names — unmaintained, merged into zbus 6
|
||||
"RUSTSEC-2026-0372", # zvariant_derive — unmaintained, merged into zbus 6
|
||||
|
||||
# --- chrono, listed and never compiled ----------------------------------
|
||||
# Cargo.lock names chrono only because serde_with 3.24's `std` feature carries the weak
|
||||
# features `chrono_0_4?/clock` and `chrono_0_4?/std`, and Cargo's lock resolution records an
|
||||
# optional dependency that a weak feature mentions even when nothing enables it. serde_with
|
||||
# comes in through tauri-utils; `cargo tree -i chrono --target all` prints nothing, so no
|
||||
# target — the shipped Windows one included — compiles it. PipDock's own dates are jiff, the
|
||||
# advisory's first recommendation. Delete this line when Cargo.lock stops listing chrono.
|
||||
"RUSTSEC-2026-0543", # chrono — unmaintained
|
||||
|
||||
# --- unic-* Unicode tables ----------------------------------------------
|
||||
# Superseded upstream but functionally frozen data tables, reached transitively. Nothing here
|
||||
# parses untrusted input on PipDock's behalf.
|
||||
|
||||
@@ -9,6 +9,10 @@ body:
|
||||
Thanks for the report! If you came here from the in-app **Report bug** button, most fields
|
||||
are prefilled and the full log was copied to your clipboard — paste it below if asked.
|
||||
Vui lòng viết bằng English hoặc Tiếng Việt đều được.
|
||||
|
||||
PipDock is in **maintenance mode**: bugs, UI/UX defects and accessibility barriers are
|
||||
exactly what it is maintained for. A feature request filed here is closed automatically —
|
||||
see CONTRIBUTING.md, "Scope in maintenance mode".
|
||||
- type: input
|
||||
id: pd-version
|
||||
attributes:
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
blank_issues_enabled: false
|
||||
|
||||
contact_links:
|
||||
- name: Feature request — not accepted during maintenance
|
||||
url: https://github.com/poli0981org/pipdock/blob/main/CONTRIBUTING.md#scope-in-maintenance-mode
|
||||
about: Since 1.6.0 PipDock takes fixes, not features. An issue or pull request asking for one is closed automatically; this explains what is accepted, and where to argue that something is truly necessary.
|
||||
- name: Question or idea
|
||||
url: https://github.com/poli0981/pipdock/discussions
|
||||
about: Ask about usage, propose a feature, or share a workflow.
|
||||
url: https://github.com/poli0981org/pipdock/discussions
|
||||
about: Ask about usage or share a workflow. Ideas are welcome to discuss, but during maintenance they are not on a roadmap.
|
||||
- name: Security vulnerability
|
||||
url: https://github.com/poli0981/pipdock/security/advisories/new
|
||||
url: https://github.com/poli0981org/pipdock/security/advisories/new
|
||||
about: Report privately via GitHub Security Advisories. Please do not open a public issue.
|
||||
@@ -0,0 +1,52 @@
|
||||
name: Wording or translation problem
|
||||
description: Text in PipDock that is wrong, misleading, misspelt, or reads badly in English or Vietnamese — Câu chữ hoặc bản dịch sai, gây hiểu nhầm, sai chính tả hay không tự nhiên
|
||||
title: "[Wording]: "
|
||||
labels: ["i18n", "triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
PipDock is in maintenance mode, and fixing words is part of it: a sentence that misleads, a
|
||||
spelling mistake that changes the meaning, or a translation that does not sound like
|
||||
Vietnamese as people speak it is a bug worth a report. Quote the text exactly as it
|
||||
appears — that is how it is found in the catalogues.
|
||||
|
||||
PipDock đang ở giai đoạn bảo trì, và sửa câu chữ là một phần việc đó: một câu dễ gây hiểu
|
||||
nhầm, lỗi chính tả làm sai nghĩa, hay bản dịch không giống cách người Việt vẫn nói đều đáng
|
||||
được báo. Hãy chép nguyên văn đoạn chữ như nó hiện trên màn hình.
|
||||
- type: dropdown
|
||||
id: language
|
||||
attributes:
|
||||
label: Which language? / Ngôn ngữ nào?
|
||||
options:
|
||||
- "English"
|
||||
- "Tiếng Việt"
|
||||
- "Both / Cả hai"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: current
|
||||
attributes:
|
||||
label: The text as it is now / Đoạn chữ hiện tại
|
||||
description: Exactly as it appears, and where — the screen, the dialog, or the CLI command.
|
||||
placeholder: "Environments → the button beside Rescan: \"…\""
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: problem
|
||||
attributes:
|
||||
label: What is wrong with it / Vấn đề là gì
|
||||
description: Misleading, wrong, misspelt, unnatural — and, if it misleads, what you understood from it.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: suggestion
|
||||
attributes:
|
||||
label: A better wording, if you have one / Cách viết tốt hơn, nếu có
|
||||
- type: input
|
||||
id: pd-version
|
||||
attributes:
|
||||
label: PipDock version
|
||||
placeholder: "x.y.z — shown under About → This build"
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,8 +1,21 @@
|
||||
<!--
|
||||
One pull request is one slice: a single thing, taken deep, with its tests. CONTRIBUTING.md has the
|
||||
details. Delete the sections that do not apply.
|
||||
|
||||
PipDock is in maintenance mode (CONTRIBUTING.md, "Scope in maintenance mode"): a pull request that
|
||||
adds a feature is closed automatically, and so is one titled `feat:`.
|
||||
-->
|
||||
|
||||
## What kind of change
|
||||
|
||||
- [ ] A bug fix
|
||||
- [ ] A UI/UX defect
|
||||
- [ ] An accessibility barrier
|
||||
- [ ] Wording or a translation (English or Vietnamese)
|
||||
- [ ] A dependency, runtime or toolchain update
|
||||
- [ ] A security fix
|
||||
- [ ] Documentation
|
||||
|
||||
## What this changes
|
||||
|
||||
<!-- What a user or a script would notice, and why. Link the issue or the docs/ROADMAP.md entry. -->
|
||||
|
||||
+2
-2
@@ -4,13 +4,13 @@
|
||||
|
||||
The latest release gets fixes. The previous minor gets security-only patches for 90 days. There is
|
||||
no update channel — PipDock does not update itself, so a fix reaches you when you download the new
|
||||
build from [Releases](https://github.com/poli0981/pipdock/releases).
|
||||
build from [Releases](https://github.com/poli0981org/pipdock/releases).
|
||||
|
||||
## Reporting a vulnerability
|
||||
|
||||
**Do not open a public issue.** Use either:
|
||||
|
||||
- [GitHub Security Advisories](https://github.com/poli0981/pipdock/security/advisories/new) — preferred
|
||||
- [GitHub Security Advisories](https://github.com/poli0981org/pipdock/security/advisories/new) — preferred
|
||||
- `code@poli0981.dev`
|
||||
|
||||
Target acknowledgment is 7 days. Coordinated disclosure is preferred; tell us if you have a
|
||||
|
||||
+19
-8
@@ -1,8 +1,7 @@
|
||||
# Dependency updates — docs/RELEASE-CI.md §2.
|
||||
#
|
||||
# Dependabot, not Renovate: there is no Renovate configuration anywhere in the poli0981/.github
|
||||
# ops repo, and that repo ships a dependabot-summary.yml, which makes Dependabot the portfolio
|
||||
# standard.
|
||||
# Dependabot, not Renovate: Dependabot was the standard of the owner's ops repo when the CI was
|
||||
# set up, and it still is across the poli0981org organization.
|
||||
#
|
||||
# Weekly grouped PRs per ecosystem, with Code Health's pins kept apart so a tool bump is reviewed
|
||||
# on its own. Security advisories bypass grouping and schedule — that is Dependabot's default for
|
||||
@@ -19,6 +18,13 @@
|
||||
# its Tauri packages into one PR, and ci-node.yml's `tauri lockstep` job fails either PR until its
|
||||
# counterpart is merged beside it.
|
||||
#
|
||||
# **A group's position decides nothing.** Dependabot gives a dependency to the *most specific*
|
||||
# group that matches it, and a group with `update-types` counts as more specific than one with
|
||||
# patterns alone: on 2026-11-21 its log read "Skipping tauri-plugin-dialog for group 'tauri' -
|
||||
# belongs to more specific group 'cargo-minor-patch'", and every Tauri bump of that week (#116,
|
||||
# #118) landed in the catch-all groups. This file said the order kept them out. What does is
|
||||
# `exclude-patterns` on each catch-all, below.
|
||||
#
|
||||
# The labels below must exist in the repository, or Dependabot opens its PRs without them.
|
||||
|
||||
version: 2
|
||||
@@ -33,16 +39,20 @@ updates:
|
||||
cooldown:
|
||||
default-days: 3
|
||||
semver-major-days: 14
|
||||
# No cargo ignores. The rfd one (`>=0.17.0`) went on 2026-11-04: src-tauri takes rfd only
|
||||
# because tauri-plugin-dialog already compiles it, and 2.8.4 moved that to rfd ^0.17, which
|
||||
# met the ignore's own condition. If tauri-plugin-dialog moves rfd again, bump both together —
|
||||
# `cargo tree -i rfd --target all` must still show one rfd.
|
||||
ignore:
|
||||
# src-tauri takes rfd only because tauri-plugin-dialog already compiles it, and 2.8.4 — the
|
||||
# newest — still requires rfd ^0.17, so rfd 0.18 alone (#112) would put a second rfd in the
|
||||
# binary. Remove this when tauri-plugin-dialog moves to rfd 0.18, and bump both together:
|
||||
# `cargo tree -i rfd --target all` must still show one rfd. (The same ignore, at 0.17, went
|
||||
# on 2026-11-04 when its own condition was met.)
|
||||
- dependency-name: rfd
|
||||
versions: ['>=0.18.0']
|
||||
groups:
|
||||
# First, so a Tauri crate never lands in the catch-all group below.
|
||||
tauri:
|
||||
patterns: ['tauri', 'tauri-*']
|
||||
cargo-minor-patch:
|
||||
update-types: [minor, patch]
|
||||
exclude-patterns: ['tauri', 'tauri-*']
|
||||
labels: [dependencies, rust]
|
||||
|
||||
- package-ecosystem: npm
|
||||
@@ -69,6 +79,7 @@ updates:
|
||||
patterns: ['vitest', '@vitest/*']
|
||||
npm-minor-patch:
|
||||
update-types: [minor, patch]
|
||||
exclude-patterns: ['@tauri-apps/*', 'vitest', '@vitest/*']
|
||||
labels: [dependencies, frontend]
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Post PipDock's release announcements and CI-failure alerts to Discord webhooks.
|
||||
|
||||
Vendored on 2026-11-21, when the repository moved to the poli0981org organization: until then the
|
||||
notifier was a reusable workflow in the owner's personal ops repo (`poli0981/.github`), which checked
|
||||
out that repo's `main` and ran *its* copy of a script like this one with PipDock's webhooks in the
|
||||
environment. A project in the organization no longer runs code another account can change, so the
|
||||
script lives here — adapted from OmniDeck's self-contained notifier.
|
||||
|
||||
Standard library only, so the workflow needs no setup step. Every input comes from environment
|
||||
variables set by `notify.yml`, never from `${{ }}` interpolated into a shell:
|
||||
|
||||
release GITHUB_REPOSITORY, GH_TOKEN, TAG, DISCORD_WEBHOOK, DISCORD_WEBHOOK_EXTRA (optional)
|
||||
failure GITHUB_REPOSITORY, WORKFLOW_NAME, RUN_URL, BRANCH, COMMIT_SHA, COMMIT_MESSAGE, ACTOR,
|
||||
EVENT, DISCORD_WEBHOOK
|
||||
|
||||
A missing webhook (a fork, or a secret not set) is a notice, not a failure. DRY_RUN=1 prints the
|
||||
payload instead of posting it, which is how the script is checked without telling Discord anything.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import urllib.error
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
|
||||
COLOR_RELEASE = 0x57F287 # green
|
||||
COLOR_PRERELEASE = 0xFEE75C # yellow
|
||||
COLOR_FAILURE = 0xED4245 # red
|
||||
|
||||
# Discord's edge rejects Python's default user agent.
|
||||
USER_AGENT = "PipDock-notify (+https://github.com/poli0981org/pipdock)"
|
||||
|
||||
# The release's downloads, in the order a reader wants them: the installer most people need, the
|
||||
# MSI for managed deployment, and the checksums both are verified against.
|
||||
ASSET_SUFFIXES = ("_x64-setup.exe", "_x64_en-US.msi", "SHA256SUMS.txt")
|
||||
|
||||
|
||||
def env(name: str) -> str:
|
||||
return os.environ.get(name, "").strip()
|
||||
|
||||
|
||||
def truncate(text: str, limit: int) -> str:
|
||||
return text if len(text) <= limit else text[: limit - 1].rstrip() + "…"
|
||||
|
||||
|
||||
def compact(embed: dict) -> dict:
|
||||
return {key: value for key, value in embed.items() if value}
|
||||
|
||||
|
||||
def get_release(repository: str, tag: str, token: str) -> dict:
|
||||
url = f"https://api.github.com/repos/{repository}/releases/tags/{urllib.parse.quote(tag, safe='')}"
|
||||
headers = {
|
||||
"Accept": "application/vnd.github+json",
|
||||
"User-Agent": USER_AGENT,
|
||||
"X-GitHub-Api-Version": "2022-11-28",
|
||||
}
|
||||
if token:
|
||||
headers["Authorization"] = f"Bearer {token}"
|
||||
with urllib.request.urlopen(urllib.request.Request(url, headers=headers), timeout=20) as response:
|
||||
return json.load(response)
|
||||
|
||||
|
||||
def downloads(assets: list[dict]) -> str:
|
||||
lines = []
|
||||
for suffix in ASSET_SUFFIXES:
|
||||
asset = next((a for a in assets if a.get("name", "").endswith(suffix)), None)
|
||||
if asset:
|
||||
lines.append(f"[{asset['name']}]({asset['browser_download_url']})")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def release_payload() -> dict:
|
||||
repository, tag = env("GITHUB_REPOSITORY"), env("TAG")
|
||||
if not tag:
|
||||
raise ValueError("TAG is empty")
|
||||
release = get_release(repository, tag, env("GH_TOKEN"))
|
||||
prerelease = bool(release.get("prerelease"))
|
||||
fields = [{"name": "Type", "value": "Pre-release" if prerelease else "Stable", "inline": True}]
|
||||
files = downloads(release.get("assets") or [])
|
||||
if files:
|
||||
fields.append({"name": "Downloads", "value": files, "inline": False})
|
||||
embed = {
|
||||
"title": f"PipDock {tag}" + (" (pre-release)" if prerelease else ""),
|
||||
"url": release.get("html_url"),
|
||||
"description": truncate(release.get("body") or "", 1500),
|
||||
"color": COLOR_PRERELEASE if prerelease else COLOR_RELEASE,
|
||||
"fields": fields,
|
||||
"footer": {"text": repository},
|
||||
"timestamp": release.get("published_at"),
|
||||
}
|
||||
return {"username": "Release Bot", "embeds": [compact(embed)]}
|
||||
|
||||
|
||||
def failure_payload() -> dict:
|
||||
repository, sha = env("GITHUB_REPOSITORY"), env("COMMIT_SHA")
|
||||
message_lines = env("COMMIT_MESSAGE").splitlines()
|
||||
commit = f"[{sha[:7]}](https://github.com/{repository}/commit/{sha})" if sha else "?"
|
||||
embed = {
|
||||
"title": f"{env('WORKFLOW_NAME') or 'Workflow'} failed: {repository}",
|
||||
"url": env("RUN_URL"),
|
||||
"description": truncate(message_lines[0], 300) if message_lines else "",
|
||||
"color": COLOR_FAILURE,
|
||||
"fields": [
|
||||
{"name": "Ref", "value": env("BRANCH") or "?", "inline": True},
|
||||
{"name": "Event", "value": env("EVENT") or "?", "inline": True},
|
||||
{"name": "Commit", "value": commit, "inline": True},
|
||||
{"name": "Actor", "value": env("ACTOR") or "?", "inline": True},
|
||||
],
|
||||
"footer": {"text": repository},
|
||||
}
|
||||
return {"username": "CI Bot", "embeds": [compact(embed)]}
|
||||
|
||||
|
||||
def post(webhook: str, payload: dict) -> None:
|
||||
request = urllib.request.Request(
|
||||
webhook,
|
||||
data=json.dumps(payload).encode("utf-8"),
|
||||
headers={"Content-Type": "application/json", "User-Agent": USER_AGENT},
|
||||
method="POST",
|
||||
)
|
||||
with urllib.request.urlopen(request, timeout=20):
|
||||
pass # urlopen raises HTTPError for any non-2xx answer
|
||||
|
||||
|
||||
def webhooks(kind: str) -> list[str]:
|
||||
hooks = [env("DISCORD_WEBHOOK")]
|
||||
if kind == "release":
|
||||
# The releases channel and the repository's own channel both hear about a release, as they
|
||||
# did under the ops-repo announcer.
|
||||
hooks.append(env("DISCORD_WEBHOOK_EXTRA"))
|
||||
return [hook for hook in hooks if hook]
|
||||
|
||||
|
||||
def main(argv: list[str]) -> int:
|
||||
if len(argv) != 2 or argv[1] not in ("release", "failure"):
|
||||
print("usage: discord_notify.py release|failure", file=sys.stderr)
|
||||
return 2
|
||||
kind = argv[1]
|
||||
targets = webhooks(kind)
|
||||
dry_run = env("DRY_RUN") == "1"
|
||||
if not targets and not dry_run:
|
||||
print("::notice::No Discord webhook is available to this run; nothing was posted.")
|
||||
return 0
|
||||
try:
|
||||
payload = release_payload() if kind == "release" else failure_payload()
|
||||
if dry_run:
|
||||
print(json.dumps(payload, indent=2, ensure_ascii=False))
|
||||
return 0
|
||||
for target in targets:
|
||||
post(target, payload)
|
||||
except (urllib.error.URLError, ValueError, KeyError) as error:
|
||||
# Never print a webhook URL: it is a secret.
|
||||
print(f"::error::Discord {kind} notification failed: {error}")
|
||||
return 1
|
||||
print(f"Posted the {kind} notification to {len(targets)} Discord webhook(s).")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -0,0 +1,154 @@
|
||||
/**
|
||||
* Maintenance-mode triage — run by .github/workflows/triage.yml through actions/github-script.
|
||||
*
|
||||
* Since 1.6.0 PipDock takes bug fixes, UI/UX and accessibility problems, wording and translation
|
||||
* fixes, and dependency and security updates, and no new features (CONTRIBUTING.md, "Scope in
|
||||
* maintenance mode"). A feature request is labelled `enhancement` and `out-of-scope`, answered in
|
||||
* English and Vietnamese, and closed as not planned.
|
||||
*
|
||||
* **Only on signals that cannot be a bug report**, because closing a real report would be worse
|
||||
* than leaving a request open: a title that says it is a feature (`[Feature]`, `Feature request:`,
|
||||
* `[Tính năng]` …), a pull request titled with the Conventional Commits `feat` type the repository
|
||||
* uses, or the `enhancement` label being put on. Words in a body decide nothing.
|
||||
*
|
||||
* **Never** for the owner, members and collaborators, for bots (Dependabot), or for anything
|
||||
* labelled `policy-exception` — the maintainer's way of keeping open a feature judged truly
|
||||
* necessary, which the policy allows.
|
||||
*
|
||||
* `classify` is pure and tested with `node --test` (triage.test.cjs); `run` is the thin part that
|
||||
* talks to GitHub.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const MAINTAINERS = new Set(['OWNER', 'MEMBER', 'COLLABORATOR'])
|
||||
const EXEMPT = 'policy-exception'
|
||||
const FEATURE_LABEL = 'enhancement'
|
||||
const OUT_OF_SCOPE = 'out-of-scope'
|
||||
const POLICY_URL =
|
||||
'https://github.com/poli0981org/pipdock/blob/main/CONTRIBUTING.md#scope-in-maintenance-mode'
|
||||
const IDEAS_URL = 'https://github.com/poli0981org/pipdock/discussions/categories/ideas'
|
||||
|
||||
/** `[Feature] …`, `[Feature request]: …`, `Feature request: …`, `[Tính năng] …`, `Đề xuất tính năng: …`. */
|
||||
const FEATURE_TITLE =
|
||||
/^\s*(?:\[\s*(?:feature(?:\s+request)?|enhancement|request|tính năng|đề xuất(?:\s+tính năng)?)\s*\]|(?:feature\s+request|feature|enhancement|đề xuất tính năng|tính năng mới)\s*:)/iu
|
||||
|
||||
/** `feat: …`, `feat(ui): …`, `feat!: …` — the Conventional Commits type this repository uses. */
|
||||
const FEAT_COMMIT = /^\s*feat(?:\([^)]*\))?!?:/i
|
||||
|
||||
/**
|
||||
* Whether an issue or pull request is a feature request this policy closes.
|
||||
*
|
||||
* @param {object} item
|
||||
* @param {'issue'|'pull_request'} item.kind
|
||||
* @param {string} item.title
|
||||
* @param {string[]} item.labels Names of the labels it carries now.
|
||||
* @param {string} item.association The author's `author_association`.
|
||||
* @param {boolean} item.authorIsBot
|
||||
* @param {string} item.state `open` or `closed`.
|
||||
* @param {string|null} item.addedLabel The label a `labeled` event put on, else null.
|
||||
* @returns {{close: boolean, reason: string}}
|
||||
*/
|
||||
function classify(item) {
|
||||
if (item.state !== 'open') return { close: false, reason: 'not open' }
|
||||
if (item.authorIsBot) return { close: false, reason: 'opened by a bot' }
|
||||
if (MAINTAINERS.has(item.association)) return { close: false, reason: 'opened by a maintainer' }
|
||||
if (item.labels.includes(EXEMPT)) return { close: false, reason: `labelled ${EXEMPT}` }
|
||||
if (item.labels.includes(OUT_OF_SCOPE)) return { close: false, reason: 'already handled' }
|
||||
|
||||
if (item.addedLabel === FEATURE_LABEL) return { close: true, reason: `labelled ${FEATURE_LABEL}` }
|
||||
if (item.addedLabel !== null) return { close: false, reason: `labelled ${item.addedLabel}` }
|
||||
if (item.kind === 'pull_request' && FEAT_COMMIT.test(item.title)) {
|
||||
return { close: true, reason: 'a feat: pull request' }
|
||||
}
|
||||
if (FEATURE_TITLE.test(item.title)) return { close: true, reason: 'titled as a feature request' }
|
||||
return { close: false, reason: 'not a feature request' }
|
||||
}
|
||||
|
||||
/** The answer left on a closed request, in both of the project's languages. */
|
||||
function comment(kind) {
|
||||
const what = kind === 'pull_request' ? 'pull request' : 'issue'
|
||||
const whatVi = kind === 'pull_request' ? 'Pull request' : 'Issue'
|
||||
return [
|
||||
'Thanks for taking the time to write this.',
|
||||
'',
|
||||
`PipDock has been in **maintenance mode** since 1.6.0: it takes bug fixes, UI/UX and accessibility problems, wording and translation fixes, and dependency and security updates — and no new features. This ${what} reads as a feature request, so it has been labelled \`${OUT_OF_SCOPE}\` and closed. [CONTRIBUTING.md](${POLICY_URL}) says what is accepted and why.`,
|
||||
'',
|
||||
`If it is really a bug or a barrier, say so in a comment and it will be looked at again. If you believe the feature is truly necessary, make the case in [Discussions → Ideas](${IDEAS_URL}).`,
|
||||
'',
|
||||
'---',
|
||||
'',
|
||||
`Cảm ơn bạn đã dành thời gian viết. Từ bản 1.6.0, PipDock ở **giai đoạn bảo trì**: chỉ nhận sửa lỗi, lỗi UI/UX và khả năng tiếp cận, sửa câu chữ và bản dịch, cập nhật phụ thuộc và bảo mật — không nhận tính năng mới. ${whatVi} này là một đề xuất tính năng, nên đã được gắn nhãn \`${OUT_OF_SCOPE}\` và đóng lại. Nếu đây thật ra là lỗi, hãy bình luận để được xem lại; nếu bạn tin tính năng này thật sự cần thiết, hãy trình bày ở [Discussions → Ideas](${IDEAS_URL}).`,
|
||||
].join('\n')
|
||||
}
|
||||
|
||||
/** The item an `issues` or `pull_request_target` event is about, in `classify`'s shape. */
|
||||
function itemOf(payload) {
|
||||
const kind = payload.pull_request ? 'pull_request' : 'issue'
|
||||
const raw = payload.pull_request ?? payload.issue
|
||||
return {
|
||||
kind,
|
||||
number: raw.number,
|
||||
title: raw.title ?? '',
|
||||
labels: (raw.labels ?? []).map((l) => l.name),
|
||||
association: raw.author_association ?? 'NONE',
|
||||
authorIsBot: raw.user?.type === 'Bot',
|
||||
state: raw.state,
|
||||
addedLabel: payload.action === 'labeled' ? (payload.label?.name ?? null) : null,
|
||||
}
|
||||
}
|
||||
|
||||
/** Entry point for actions/github-script. */
|
||||
async function run({ github, context, core }) {
|
||||
if (context.eventName === 'workflow_dispatch') {
|
||||
// A dry run: classify what the inputs describe and say so. Nothing is touched.
|
||||
const inputs = context.payload.inputs ?? {}
|
||||
const item = {
|
||||
kind: inputs.kind === 'pull_request' ? 'pull_request' : 'issue',
|
||||
title: inputs.title ?? '',
|
||||
labels: (inputs.labels ?? '').split(',').map((s) => s.trim()).filter(Boolean),
|
||||
association: inputs.association ?? 'NONE',
|
||||
authorIsBot: false,
|
||||
state: 'open',
|
||||
addedLabel: null,
|
||||
}
|
||||
const verdict = classify(item)
|
||||
core.notice(`${verdict.close ? 'would close' : 'would leave open'}: ${verdict.reason}`)
|
||||
core.summary.addRaw(`**${verdict.close ? 'Would close' : 'Would leave open'}** — ${verdict.reason}`)
|
||||
await core.summary.write()
|
||||
return verdict
|
||||
}
|
||||
|
||||
const item = itemOf(context.payload)
|
||||
const verdict = classify(item)
|
||||
core.info(`#${item.number}: ${verdict.close ? 'closing' : 'leaving open'} — ${verdict.reason}`)
|
||||
if (!verdict.close) return verdict
|
||||
|
||||
const { owner, repo } = context.repo
|
||||
await github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: item.number,
|
||||
labels: [FEATURE_LABEL, OUT_OF_SCOPE],
|
||||
})
|
||||
await github.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: item.number,
|
||||
body: comment(item.kind),
|
||||
})
|
||||
if (item.kind === 'pull_request') {
|
||||
await github.rest.pulls.update({ owner, repo, pull_number: item.number, state: 'closed' })
|
||||
} else {
|
||||
await github.rest.issues.update({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: item.number,
|
||||
state: 'closed',
|
||||
state_reason: 'not_planned',
|
||||
})
|
||||
}
|
||||
return verdict
|
||||
}
|
||||
|
||||
module.exports = { classify, comment, itemOf, run, FEATURE_TITLE, FEAT_COMMIT }
|
||||
@@ -0,0 +1,129 @@
|
||||
// `node --test .github/scripts/*.test.cjs` — Node's built-in runner, as for scripts/*.test.mjs.
|
||||
|
||||
'use strict'
|
||||
|
||||
const assert = require('node:assert/strict')
|
||||
const { test } = require('node:test')
|
||||
|
||||
const { classify, comment, itemOf } = require('./triage.cjs')
|
||||
|
||||
const base = {
|
||||
kind: 'issue',
|
||||
title: '',
|
||||
labels: [],
|
||||
association: 'NONE',
|
||||
authorIsBot: false,
|
||||
state: 'open',
|
||||
addedLabel: null,
|
||||
}
|
||||
const item = (over) => ({ ...base, ...over })
|
||||
|
||||
test('a title that says it is a feature request is closed, in either language', () => {
|
||||
for (const title of [
|
||||
'[Feature] Dark/light theme toggle',
|
||||
'[Feature request]: conda support',
|
||||
'[Enhancement] faster search',
|
||||
'[Request] macOS build',
|
||||
'Feature request: export to Poetry',
|
||||
'feature: portable mode',
|
||||
'[Tính năng] Hỗ trợ conda',
|
||||
'[Đề xuất tính năng] chế độ portable',
|
||||
'Đề xuất tính năng: giao diện sáng',
|
||||
]) {
|
||||
assert.equal(classify(item({ title })).close, true, title)
|
||||
}
|
||||
})
|
||||
|
||||
test('a bug report is never closed, whatever words it uses', () => {
|
||||
for (const title of [
|
||||
'[Bug]: crash when adding an interpreter',
|
||||
'The feature to roll back is broken',
|
||||
'Rollback feature does nothing',
|
||||
'Request timed out while searching',
|
||||
'Enhancement of the dock bay stopped working after 1.6.0',
|
||||
'[Accessibility]: Remove from list has no focus ring',
|
||||
]) {
|
||||
assert.equal(classify(item({ title })).close, false, title)
|
||||
}
|
||||
})
|
||||
|
||||
test('a pull request titled feat: is closed; fix:, docs: and build(deps): are not', () => {
|
||||
for (const title of ['feat: conda envs', 'feat(ui): light theme', 'feat!: drop pip']) {
|
||||
assert.equal(classify(item({ kind: 'pull_request', title })).close, true, title)
|
||||
}
|
||||
for (const title of ['fix(ui): focus ring', 'docs: typo', 'build(deps): Bump vite', 'i18n(vi): sửa lỗi chính tả']) {
|
||||
assert.equal(classify(item({ kind: 'pull_request', title })).close, false, title)
|
||||
}
|
||||
// An issue titled like a commit is a person's wording, not a commit type.
|
||||
assert.equal(classify(item({ kind: 'issue', title: 'feat: something' })).close, false)
|
||||
})
|
||||
|
||||
test('putting the enhancement label on closes it; any other label does not', () => {
|
||||
assert.equal(classify(item({ title: 'Make it faster', addedLabel: 'enhancement' })).close, true)
|
||||
// A label event is about the label: a feature title already open and now labelled `bug` was
|
||||
// let through when it was opened, and re-judging it on every label would close it late.
|
||||
assert.equal(classify(item({ title: '[Feature] x', addedLabel: 'bug' })).close, false)
|
||||
})
|
||||
|
||||
test('maintainers, bots and policy exceptions are never closed', () => {
|
||||
for (const association of ['OWNER', 'MEMBER', 'COLLABORATOR']) {
|
||||
assert.equal(classify(item({ title: '[Feature] x', association })).close, false, association)
|
||||
}
|
||||
assert.equal(classify(item({ kind: 'pull_request', title: 'feat: x', authorIsBot: true })).close, false)
|
||||
assert.equal(
|
||||
classify(item({ title: '[Feature] x', labels: ['policy-exception'], addedLabel: 'enhancement' })).close,
|
||||
false,
|
||||
)
|
||||
})
|
||||
|
||||
test('what is closed or already handled is left alone', () => {
|
||||
assert.equal(classify(item({ title: '[Feature] x', state: 'closed' })).close, false)
|
||||
assert.equal(classify(item({ title: '[Feature] x', labels: ['out-of-scope'] })).close, false)
|
||||
})
|
||||
|
||||
test('the answer is in both languages and says what kind of item it is', () => {
|
||||
const pr = comment('pull_request')
|
||||
assert.match(pr, /This pull request reads as a feature request/)
|
||||
assert.match(pr, /Pull request này/)
|
||||
assert.match(pr, /CONTRIBUTING\.md#scope-in-maintenance-mode/)
|
||||
assert.match(comment('issue'), /This issue reads as a feature request/)
|
||||
})
|
||||
|
||||
test('an event payload becomes an item, the added label included', () => {
|
||||
const fromIssue = itemOf({
|
||||
action: 'labeled',
|
||||
label: { name: 'enhancement' },
|
||||
issue: {
|
||||
number: 7,
|
||||
title: 'Make it faster',
|
||||
labels: [{ name: 'triage' }, { name: 'enhancement' }],
|
||||
author_association: 'NONE',
|
||||
user: { type: 'User' },
|
||||
state: 'open',
|
||||
},
|
||||
})
|
||||
assert.deepEqual(fromIssue, {
|
||||
kind: 'issue',
|
||||
number: 7,
|
||||
title: 'Make it faster',
|
||||
labels: ['triage', 'enhancement'],
|
||||
association: 'NONE',
|
||||
authorIsBot: false,
|
||||
state: 'open',
|
||||
addedLabel: 'enhancement',
|
||||
})
|
||||
const fromPr = itemOf({
|
||||
action: 'opened',
|
||||
pull_request: {
|
||||
number: 9,
|
||||
title: 'feat: x',
|
||||
labels: [],
|
||||
author_association: 'FIRST_TIME_CONTRIBUTOR',
|
||||
user: { type: 'User' },
|
||||
state: 'open',
|
||||
},
|
||||
})
|
||||
assert.equal(fromPr.kind, 'pull_request')
|
||||
assert.equal(fromPr.addedLabel, null)
|
||||
assert.equal(classify(fromPr).close, true)
|
||||
})
|
||||
@@ -1,28 +0,0 @@
|
||||
# Caller into the ops repo's Discord announcer.
|
||||
#
|
||||
# docs/RELEASE-CI.md §1 originally described a `notify.yml` cross-posting to six platforms; the
|
||||
# ops repo has no such workflow. Announcements are Discord-only, via
|
||||
# poli0981/.github/.github/scripts/discord_notify.py.
|
||||
|
||||
name: Announce Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Tag to announce (for re-runs)
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
announce:
|
||||
uses: poli0981/.github/.github/workflows/announce-release.yml@main
|
||||
with:
|
||||
tag_override: ${{ inputs.tag || '' }}
|
||||
secrets: inherit
|
||||
@@ -81,12 +81,12 @@ jobs:
|
||||
python: ['3.10', '3.14']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v7
|
||||
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
shell: pwsh
|
||||
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v6
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
@@ -400,7 +400,7 @@ jobs:
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -408,7 +408,7 @@ jobs:
|
||||
# Python 3.12.x environment", so a floating `3.12` turns every runner-image Python bump into
|
||||
# a fixture diff that says nothing about pip or uv. Bump it deliberately, and re-capture.
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v7
|
||||
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
||||
with:
|
||||
python-version: '3.12.10'
|
||||
|
||||
@@ -429,7 +429,7 @@ jobs:
|
||||
# (another interpreter, another network, another day's index).
|
||||
- name: Upload the captured fixtures
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: captured-fixtures
|
||||
path: |
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
# Caller into the ops repo's React reusable, plus local jobs.
|
||||
# The frontend's checks, all project-local.
|
||||
#
|
||||
# The reusable runs Node 24, `npm ci`, then lint / typecheck / test when the matching npm script
|
||||
# exists, then the build. It has no `npm audit` step, so that gate lives here — see
|
||||
# docs/RELEASE-CI.md §1.
|
||||
# Until the move to poli0981org (2026-11-21) the `lint · typecheck · test · build` job was a caller
|
||||
# into the owner's personal ops repo — `poli0981/.github`'s reusable-web-react.yml, at `@main`,
|
||||
# unpinned. A project in the organization no longer runs a workflow another account can change, so
|
||||
# the job's steps live here, pinned like every other action in this repository. Two things went
|
||||
# with the reusable: the `pages: write` and `id-token: write` grants its always-skipped Pages job
|
||||
# forced on the caller, and the `dist` artifact nothing downloaded.
|
||||
#
|
||||
# It also has no working-directory input, which is why package.json sits at the repo root with
|
||||
# Vite configured `root: './ui'` (ARCHITECTURE §2).
|
||||
# package.json still sits at the repository root with Vite's `root: './ui'` (ARCHITECTURE §2). The
|
||||
# reusable's missing `working-directory` input was the original reason and is gone; SonarCloud,
|
||||
# Qodana, the scripts below and Tauri's own configuration all assume the root now.
|
||||
|
||||
name: CI / Node
|
||||
|
||||
@@ -23,22 +27,40 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
web:
|
||||
# A required check under exactly this name (RELEASE-CI.md §2): renaming it means changing the
|
||||
# branch protection payload in the same breath.
|
||||
name: lint · typecheck · test · build
|
||||
# The reusable declares a Pages-deploy job needing `pages: write` and `id-token: write`. It is
|
||||
# skipped here (`deploy-pages: false`), but permissions are validated at startup regardless of
|
||||
# `if:`, so a caller that grants less than the callee declares is rejected before it runs.
|
||||
# Granted on this job only, not the workflow: the other jobs here never need to write.
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
uses: poli0981/.github/.github/workflows/reusable-web-react.yml@main
|
||||
with:
|
||||
node-version: '26'
|
||||
package-manager: npm
|
||||
build-command: npm run build
|
||||
dist-dir: dist
|
||||
deploy-pages: false
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '26'
|
||||
cache: npm
|
||||
|
||||
# No install script runs: the only package in the lockfile that has one is fsevents, which
|
||||
# is macOS-only, and a lifecycle script is how a compromised dependency runs on the runner
|
||||
# (SonarCloud githubactions:S6505). `npm licences` and `npm audit` never needed them either.
|
||||
- name: Install
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Typecheck
|
||||
run: npm run typecheck
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
audit:
|
||||
name: npm audit
|
||||
@@ -46,12 +68,12 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v7
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '26'
|
||||
cache: npm
|
||||
@@ -63,13 +85,39 @@ jobs:
|
||||
- name: Audit
|
||||
run: npm audit --audit-level=high
|
||||
|
||||
licences:
|
||||
# The npm half of what deny.toml does for the crates: every package the production build can
|
||||
# bundle must carry a GPL-3.0-compatible licence (THIRD-PARTY-NOTICES, SECURITY §7). It reads
|
||||
# package-lock.json and installs nothing.
|
||||
name: npm licences
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '26'
|
||||
|
||||
# The repository's own CI scripts — this checker, and the maintenance-mode triage beside the
|
||||
# workflows — test themselves with Node's built-in runner, so they need no dependency either.
|
||||
- name: Test the CI scripts
|
||||
run: node --test scripts/*.test.mjs .github/scripts/*.test.cjs
|
||||
|
||||
- name: Production dependencies under GPL-3.0-compatible licences
|
||||
run: node scripts/check-licenses.mjs
|
||||
|
||||
lockstep:
|
||||
name: tauri lockstep
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Project-local: the ops repo (poli0981/.github) has no reusable Rust workflow, and only its
|
||||
# desktop-csharp reusable runs on Windows. See docs/RELEASE-CI.md §1.
|
||||
# Project-local, like every workflow here since the move to poli0981org (RELEASE-CI.md §1).
|
||||
#
|
||||
# Windows runner because the environment-discovery module reads the PEP 514 registry and the `py`
|
||||
# launcher — a Linux run would skip exactly the code most likely to break.
|
||||
@@ -29,7 +28,7 @@ jobs:
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -41,7 +40,7 @@ jobs:
|
||||
cargo --version
|
||||
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v6
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
@@ -70,7 +69,7 @@ jobs:
|
||||
RUSTUP_TOOLCHAIN: stable
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -78,7 +77,7 @@ jobs:
|
||||
# on Node 20, needed a check-run write token, and on a pull request failed only on
|
||||
# "critical" — so the advisories that turned `main` red in September passed every PR.
|
||||
- name: Install cargo-audit
|
||||
uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2.89.1
|
||||
uses: taiki-e/install-action@4a76afe23f9e08d2d9550fb56e556444e8611d21 # v2.90.4
|
||||
with:
|
||||
tool: cargo-audit
|
||||
|
||||
@@ -96,12 +95,12 @@ jobs:
|
||||
RUSTUP_TOOLCHAIN: stable
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install cargo-deny
|
||||
uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2.89.1
|
||||
uses: taiki-e/install-action@4a76afe23f9e08d2d9550fb56e556444e8611d21 # v2.90.4
|
||||
with:
|
||||
tool: cargo-deny
|
||||
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
# Caller into the ops repo's CodeQL reusable.
|
||||
# CodeQL, project-local since the move to poli0981org (2026-11-21).
|
||||
#
|
||||
# Three languages. **Rust** — CodeQL analyses it without a build (`build-mode: none`, which the
|
||||
# reusable passes for every language outside its autobuild list); this file said for six releases
|
||||
# that CodeQL had no Rust support, which stopped being true in 2025. **Actions** — the workflows
|
||||
# themselves: the class of mistake SonarCloud kept finding by hand (write permissions at workflow
|
||||
# level, unpinned third-party actions). **JavaScript/TypeScript** — the frontend, and the one
|
||||
# whose check name `main`'s protection requires, so it keeps its exact name.
|
||||
# It was a caller into the owner's personal ops repo (`poli0981/.github`'s reusable-codeql.yml, at
|
||||
# `@main`), whose steps used `github/codeql-action@v4` by tag. The same analysis runs here with the
|
||||
# action pinned by commit, and the write permission on the one job that uploads.
|
||||
#
|
||||
# The reusable notes that repo Settings → Advanced Security → CodeQL "Default setup" must be
|
||||
# DISABLED, or this advanced-setup workflow is rejected at upload time.
|
||||
# Three languages, all `build-mode: none`. **Rust** — CodeQL analyses it without a build; this
|
||||
# file said for six releases that CodeQL had no Rust support, which stopped being true in 2025.
|
||||
# **Actions** — the workflows themselves: write permissions at workflow level, unpinned
|
||||
# third-party actions, untrusted input in a `run:`. **JavaScript/TypeScript** — the frontend, and
|
||||
# a required check under exactly the name `Analyze (javascript-typescript)` (RELEASE-CI.md §2).
|
||||
# The `category` values are the reusable's, so existing alerts keep their history.
|
||||
#
|
||||
# Settings → Advanced Security → CodeQL "Default setup" must stay disabled, or this advanced
|
||||
# setup is rejected at upload time.
|
||||
|
||||
name: CodeQL
|
||||
|
||||
@@ -20,18 +24,36 @@ on:
|
||||
# Weekly, offset off the hour to avoid the top-of-hour scheduling pileup.
|
||||
- cron: '37 4 * * 1'
|
||||
|
||||
# A caller cannot grant a called workflow less than its jobs declare, or the run is rejected before
|
||||
# it starts. reusable-codeql.yml's analyze job asks for `packages: read` to fetch internal CodeQL
|
||||
# packs, so omitting it here produced a startup_failure with no logs to explain it — the same
|
||||
# permissions trap RELEASE-CI.md §1 records, from the other direction.
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
packages: read
|
||||
security-events: write
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
uses: poli0981/.github/.github/workflows/reusable-codeql.yml@main
|
||||
with:
|
||||
languages: '["javascript-typescript", "rust", "actions"]'
|
||||
name: Analyze (${{ matrix.language }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
packages: read # CodeQL's own query packs
|
||||
security-events: write # upload the results
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [javascript-typescript, rust, actions]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: none
|
||||
|
||||
- name: Perform CodeQL analysis
|
||||
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
||||
with:
|
||||
category: /language:${{ matrix.language }}
|
||||
@@ -1,30 +0,0 @@
|
||||
# Caller into the ops repo's Discord CI-failure notifier.
|
||||
#
|
||||
# **Listed by name.** `workflows: ['*']`, which the ops repo's own example suggests, is not a
|
||||
# wildcard to `workflow_run`: it matched nothing, so `main` stayed red from 2026-09-23 with every
|
||||
# failure unreported — the only runs this ever saw were Dependabot's. Adding a workflow means
|
||||
# adding its `name:` here, exactly.
|
||||
#
|
||||
# CodeQL and Release are deliberately absent: the reusable skips workflows with dedicated
|
||||
# notifiers by name ('odeQL', 'elease', …), so listing them would only create skipped runs.
|
||||
|
||||
name: Notify CI Failure
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- CI / Rust
|
||||
- CI / Node
|
||||
- CI / Integration
|
||||
- Security scan
|
||||
- SonarCloud
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
uses: poli0981/.github/.github/workflows/notify-ci-failure.yml@main
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,98 @@
|
||||
# Discord notifications, self-contained in this repository since the move to poli0981org
|
||||
# (2026-11-21). They were two callers into the owner's personal ops repo, whose notifier checked
|
||||
# out *that* repo's `main` and ran its script with PipDock's webhooks in the environment; the
|
||||
# script is vendored now (.github/scripts/discord_notify.py, standard library only).
|
||||
#
|
||||
# - ci-failure: a run of a listed workflow failed outside a pull request — a push to `main`, the
|
||||
# daily or weekly schedule, a dispatch, a release tag -> DISCORD_CI_WEBHOOK. Pull-request runs
|
||||
# report on the pull request, and a fork's or Dependabot's get no secrets anyway. The filter is
|
||||
# on the event alone, never on a branch name or a login, which a fork controls. **Triage is the
|
||||
# one exception**: it runs on `pull_request_target`, against a stranger's pull request, where
|
||||
# nobody watching can fix it — and a broken triage leaves feature PRs open with nobody told. Its
|
||||
# name is safe to filter on because a `pull_request_target` run's workflow file comes from the
|
||||
# base branch, never from the fork; the failure is posted as an embed, which pings nobody.
|
||||
# - announce: a release was published, or re-announced with a dispatch -> DISCORD_RELEASES_WEBHOOK
|
||||
# and DISCORD_REPO_WEBHOOK. Publishing the draft (RELEASE-CI.md §3) is done with a person's token,
|
||||
# which does fire `release: published`; a release published with GITHUB_TOKEN would not.
|
||||
#
|
||||
# **The list is by exact `name:`.** `workflows: ['*']`, which the ops repo's own example
|
||||
# suggested, is not a wildcard to `workflow_run`: it matched nothing, and `main` was red for three
|
||||
# weeks in September with nobody told. A new workflow is added here by name. Unlike the ops-repo
|
||||
# reusable, which skipped anything named like CodeQL or Release because they had "dedicated
|
||||
# notifiers" PipDock never had, CodeQL, Qodana and Release are listed: a failed Release run used
|
||||
# to reach no channel at all.
|
||||
|
||||
name: Notify
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- CI / Rust
|
||||
- CI / Node
|
||||
- CI / Integration
|
||||
- CodeQL
|
||||
- Qodana
|
||||
- Release
|
||||
- Security scan
|
||||
- SonarCloud
|
||||
- Triage
|
||||
types: [completed]
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Release tag to announce again (e.g. v1.6.0)
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ci-failure:
|
||||
if: >-
|
||||
github.event_name == 'workflow_run' &&
|
||||
github.event.workflow_run.conclusion == 'failure' &&
|
||||
github.event.workflow_run.event != 'pull_request' &&
|
||||
(github.event.workflow_run.event != 'pull_request_target' ||
|
||||
github.event.workflow_run.name == 'Triage')
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/scripts
|
||||
|
||||
- name: Post the failure to Discord
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }}
|
||||
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
|
||||
RUN_URL: ${{ github.event.workflow_run.html_url }}
|
||||
BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||
COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
|
||||
ACTOR: ${{ github.event.workflow_run.actor.login }}
|
||||
EVENT: ${{ github.event.workflow_run.event }}
|
||||
run: python3 .github/scripts/discord_notify.py failure
|
||||
|
||||
announce:
|
||||
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/scripts
|
||||
|
||||
- name: Announce on Discord
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ github.event.release.tag_name || inputs.tag }}
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASES_WEBHOOK }}
|
||||
DISCORD_WEBHOOK_EXTRA: ${{ secrets.DISCORD_REPO_WEBHOOK }}
|
||||
run: python3 .github/scripts/discord_notify.py release
|
||||
@@ -0,0 +1,187 @@
|
||||
# JetBrains Qodana, in two parts — added 2026-11-21 with the move to poli0981org.
|
||||
#
|
||||
# **A monorepo to Qodana.** The repository holds a Rust workspace and a TypeScript frontend, and
|
||||
# Qodana Cloud has a project for each, with its own token (QODANA_TOKEN_RUST, QODANA_TOKEN_TS_JS)
|
||||
# and its own configuration (qodana-rust.yaml, qodana-js.yaml): JetBrains' layout for a monorepo.
|
||||
# The two jobs below never inspect the same file.
|
||||
#
|
||||
# **Rust runs in Docker, TypeScript natively.** qodana-rust has no native mode; it is RustRover in
|
||||
# a Linux container, so `#[cfg(windows)]` code is invisible to it — clippy, CodeQL and SonarQube
|
||||
# Cloud, all on Windows, cover that. qodana-js runs on the runner after `npm ci`, so it resolves
|
||||
# the node_modules the build does, with the Node every other workflow uses.
|
||||
#
|
||||
# **No token, no analysis**, the way sonar.yml does it: Dependabot's and a fork's pull requests get
|
||||
# no repository secrets, so their runs are skipped rather than failed.
|
||||
#
|
||||
# **No caches** (`use-caches: false`). The repository's Actions cache is near its 10 GB limit, and
|
||||
# a Qodana cache — an IDE's indexes, and Cargo's registry inside the container — would evict the
|
||||
# cargo caches the required checks restore. A run is slower for it, and it is not a required
|
||||
# check (RELEASE-CI.md §2): a failure on `main` reaches Discord through notify.yml.
|
||||
#
|
||||
# **Every run is a full scan, and only a new problem fails it.** `pr-mode` is off: a whole scan is
|
||||
# two to three minutes a part, so analysing only a pull request's files would save little and make
|
||||
# a result depend on which files happened to change. `.qodana/rust.sarif.json` is the baseline —
|
||||
# the 62 problems the first real run found, triaged on 2026-11-21 (ROADMAP: two Critical that are
|
||||
# RustRover misreading what rustc compiles, and 60 Moderate style findings), trimmed to the results
|
||||
# and their fingerprints. `--fail-threshold 0` then fails on anything outside it. The TypeScript
|
||||
# half has no baseline because it has no accepted problem: the six it found were fixed.
|
||||
#
|
||||
# **Only new problems reach Code scanning**, under `qodana-rust` and `qodana-js` — a baseline
|
||||
# problem is triaged already, and alerting on it again would bury the next real one.
|
||||
|
||||
name: Qodana
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: qodana-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
tokens:
|
||||
name: tokens present
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 2
|
||||
outputs:
|
||||
rust: ${{ steps.check.outputs.rust }}
|
||||
js: ${{ steps.check.outputs.js }}
|
||||
steps:
|
||||
# `secrets` cannot be read in an `if:`, so presence becomes an output. Only the emptiness test
|
||||
# sees the values; nothing is checked out and nothing else runs.
|
||||
- name: Check
|
||||
id: check
|
||||
env:
|
||||
RUST: ${{ secrets.QODANA_TOKEN_RUST }}
|
||||
JS: ${{ secrets.QODANA_TOKEN_TS_JS }}
|
||||
run: |
|
||||
for part in RUST JS; do
|
||||
name=$(echo "$part" | tr '[:upper:]' '[:lower:]')
|
||||
if [ -n "${!part}" ]; then
|
||||
echo "$name=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "$name=false" >> "$GITHUB_OUTPUT"
|
||||
echo "::notice::No Qodana token for the $name part in this run (a Dependabot or fork pull request); it is skipped."
|
||||
fi
|
||||
done
|
||||
|
||||
rust:
|
||||
name: qodana · rust
|
||||
needs: tokens
|
||||
if: needs.tokens.outputs.rust == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
permissions:
|
||||
contents: read
|
||||
checks: write # annotations
|
||||
pull-requests: write # the summary comment
|
||||
security-events: write # new problems to Code scanning
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
# The pull request's own head, and the history pull-request mode diffs against.
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Qodana
|
||||
uses: JetBrains/qodana-action@3e8d76ff0e0241618abd808682f426afe84bab3f # v2026.2.2
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_RUST }}
|
||||
# The container runs as the runner's user, and the image's CARGO_HOME (/usr/local/cargo)
|
||||
# belongs to root, so `cargo metadata` could not write the registry it downloads and
|
||||
# RustRover loaded no Cargo project — 0 problems from 0 files analysed. /data/cache is
|
||||
# the container's mount of the action's cache directory, which this user owns.
|
||||
CARGO_HOME: /data/cache/cargo-home
|
||||
with:
|
||||
args: --config qodana-rust.yaml --linter qodana-rust --baseline .qodana/rust.sarif.json --fail-threshold 0
|
||||
env-vars-to-linter: CARGO_HOME
|
||||
pr-mode: false
|
||||
use-caches: false
|
||||
upload-result: true
|
||||
artifact-name: qodana-rust
|
||||
|
||||
- name: Keep the problems outside the baseline
|
||||
id: filter
|
||||
if: ${{ !cancelled() }}
|
||||
env:
|
||||
SARIF: ${{ runner.temp }}/qodana/results/qodana.sarif.json
|
||||
run: |
|
||||
if [ ! -f "$SARIF" ]; then echo "::notice::The scan left no SARIF."; exit 0; fi
|
||||
jq '.runs |= map(.results |= map(select((.baselineState // "new") != "unchanged" and (.baselineState // "new") != "absent")))' \
|
||||
"$SARIF" > "$RUNNER_TEMP/qodana-rust.sarif"
|
||||
echo "ready=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload to Code scanning
|
||||
if: ${{ !cancelled() && steps.filter.outputs.ready == 'true' }}
|
||||
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
||||
with:
|
||||
sarif_file: ${{ runner.temp }}/qodana-rust.sarif
|
||||
category: qodana-rust
|
||||
|
||||
js:
|
||||
name: qodana · ts/js
|
||||
needs: tokens
|
||||
if: needs.tokens.outputs.js == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
permissions:
|
||||
contents: read
|
||||
checks: write # annotations
|
||||
pull-requests: write # the summary comment
|
||||
security-events: write # new problems to Code scanning
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '26'
|
||||
cache: npm
|
||||
|
||||
# No install script runs: the only package in the lockfile that has one is fsevents, which
|
||||
# is macOS-only, and a lifecycle script is how a compromised dependency runs on the runner
|
||||
# (SonarCloud githubactions:S6505). `npm licences` and `npm audit` never needed them either.
|
||||
- name: Install
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Qodana
|
||||
uses: JetBrains/qodana-action@3e8d76ff0e0241618abd808682f426afe84bab3f # v2026.2.2
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_TS_JS }}
|
||||
with:
|
||||
args: --config qodana-js.yaml --linter qodana-js --within-docker false --fail-threshold 0
|
||||
pr-mode: false
|
||||
use-caches: false
|
||||
upload-result: true
|
||||
artifact-name: qodana-js
|
||||
|
||||
- name: Keep the problems outside the baseline
|
||||
id: filter
|
||||
if: ${{ !cancelled() }}
|
||||
env:
|
||||
SARIF: ${{ runner.temp }}/qodana/results/qodana.sarif.json
|
||||
run: |
|
||||
if [ ! -f "$SARIF" ]; then echo "::notice::The scan left no SARIF."; exit 0; fi
|
||||
jq '.runs |= map(.results |= map(select((.baselineState // "new") != "unchanged" and (.baselineState // "new") != "absent")))' \
|
||||
"$SARIF" > "$RUNNER_TEMP/qodana-js.sarif"
|
||||
echo "ready=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload to Code scanning
|
||||
if: ${{ !cancelled() && steps.filter.outputs.ready == 'true' }}
|
||||
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
||||
with:
|
||||
sarif_file: ${{ runner.temp }}/qodana-js.sarif
|
||||
category: qodana-js
|
||||
@@ -1,8 +1,8 @@
|
||||
# Project-local: the ops repo has no reusable Tauri/build workflow (docs/RELEASE-CI.md §1).
|
||||
# Project-local, like every workflow here (RELEASE-CI.md §1).
|
||||
#
|
||||
# Builds the NSIS .exe and .msi, attests where they were built, publishes SHA256SUMS.txt and leaves
|
||||
# a DRAFT release. Publishing is a separate, human-directed step (RELEASE-CI.md §3.4), and
|
||||
# announce-release.yml fires on `release: published`.
|
||||
# notify.yml's announcement fires on `release: published`.
|
||||
#
|
||||
# **Two jobs, so the token that can write releases never runs the build.** Building executes
|
||||
# third-party code — every crate's build script, every npm package's — and gets a read-only token
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
tag: ${{ steps.version.outputs.tag }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ inputs.tag || github.ref }}
|
||||
persist-credentials: false
|
||||
@@ -92,13 +92,13 @@ jobs:
|
||||
"tag=v$v" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v7
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '26'
|
||||
cache: npm
|
||||
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v6
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
@@ -107,8 +107,12 @@ jobs:
|
||||
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-release-
|
||||
|
||||
# No install script runs: the only package in the lockfile that has one is fsevents, which
|
||||
# is macOS-only, and a lifecycle script is how a compromised dependency runs on the runner
|
||||
# (SonarCloud githubactions:S6505). The bundle does not need them: Tauri's CLI arrives as
|
||||
# an optional platform package, not a download in a postinstall.
|
||||
- name: Install frontend dependencies
|
||||
run: npm ci
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
# One script owns the recipe (`package.json` → `bundle`), so the workflow cannot drift
|
||||
# from what a developer runs locally. It stages the CLI sidecar, then bundles with the
|
||||
@@ -149,7 +153,7 @@ jobs:
|
||||
Get-Content release-artifacts\SHA256SUMS.txt
|
||||
|
||||
- name: Upload the build
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: release-artifacts
|
||||
path: release-artifacts/*
|
||||
@@ -167,15 +171,17 @@ jobs:
|
||||
attestations: write
|
||||
steps:
|
||||
- name: Download the build
|
||||
uses: actions/download-artifact@v8
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: release-artifacts
|
||||
path: release-artifacts
|
||||
|
||||
# Build provenance for the two installers: `gh attestation verify <file> --repo
|
||||
# poli0981/pipdock` proves an installer came from this workflow, at this commit — which a
|
||||
# poli0981org/pipdock` proves an installer came from this workflow, at this commit — which a
|
||||
# checksum published beside the file cannot, since whoever could replace one could replace
|
||||
# both.
|
||||
# both. An attestation stays with the account that made it: those of 1.4.0 and 1.5.0, made
|
||||
# before the repository moved to the organization, verify with `--owner poli0981
|
||||
# --signer-repo poli0981/pipdock` and no longer with any `--repo` (README, Install).
|
||||
- name: Attest provenance
|
||||
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
|
||||
with:
|
||||
@@ -184,7 +190,7 @@ jobs:
|
||||
release-artifacts/*.msi
|
||||
|
||||
- name: Draft GitHub release
|
||||
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
|
||||
uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4
|
||||
with:
|
||||
tag_name: ${{ needs.build.outputs.tag }}
|
||||
draft: true # reviewed, then published; publishing triggers the announcement
|
||||
|
||||
@@ -28,12 +28,12 @@ jobs:
|
||||
RUSTUP_TOOLCHAIN: stable
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install cargo-audit
|
||||
uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2.89.1
|
||||
uses: taiki-e/install-action@4a76afe23f9e08d2d9550fb56e556444e8611d21 # v2.90.4
|
||||
with:
|
||||
tool: cargo-audit
|
||||
|
||||
@@ -46,12 +46,12 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v7
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '26'
|
||||
cache: npm
|
||||
|
||||
@@ -74,20 +74,23 @@ jobs:
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
# Full history: new code is decided by blame, and a shallow clone has none to give.
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v7
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '26'
|
||||
cache: npm
|
||||
|
||||
# No install script runs: the only package in the lockfile that has one is fsevents, which
|
||||
# is macOS-only, and a lifecycle script is how a compromised dependency runs on the runner
|
||||
# (SonarCloud githubactions:S6505). `npm licences` and `npm audit` never needed them either.
|
||||
- name: Install frontend dependencies
|
||||
run: npm ci
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: TypeScript coverage
|
||||
run: npm run test:coverage
|
||||
@@ -96,7 +99,7 @@ jobs:
|
||||
# the instrumented build lands in target/llvm-cov-target and is rebuilt every run, because
|
||||
# saving a fourth multi-GB cargo cache would evict the three the required checks depend on.
|
||||
- name: Restore cargo cache
|
||||
uses: actions/cache/restore@v6
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
@@ -111,7 +114,7 @@ jobs:
|
||||
run: rustup component add llvm-tools-preview
|
||||
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2.89.1
|
||||
uses: taiki-e/install-action@4a76afe23f9e08d2d9550fb56e556444e8611d21 # v2.90.4
|
||||
with:
|
||||
tool: cargo-llvm-cov
|
||||
|
||||
@@ -139,7 +142,7 @@ jobs:
|
||||
"version=$v" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Scan
|
||||
uses: SonarSource/sonarqube-scan-action@e805d875275f728fac1885b413934be6d7c63f65 # v8.4.1
|
||||
uses: SonarSource/sonarqube-scan-action@59202af334b4ba7b5db01b701b8e79f8b3bef0f4 # v8.5.0
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
# Maintenance-mode triage, from 1.6.0 (CONTRIBUTING.md, "Scope in maintenance mode").
|
||||
#
|
||||
# A feature request — titled as one, a `feat:` pull request, or labelled `enhancement` — is labelled
|
||||
# `enhancement` and `out-of-scope`, answered in English and Vietnamese, and closed as not planned.
|
||||
# Never one opened by a maintainer or a bot, or labelled `policy-exception`, the maintainer's way of
|
||||
# keeping open a feature judged truly necessary. .github/scripts/triage.cjs holds the rules and says
|
||||
# why they are only ever the unmistakable ones; its tests run in ci-node.yml's `npm licences` job.
|
||||
#
|
||||
# **`pull_request_target` checks out the base branch and nothing else.** That event runs with a
|
||||
# write token even for a fork's pull request, which is the reason it is used here — a plain
|
||||
# `pull_request` from a fork gets a read-only token and could not label or close anything — and
|
||||
# exactly why nothing from the pull request is checked out or executed: the script reads the
|
||||
# event's title and labels as data.
|
||||
#
|
||||
# `workflow_dispatch` is a dry run: it classifies the title and labels it is given and touches
|
||||
# nothing, which is how the rules are tried without opening a public issue.
|
||||
|
||||
name: Triage
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, labeled]
|
||||
pull_request_target:
|
||||
types: [opened, labeled]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
kind:
|
||||
description: What to classify
|
||||
type: choice
|
||||
options: [issue, pull_request]
|
||||
default: issue
|
||||
title:
|
||||
description: Its title
|
||||
required: true
|
||||
type: string
|
||||
labels:
|
||||
description: Its labels, comma-separated
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
association:
|
||||
description: The author's association
|
||||
type: choice
|
||||
options: [NONE, CONTRIBUTOR, FIRST_TIME_CONTRIBUTOR, COLLABORATOR, MEMBER, OWNER]
|
||||
default: NONE
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
policy:
|
||||
name: maintenance policy
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write # label, comment, close
|
||||
pull-requests: write # the same on a pull request
|
||||
steps:
|
||||
- name: Checkout the base branch's scripts
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/scripts
|
||||
|
||||
- name: Apply the policy
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
script: |
|
||||
const triage = require('./.github/scripts/triage.cjs')
|
||||
await triage.run({ github, context, core })
|
||||
+3
-3
@@ -18,9 +18,9 @@ dist-ssr/
|
||||
# Environments (test venvs created by the integration suite / spikes)
|
||||
.venv/
|
||||
venv/
|
||||
# Scratch venvs for verifying by hand. Note that the GUI will only ever *see* one named exactly
|
||||
# `.venv`, `venv`, `env` or `.env` in the working directory — `envs::venv_scan` matches that fixed
|
||||
# list and `env_add_manual` (Browse…) is still owed — so a suffixed one here is CLI-only.
|
||||
# Scratch venvs for verifying by hand. Discovery only *finds* one named exactly `.venv`, `venv`,
|
||||
# `env` or `.env` in the working directory (`envs::venv_scan`'s fixed list); a suffixed one here has
|
||||
# to be added — Add interpreter… in the GUI, `pipdock env add` in the CLI.
|
||||
/.venv-*/
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+11
-5
@@ -46,7 +46,8 @@ never removed.
|
||||
| `Esc` | Close a dialog, the palette or the console drawer; inside a package row, return to the row |
|
||||
|
||||
When the screen changes — a new tab, a plan's preview, its summary, the dependency view — focus
|
||||
moves to the new screen's heading. When a dialog, the palette or the console drawer closes, focus
|
||||
moves to the new screen's heading. So it does when *Remove from list* takes away the row whose
|
||||
button you pressed (1.6.0). When a dialog, the palette or the console drawer closes, focus
|
||||
returns to what opened it. A button that is busy after you press it stays where focus is. Every
|
||||
confirmation that removes, forces or rewrites something opens with focus on **Cancel**.
|
||||
|
||||
@@ -60,6 +61,10 @@ The full map and the reasoning behind it are in [`docs/UI-SPEC.md`](docs/UI-SPEC
|
||||
- Dialogs are named by their heading and described by their body.
|
||||
- A run announces its progress ("3 of 15 complete") once, not once per output line. Search
|
||||
announces that it is searching, how many results came back, and when nothing matched.
|
||||
- On Environments, adding or removing an interpreter is said in a status line ("Added … to the
|
||||
list."). *Remove from list* is named with the path it removes, beginning with the words on the
|
||||
button. The file picker *Add interpreter…* opens is Windows' own dialog, with Windows' own
|
||||
accessibility.
|
||||
- Error messages are announced when they appear, and carry a code (`PD-XXX-000`) you can quote.
|
||||
- The interface is in English and Vietnamese, and the document language follows the one in use.
|
||||
|
||||
@@ -103,9 +108,10 @@ Honesty about this matters more than a long list.
|
||||
|
||||
**Not tested, and said so rather than implied:**
|
||||
|
||||
- **Narrator has not been run again on 1.5.0.** That release changed what a screen reader hears in
|
||||
several places (see the [changelog](changelog/1.x.md)). Those changes were checked against the
|
||||
accessibility tree, which says what is exposed — not against speech, which is what you hear.
|
||||
- **Narrator has not been run again on 1.5.0 or 1.6.0.** 1.5.0 changed what a screen reader hears
|
||||
in several places (see the [changelog](changelog/1.x.md)), and 1.6.0 added *Add interpreter…* and
|
||||
*Remove from list*. Those were checked against the accessibility tree, which says what is
|
||||
exposed — not against speech, which is what you hear.
|
||||
- **NVDA and JAWS** have not been used with PipDock at all. Reports from people who use them are
|
||||
especially welcome.
|
||||
- **Each Windows contrast theme by hand.** Forced colours were emulated; the four built-in themes
|
||||
@@ -152,7 +158,7 @@ where there is a workaround it is given.
|
||||
|
||||
Either of these reaches the same person:
|
||||
|
||||
- **[Open an accessibility issue](https://github.com/poli0981/pipdock/issues/new?template=accessibility.yml)**
|
||||
- **[Open an accessibility issue](https://github.com/poli0981org/pipdock/issues/new?template=accessibility.yml)**
|
||||
on GitHub, or
|
||||
- write to **[accessibility@poli0981.dev](mailto:accessibility@poli0981.dev)** — no account needed.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# PipDock — working notes for Claude
|
||||
|
||||
Windows GUI + CLI for bulk-managing Python packages. Tauri 2 + Rust core + React 19.
|
||||
Repo `poli0981/pipdock` · GPL-3.0-only · **Status: 1.5.0. M1, M2, Phase 3, Phase 4, the P1 wave, the Security tab and the dependency view are all complete.** 1.0.0 shipped the release pipeline, a protected `main`, the manual charter and legal documents that match the code; 1.1.0 added pin auto-suggest, requirements export/import, the cache manager and the `Ctrl+K` palette; 1.2.0 added the Security tab (PRD P1-1); 1.3.0 added the dependency view (P1-6), which is a *mode of the package screen* rather than a tab and adds no runtime dependency — read its ROADMAP record before touching `graph/`, because the shape of the screen is a consequence of measurements rather than of taste. 1.4.0 added no feature: it is the audit release — about 170 findings, every Critical and High fixed with a test that failed first, and the rest in ROADMAP's **Audit backlog**, with file:line and a reason each. Read that table before starting a slice; most of what is wrong with the codebase is already written down there. 1.5.0 added no feature either: it is the accessibility pass (backlog U45, U47, U48) — focus, names, keyboard patterns and high contrast, axe-core in the suite, and `ACCESSIBILITY.md`, which is a *record of what was tested* and has to be kept true like one. **What is left of Post-1.0 is one thing** — the scheduled check (P1-7) — and `docs/ROADMAP.md` now carries the survey of what blocks it, which for two versions it was cited for and did not contain: no toast component, no notification/autostart/tray plugin, nothing on a timer, and no surface that can report a background failure.
|
||||
Repo `poli0981org/pipdock` (moved from `poli0981/pipdock` on 2026-11-21) · GPL-3.0-only · **Status: 1.6.0, and in maintenance mode since that release.** M1, M2, Phase 3, Phase 4, the P1 wave, the Security tab and the dependency view are all complete, and 1.6.0 closed the last P0 gap, *Browse…* (`env_add_manual`). **Read ROADMAP's *Maintenance mode* section before starting anything**: dependency, security, major-upgrade, defect and wording work is taken; features are not, and `triage.yml` closes requests for them. 1.0.0 shipped the release pipeline, a protected `main`, the manual charter and legal documents that match the code; 1.1.0 added pin auto-suggest, requirements export/import, the cache manager and the `Ctrl+K` palette; 1.2.0 added the Security tab (PRD P1-1); 1.3.0 added the dependency view (P1-6), which is a *mode of the package screen* rather than a tab and adds no runtime dependency — read its ROADMAP record before touching `graph/`, because the shape of the screen is a consequence of measurements rather than of taste. 1.4.0 added no feature: it is the audit release — about 170 findings, every Critical and High fixed with a test that failed first, and the rest in ROADMAP's **Audit backlog**, with file:line and a reason each. Read that table before starting a slice; most of what is wrong with the codebase is already written down there. 1.5.0 added no feature either: it is the accessibility pass (backlog U45, U47, U48) — focus, names, keyboard patterns and high contrast, axe-core in the suite, and `ACCESSIBILITY.md`, which is a *record of what was tested* and has to be kept true like one. 1.6.0 added *Add interpreter…* (GUI) and `pipdock env add`/`env remove` (CLI) over a `manual_envs` table and `envs::validate_interpreter`, moved the repository to the poli0981org organization with CI that calls nothing outside it, and put the project in maintenance mode. **Nothing is left of Post-1.0**: the scheduled check (P1-7) was closed as not planned, for the reasons ROADMAP's survey of it gives — no toast component, no notification/autostart/tray plugin, nothing on a timer, and no surface that can report a background failure.
|
||||
|
||||
## Read the docs before changing anything
|
||||
|
||||
@@ -47,7 +47,8 @@ failed package never aborts a batch (skip-and-continue, then a `"13 successful,
|
||||
`--dry-run --report -` crashes on Windows/cp1252 (pip 25 *and* 26), data-dependently.
|
||||
8. **uv writes its plan to stderr**, so classify errors only after a plan-parse attempt.
|
||||
9. **`env_hash` lowercases the interpreter path on Windows**, or one env splits its pins and
|
||||
snapshots in two.
|
||||
snapshots in two — and since 1.6.0 stops at a venv's own `python.exe`, or a `--symlinks` venv
|
||||
files its pins and snapshots under the Python it was made from.
|
||||
10. **PipDock enforces `Requires-Python` itself** (`src/compat.rs`) — the engines disagree, and the
|
||||
preview must not depend on which one is selected.
|
||||
|
||||
@@ -64,9 +65,9 @@ failed package never aborts a batch (skip-and-continue, then a `"13 successful,
|
||||
|
||||
- Crates `pipdock-*`; React components prefixed `Pd` (`PdPackageRow`, `PdConflictRow`)
|
||||
- Tauri identifier `com.skullmute.pipdock`; CLI binary `pipdock`
|
||||
- Frontend lives in `ui/`, but `package.json` sits at the **repo root** so the ops-repo
|
||||
`reusable-web-react.yml` (which has no `working-directory` input) works unmodified; Vite is
|
||||
configured with `root: './ui'`
|
||||
- Frontend lives in `ui/`, but `package.json` sits at the **repo root** — first for the ops
|
||||
repo's reusable CI workflow, which had no `working-directory` input, and now because SonarCloud,
|
||||
Qodana, the scripts and Tauri's config all assume it; Vite is configured with `root: './ui'`
|
||||
- Rust ↔ TS types are generated by `cargo run -p xtask -- bindings` over `schemars` — never
|
||||
hand-mirror a type. (ARCHITECTURE §9 originally said `specta`/`tauri-specta`; `bindings.rs` records
|
||||
why it is not, and drift is a `cargo test` failure rather than a compile error)
|
||||
@@ -74,24 +75,45 @@ failed package never aborts a batch (skip-and-continue, then a `"13 successful,
|
||||
|
||||
## CI reality
|
||||
|
||||
`docs/RELEASE-CI.md` is authoritative *as corrected*: the ops repo `poli0981/.github` has **no
|
||||
reusable Rust or Tauri workflow**, its notifiers are **Discord-only**, dependency bumps are
|
||||
**Dependabot** (not Renovate), and its CodeQL reusable *lists* no Rust but passes `languages`
|
||||
straight to codeql-action, which analyses Rust and Actions without a build — `codeql.yml` asks for
|
||||
both. So `ci-rust.yml`, `release.yml`, `security-scan.yml` and `sonar.yml` are project-local; `ci-node.yml`,
|
||||
`codeql.yml` and the notifiers are callers. Every caller needs an explicit `permissions:` block —
|
||||
callers without one default to `none` — and a write permission belongs on the job that needs it,
|
||||
not the workflow.
|
||||
`docs/RELEASE-CI.md` is authoritative. **Every workflow is project-local since 2026-11-21**, when
|
||||
the repository moved to the poli0981org organization: `ci-node.yml`'s web job, `codeql.yml` and the
|
||||
Discord notifier were callers into the owner's personal ops repo (`poli0981/.github`, at `@main`)
|
||||
until then, and a project in the organization no longer runs code another account can change.
|
||||
**Every action is pinned by commit** with its version in a comment, GitHub's own included, and a
|
||||
write permission belongs on the job that needs it, not the workflow. Dependency bumps are
|
||||
**Dependabot** (not Renovate); notifications are **Discord-only**, through the vendored
|
||||
`.github/scripts/discord_notify.py` (`DRY_RUN=1` prints instead of posting).
|
||||
|
||||
**`notify-ci-failure.yml` lists its workflows by name, and a new workflow has to be added to it.**
|
||||
`workflows: ['*']` — the ops repo's own example — is not a wildcard to `workflow_run`: it matched
|
||||
**Eight checks are required on `main`** — `fmt · clippy · test`, `cargo audit`, `cargo deny`,
|
||||
`lint · typecheck · test · build`, `npm audit`, `npm licences`, `tauri lockstep`,
|
||||
`Analyze (javascript-typescript)` — and a required name is this repository's own now, so renaming a
|
||||
job means changing the protection payload in the same change (RELEASE-CI §2). `npm licences` is the
|
||||
npm half of `deny.toml`: `scripts/check-licenses.mjs` with the same allowlist, entry for entry.
|
||||
|
||||
**`notify.yml` lists its workflows by name, and a new workflow has to be added to it.**
|
||||
`workflows: ['*']` — the ops repo's old example — is not a wildcard to `workflow_run`: it matched
|
||||
nothing, and `main` was red from 2026-09-23 for three weeks with no one told. Start any CI
|
||||
question with `gh run list --branch main`, and remember that `security-scan.yml` exists for the
|
||||
case no PR will catch: an advisory against something already merged.
|
||||
|
||||
**Dependabot gives a dependency to the *most specific* group, not the first.** A group with
|
||||
`update-types` beats one with patterns alone, so the `tauri` groups caught nothing until the
|
||||
catch-alls got `exclude-patterns` (2026-11-21); the order of groups in `dependabot.yml` decides
|
||||
nothing. Its log says which group took what ("belongs to more specific group").
|
||||
|
||||
**Qodana runs as two Qodana Cloud projects** — `qodana-rust.yaml` (RustRover in Docker; it cannot
|
||||
see `#[cfg(windows)]` code) and `qodana-js.yaml` (WebStorm, native), one token each — and is not a
|
||||
required check. A new workflow cannot be dispatched before it exists on `main`, so a workflow's
|
||||
first full run happens in its own PR.
|
||||
|
||||
**An attestation stays with the account that made it.** After the transfer, 1.4.0 and 1.5.0 verify
|
||||
only with `gh attestation verify <file> --owner poli0981 --signer-repo poli0981/pipdock`; every
|
||||
`--repo` form returns 404 for them. 1.6.0 on verifies with `--repo poli0981org/pipdock`.
|
||||
|
||||
**SonarQube Cloud is CI-based since 2026-10-25** — `sonar.yml` and `sonar-project.properties`;
|
||||
automatic analysis is off in the project's settings and must stay off, or the CI analysis is
|
||||
refused. Automatic analysis never analysed a line of Rust and imported no coverage, which is why it
|
||||
since 2026-11-21 the project is `poli0981org_pipdock` in the `poli0981org` organization (the old
|
||||
`poli0981_pipdock` keeps the history to 1.5.0). Automatic analysis is off in the project's settings
|
||||
and must stay off, or the CI analysis is refused. Automatic analysis never analysed a line of Rust and imported no coverage, which is why it
|
||||
went. The gate's "new code" is *previous version*, with the version from `package.json`, and a
|
||||
bump takes effect **one analysis late**: the analysis that first sent `1.4.0` still measured from
|
||||
2026-09-27, and the next measured from the last analysis of the version before it (2026-10-20,
|
||||
@@ -136,10 +158,11 @@ wrong; the record says why). P1 closed **P0-10**: pip's version is on every Envi
|
||||
screen, the gated `ruff --fix` — and are recorded in ROADMAP. P2 touched no `NOT_YET` entry: it is CLI-only on purpose, so P3's `health_run` owns the
|
||||
implicit sync rather than the frontend getting two ways to reach one operation.
|
||||
|
||||
**`NOT_YET` is one**: `env_add_manual` — *Browse…*, and the next slice. `logs_tail` shipped in
|
||||
1.4.0 together with the log it tails. `NOT_YET` in `src-tauri/src/lib.rs` is the authority and
|
||||
three tests keep it honest in both directions — this file has said "four", "two" and "two" in
|
||||
different paragraphs at once, each true when written and none updated.
|
||||
**`NOT_YET` is empty since 1.6.0**: `env_add_manual` shipped with *Add interpreter…*, beside a
|
||||
second command, `env_remove_manual`. `NOT_YET` in `src-tauri/src/lib.rs` is the authority and three
|
||||
tests keep it honest in both directions — this file has said "four", "two" and "two" in different
|
||||
paragraphs at once, each true when written and none updated. A future command that is declared
|
||||
before it is built goes back on that list, not into a sentence here.
|
||||
|
||||
**1.4.0, the audit release, left these behind** — most found by running rather than by reading, and each
|
||||
rule below backed by a test where a test can hold it:
|
||||
@@ -210,6 +233,28 @@ driving the installed build:
|
||||
- **Zoom is off on a measurement** (`zoomHotkeysEnabled`): at 200 % in the default window the
|
||||
table's name column collapses to zero. Backlog A5 says what has to change first.
|
||||
|
||||
**1.6.0, *Add interpreter…*, left these behind** — found by an independent review after every suite
|
||||
and the installed-build smoke were green:
|
||||
|
||||
- **The path you check is not the path you run.** `validate_interpreter` canonicalized to compare
|
||||
against PipDock's own venvs and returned that, so a `--symlinks` venv — whose `python.exe` links
|
||||
to its base — was run and stored as the base, and `--env .venv update --all` would have changed
|
||||
the system Python. Resolve to *decide*; run and store what was given, made absolute. **The
|
||||
identity followed the same link**: `env_hash` filed a linked venv's pins, snapshots and reports
|
||||
under its base, which nothing showed while no screen could list the two apart. A venv's own
|
||||
interpreter (recognised by `pyvenv.cfg`) is now resolved only up to its folder. Rows are still
|
||||
matched by path, never by hash: two names for one Python share one.
|
||||
- **Anything that resolves a path needs a fallback to the path.** A Microsoft Store Python is an
|
||||
app-execution alias that `canonicalize()` refuses (os error 1920). `canonical_interpreter` always
|
||||
fell back; the new validator did not, and `env use` would have broken for every Store user.
|
||||
- **A check made once is a claim about the past.** An added entry is validated again on every
|
||||
listing (`envs::probe_listed`, both heads), and the CLI's stored default when it is used: a link
|
||||
can be re-pointed after it was accepted.
|
||||
- **Remove a row by what it shows, not by an identity recomputed from it.** For a file that is
|
||||
gone, `env_hash` hashes the stored text, which is not the identity it was added under whenever
|
||||
canonicalizing changed it (a share: `UNC\server\…`); removal by hash reported success, and the
|
||||
row came back on the next scan.
|
||||
|
||||
Three rules P1 left behind, all found by running rather than reading:
|
||||
|
||||
- **A venv is never externally managed**, and `sysconfig.get_path("stdlib")` inside one resolves to
|
||||
@@ -217,9 +262,10 @@ Three rules P1 left behind, all found by running rather than reading:
|
||||
with, so every venv built from a uv-managed, Debian, Homebrew or Fedora Python refused every
|
||||
mutation. Anything reading a path out of `sysconfig` inside a venv is asking about the base.
|
||||
- **`envs::venv_scan` matches exactly `.venv`, `venv`, `env`, `.env`.** A scratch venv named
|
||||
anything else is invisible to `env list` and to the GUI, and `env_add_manual` (*Browse…*) is
|
||||
still owed — so hand-verification of any environment feature needs one of those four names in
|
||||
the working directory.
|
||||
anything else is not *discovered*; since 1.6.0 it can be *added* — *Add interpreter…* in the GUI,
|
||||
`pipdock env add` in the CLI — and that is how hand-verification reaches a venv outside the
|
||||
working directory. A path a person supplies goes through `envs::validate_interpreter` (named like
|
||||
Python, not PipDock's own venvs) before anything runs it; the picker is not the check.
|
||||
- **Every pip below 22.2 is broken on Python 3.12+** (`distutils`, `pkgutil.ImpImporter`), so the
|
||||
one case *Upgrade pip* exists for is also a pip that cannot run. `upgrade_pip` falls back to
|
||||
`ensurepip`, and decides by asking `pip --version` rather than matching a traceback.
|
||||
@@ -289,7 +335,7 @@ Things worth knowing before you change any of it:
|
||||
|
||||
- **`cargo test` fails when `ui/src/ipc/generated.ts` is stale.** Fix with
|
||||
`cargo run -p xtask -- bindings`; the failure names that command and the first differing line.
|
||||
- **The L4 goldens (`crates/pipdock-cli/tests/golden.rs`, 68 snapshots at 1.4.0) are the CLI's output
|
||||
- **The L4 goldens (`crates/pipdock-cli/tests/golden.rs`, 70 snapshots at 1.6.0) are the CLI's output
|
||||
contract.** A diff there is a real behaviour change — re-bless deliberately, never reflexively.
|
||||
They are what made the `core::flow` refactor provably behaviour-preserving.
|
||||
- **Two tests hold the wire format**: `Code::ALL` must serialize as `as_str()`, and no
|
||||
|
||||
+48
-11
@@ -6,18 +6,49 @@ one thing and proves it.
|
||||
|
||||
By taking part you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
|
||||
## Scope in maintenance mode
|
||||
|
||||
**Since 1.6.0 (2026-11), PipDock is maintained rather than developed.** It does what it was
|
||||
designed to do — the last missing core feature, adding an interpreter by path, shipped in 1.6.0 —
|
||||
and from here the work is keeping it correct, safe and current. What that takes in:
|
||||
|
||||
- **Regular dependency updates** — Rust crates, npm packages, GitHub Actions and the Code Health
|
||||
tool pins, the way Dependabot proposes them.
|
||||
- **Security fixes** — a dependency with a High or Critical advisory, or a serious security problem
|
||||
in a runtime or toolchain PipDock is built with (Node, Rust, WebView2), fixed promptly and
|
||||
released when it reaches the shipped program.
|
||||
- **Major language, runtime and framework upgrades** — Node 26 to 28, TypeScript 6 to 7, a Rust
|
||||
edition, Tauri 2 to 3 — when they arrive and are stable.
|
||||
- **Bugs, UI/UX defects and accessibility barriers** — anything that does not work as the docs
|
||||
describe, gets in someone's way, or cannot be used with a keyboard, a screen reader or high
|
||||
contrast.
|
||||
- **Wording and translation** — English or Vietnamese text that is wrong, misspelt in a way that
|
||||
changes the meaning, misleading, or does not read the way people actually speak. There is an
|
||||
issue form for it.
|
||||
|
||||
**New features are not taken**, as issues or as pull requests. One that asks for a feature — titled
|
||||
as a feature request, a `feat:` pull request, or labelled `enhancement` — is labelled
|
||||
`out-of-scope` and closed automatically, with this section linked. That is not a judgement of the
|
||||
idea. If you believe something is **truly necessary** — it fixes data loss, a security hole, or
|
||||
makes the program unusable for someone without it — make the case in
|
||||
[Discussions → Ideas](https://github.com/poli0981org/pipdock/discussions/categories/ideas); the
|
||||
maintainer can keep an item open with the `policy-exception` label.
|
||||
|
||||
What is planned, and what was deliberately not built, is in [`docs/ROADMAP.md`](docs/ROADMAP.md)
|
||||
under *Maintenance mode*.
|
||||
|
||||
## Before you write code
|
||||
|
||||
- **A bug** — [open an issue](https://github.com/poli0981/pipdock/issues/new/choose). The in-app
|
||||
- **A bug** — [open an issue](https://github.com/poli0981org/pipdock/issues/new/choose). The in-app
|
||||
*Report bug* button fills most of the form in for you.
|
||||
- **Something that gets in your way as a keyboard, screen-reader or high-contrast user** — see
|
||||
[ACCESSIBILITY.md](ACCESSIBILITY.md). That report does not need a diagnosis.
|
||||
- **A security problem** — do not open an issue; follow the [security policy](.github/SECURITY.md).
|
||||
- **A question or an idea** — [Discussions](https://github.com/poli0981/pipdock/discussions).
|
||||
- **A feature** — please ask first. The design is written down in `docs/`, the feature list and its
|
||||
non-goals are in [`docs/PRD.md`](docs/PRD.md), and what is planned and why is in
|
||||
[`docs/ROADMAP.md`](docs/ROADMAP.md). A pull request that contradicts those will be asked to
|
||||
change them first, and that is a conversation better had before the code.
|
||||
- **Wrong or misleading text, in either language** — the *Wording or translation problem* form.
|
||||
- **A question** — [Discussions](https://github.com/poli0981org/pipdock/discussions).
|
||||
- **A feature** — not during maintenance; see [above](#scope-in-maintenance-mode). The design is
|
||||
written down in `docs/`, and a fix that contradicts it will be asked to change the docs first,
|
||||
which is a conversation better had before the code.
|
||||
|
||||
## Setting up
|
||||
|
||||
@@ -68,11 +99,17 @@ cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||
cargo test --workspace --locked
|
||||
```
|
||||
|
||||
A pull request needs five checks green before it can merge — `fmt · clippy · test`, `cargo audit`,
|
||||
`lint · typecheck · test · build`, `npm audit` and CodeQL for JavaScript/TypeScript. Several more
|
||||
run and are read before merging (`cargo deny`, the Tauri version lockstep, CodeQL for Rust and
|
||||
Actions, the real-engine integration tests, SonarQube Cloud). New code is expected to be covered by
|
||||
tests; the SonarQube gate asks for 80 % on new lines.
|
||||
```bash
|
||||
node scripts/check-licenses.mjs
|
||||
```
|
||||
|
||||
A pull request needs eight checks green before it can merge — `fmt · clippy · test`, `cargo audit`,
|
||||
`cargo deny`, `lint · typecheck · test · build`, `npm audit`, `npm licences`, `tauri lockstep` and
|
||||
CodeQL for JavaScript/TypeScript. Several more run and are read before merging (CodeQL for Rust and
|
||||
Actions, the real-engine integration tests, SonarQube Cloud, Qodana). New code is expected to be
|
||||
covered by tests; the SonarQube gate asks for 80 % on new lines. A new dependency the app ships must
|
||||
be under a licence `deny.toml` allows — the two licence checks fail otherwise, and widening the list
|
||||
is a licensing decision, not a CI fix.
|
||||
|
||||
## What a pull request should look like
|
||||
|
||||
|
||||
Generated
+103
-225
@@ -238,7 +238,7 @@ checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -273,7 +273,7 @@ checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -629,14 +629,14 @@ dependencies = [
|
||||
"iana-time-zone",
|
||||
"num-traits",
|
||||
"serde",
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.6.7"
|
||||
version = "4.6.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"
|
||||
checksum = "ac230478587d0269d8d6998b82ae69ea51509d55df66d9e92edd1f986904cd4a"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
@@ -656,14 +656,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "4.6.7"
|
||||
version = "4.6.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0"
|
||||
checksum = "895c9d8d2ac2dd8b8a29f3724a14e72aaaa6debcf8c38c82f97305c6a172767a"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -911,7 +911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -940,7 +940,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -951,7 +951,7 @@ checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -965,37 +965,6 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "defmt"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e4a0795ac740cb54d7b3775c9c17345f6aaecf884c01733b39d6017738e0e3e1"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"defmt-macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "defmt-macros"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "840bb056bd99c495c9188198a258ab787c79f306d864db3e6e8451442d6d8366"
|
||||
dependencies = [
|
||||
"defmt-parser",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "defmt-parser"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71958f69fb2de856c5dd51ac9377e986ca1aa5919f931bf5395a807277f889a0"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.5.9"
|
||||
@@ -1094,7 +1063,7 @@ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1405,7 +1374,7 @@ checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1482,7 +1451,7 @@ checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1629,7 +1598,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
|
||||
dependencies = [
|
||||
"rustix",
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2036,7 +2005,7 @@ dependencies = [
|
||||
"js-sys",
|
||||
"log",
|
||||
"wasm-bindgen",
|
||||
"windows-core 0.62.2",
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2290,11 +2259,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jiff"
|
||||
version = "0.2.39"
|
||||
version = "0.2.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ac703058abac89e5c39b0b879dce2b6b14a4ba36600c7e7e3d0c60a6883ef3c"
|
||||
checksum = "175dc66334db3b9ab9985bf8b61cfed50dc16d20964bb47f9e479adcae984a7f"
|
||||
dependencies = [
|
||||
"defmt",
|
||||
"jiff-core",
|
||||
"jiff-static",
|
||||
"jiff-tzdb-platform",
|
||||
@@ -2302,24 +2270,23 @@ dependencies = [
|
||||
"portable-atomic",
|
||||
"portable-atomic-util",
|
||||
"serde_core",
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jiff-core"
|
||||
version = "0.1.2"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aee43309eb53bafb8c36d35d6e444769c8f8e6206a9fbf7546f5db9d7d4a0e93"
|
||||
checksum = "e599b80292e597019b8b3e392de3f4bea2959ddfb8c7dff60e035e9e311a2c1b"
|
||||
dependencies = [
|
||||
"defmt",
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jiff-static"
|
||||
version = "0.2.39"
|
||||
version = "0.2.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6dc32470c67eb7d0e9ccb74303fa925313dc04cecb1aa048beaa6f391e36a93d"
|
||||
checksum = "c7b1af7547d47354bc438d797e3854601bde8f8d185780c5ba4ab27afa54f1ba"
|
||||
dependencies = [
|
||||
"jiff-core",
|
||||
"proc-macro2",
|
||||
@@ -2372,7 +2339,7 @@ dependencies = [
|
||||
"simd_cesu8",
|
||||
"thiserror 2.0.21",
|
||||
"walkdir",
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2535,9 +2502,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libsqlite3-sys"
|
||||
version = "0.39.1"
|
||||
version = "0.40.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "14a5f01b87b92705d07b433c06f96cbc764637d81a0bffb5734ce17cf0f9a2b3"
|
||||
checksum = "b06e69070b7e12262b0cd90832f0a7396f142a2b330181255562decf9f0c6215"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"pkg-config",
|
||||
@@ -3102,7 +3069,7 @@ dependencies = [
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3183,7 +3150,7 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
||||
|
||||
[[package]]
|
||||
name = "pipdock-app"
|
||||
version = "1.5.0"
|
||||
version = "1.6.0"
|
||||
dependencies = [
|
||||
"jiff",
|
||||
"pipdock-core",
|
||||
@@ -3204,7 +3171,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pipdock-cli"
|
||||
version = "1.5.0"
|
||||
version = "1.6.0"
|
||||
dependencies = [
|
||||
"assert_cmd",
|
||||
"clap",
|
||||
@@ -3220,7 +3187,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pipdock-core"
|
||||
version = "1.5.0"
|
||||
version = "1.6.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"jiff",
|
||||
@@ -3617,7 +3584,7 @@ checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3743,9 +3710,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rusqlite"
|
||||
version = "0.41.1"
|
||||
version = "0.43.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da9bba6f3506135e120a6586df05be18b48d18896600646a4bec8f993d91a594"
|
||||
checksum = "f172c4812a19b26d1c23cdb0070e69db335503dfa378b910eb857386e5b8beba"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"fallible-iterator",
|
||||
@@ -3944,7 +3911,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde_derive_internals 0.30.0",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4044,7 +4011,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4066,7 +4033,7 @@ checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4090,7 +4057,7 @@ checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4141,7 +4108,7 @@ dependencies = [
|
||||
"darling",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4328,9 +4295,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "sqlite-wasm-rs"
|
||||
version = "0.6.2"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "36bd8e29bf08189a005b2df1df99823aa0861cabe9044e5f31ed54ca292ee618"
|
||||
checksum = "a6cd504cecbfe7eef649988840f9a6cb768d11085efec138f8e99f160632d867"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"rsqlite-vfs",
|
||||
@@ -4427,9 +4394,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "3.0.9"
|
||||
version = "3.0.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
||||
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -4453,7 +4420,7 @@ checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4503,8 +4470,8 @@ dependencies = [
|
||||
"tao-macros",
|
||||
"unicode-segmentation",
|
||||
"url",
|
||||
"windows 0.62.2",
|
||||
"windows-core 0.62.2",
|
||||
"windows",
|
||||
"windows-core",
|
||||
"windows-version",
|
||||
"x11-dl",
|
||||
]
|
||||
@@ -4528,9 +4495,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
||||
|
||||
[[package]]
|
||||
name = "tauri"
|
||||
version = "2.12.5"
|
||||
version = "2.12.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5fb0244332cfb9cee7e2a568bf5da29a36ed8fdbd717f6f47a66b6b7b358c072"
|
||||
checksum = "9c2a5cad3827d1fa46c206a6bcaee8ca14203e9b0aaabe447dd4acef33ecd065"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
@@ -4574,14 +4541,14 @@ dependencies = [
|
||||
"webkit2gtk",
|
||||
"webview2-com",
|
||||
"window-vibrancy",
|
||||
"windows 0.62.2",
|
||||
"windows",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-build"
|
||||
version = "2.7.4"
|
||||
version = "2.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adddb0e648752aaac5da9c3c3c6a68e1e87cab55e3b757b18a9441ef8c3ac614"
|
||||
checksum = "73d80784e874fa117b9b00a6680cf2f9b8a51bbd14406bea980cf8f328b00646"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo_toml",
|
||||
@@ -4602,9 +4569,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-codegen"
|
||||
version = "2.7.4"
|
||||
version = "2.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb37631cf71dab5e8ab55e1bdd701e18a52653d90b78e71d0e5598b1e0a61316"
|
||||
checksum = "c5dc6caab4da5646f57648f39b794bae118f0dd4a4305eeb8c892966171f4852"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"brotli",
|
||||
@@ -4617,7 +4584,7 @@ dependencies = [
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.10.9",
|
||||
"sha2 0.11.1",
|
||||
"syn 2.0.119",
|
||||
"tauri-utils",
|
||||
"thiserror 2.0.21",
|
||||
@@ -4629,9 +4596,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-macros"
|
||||
version = "2.7.4"
|
||||
version = "2.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0cc38db58854c10fb5f91a887ed8bf82d3239bb92b5d8db86eda09e96d9963d1"
|
||||
checksum = "2831c5da8603a96b1efc0b650c2cb6decc69b6cda257d815fe70c7f5be53818e"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
@@ -4716,9 +4683,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-opener"
|
||||
version = "2.7.2"
|
||||
version = "2.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53810be1b4fed22bb6ac3f4cab5a2b80d9391d1af436bda145607532bc0bb219"
|
||||
checksum = "54592c6718b42ab198bf11bda6a428a3553ca2f2f8e506df56f6a063ec328331"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"glob",
|
||||
@@ -4732,7 +4699,7 @@ dependencies = [
|
||||
"tauri-plugin",
|
||||
"thiserror 2.0.21",
|
||||
"url",
|
||||
"windows 0.62.2",
|
||||
"windows",
|
||||
"zbus",
|
||||
]
|
||||
|
||||
@@ -4754,9 +4721,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.12.2"
|
||||
version = "2.12.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c55766d99cea69055904d1735b93c2049302b2e09effd462120deb5581d78e9"
|
||||
checksum = "60c2b14bd5265b63993cdc34ad526fb836e0fd0cf64a4634a895db0784844d5e"
|
||||
dependencies = [
|
||||
"cookie",
|
||||
"dpi",
|
||||
@@ -4774,14 +4741,14 @@ dependencies = [
|
||||
"url",
|
||||
"webkit2gtk",
|
||||
"webview2-com",
|
||||
"windows 0.62.2",
|
||||
"windows",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "2.12.3"
|
||||
version = "2.12.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1aa9d8b7a120f879f44fdc1053f7b7dbf416bf0bbc6a72b714dec46b782b52f"
|
||||
checksum = "b8c14a025255cc9816d401635035075b09b6cc9973b7b8fd7b8fcb8753f30f92"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
@@ -4798,15 +4765,15 @@ dependencies = [
|
||||
"url",
|
||||
"webkit2gtk",
|
||||
"webview2-com",
|
||||
"windows 0.62.2",
|
||||
"windows",
|
||||
"wry",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-utils"
|
||||
version = "2.10.2"
|
||||
version = "2.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "362ab21cd4cc713f2a02b1a9b5688198b1541cfb6907c4281e9190e0f0ef4aa3"
|
||||
checksum = "28d1d33d4453c5df0bf1672dbc7ada69d8ed74f56a4316d964a4aa73d4ecd3ad"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"brotli",
|
||||
@@ -4916,7 +4883,7 @@ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5012,7 +4979,7 @@ checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5522,7 +5489,7 @@ dependencies = [
|
||||
"bumpalo",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
@@ -5711,8 +5678,8 @@ checksum = "3f89fca7a704cee10dcb3654c1dbb8941d1783132f1917358af75bec37a7d7e6"
|
||||
dependencies = [
|
||||
"webview2-com-macros",
|
||||
"webview2-com-sys",
|
||||
"windows 0.62.2",
|
||||
"windows-core 0.62.2",
|
||||
"windows",
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5733,8 +5700,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
"windows 0.62.2",
|
||||
"windows-core 0.62.2",
|
||||
"windows",
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5745,12 +5712,12 @@ checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
|
||||
|
||||
[[package]]
|
||||
name = "win32job"
|
||||
version = "2.0.3"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c6a6724ccfbf34154a8691bd868b0fcd2be2ca3f7b47b32614654f1a01b191c"
|
||||
checksum = "21b25acac91041257d64f5625690b626133e0ca9e4e17814552b5803b1a82f7c"
|
||||
dependencies = [
|
||||
"thiserror 1.0.69",
|
||||
"windows 0.61.3",
|
||||
"windows",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5800,38 +5767,16 @@ dependencies = [
|
||||
"windows-version",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.61.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
|
||||
dependencies = [
|
||||
"windows-collections 0.2.0",
|
||||
"windows-core 0.61.2",
|
||||
"windows-future 0.2.1",
|
||||
"windows-link 0.1.3",
|
||||
"windows-numerics 0.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.62.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
|
||||
dependencies = [
|
||||
"windows-collections 0.3.2",
|
||||
"windows-core 0.62.2",
|
||||
"windows-future 0.3.2",
|
||||
"windows-numerics 0.3.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-collections"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
|
||||
dependencies = [
|
||||
"windows-core 0.61.2",
|
||||
"windows-collections",
|
||||
"windows-core",
|
||||
"windows-future",
|
||||
"windows-numerics",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5840,20 +5785,7 @@ version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
|
||||
dependencies = [
|
||||
"windows-core 0.62.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-core"
|
||||
version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
|
||||
dependencies = [
|
||||
"windows-implement",
|
||||
"windows-interface",
|
||||
"windows-link 0.1.3",
|
||||
"windows-result 0.3.4",
|
||||
"windows-strings 0.4.2",
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5864,20 +5796,9 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
|
||||
dependencies = [
|
||||
"windows-implement",
|
||||
"windows-interface",
|
||||
"windows-link 0.2.1",
|
||||
"windows-result 0.4.1",
|
||||
"windows-strings 0.5.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-future"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
|
||||
dependencies = [
|
||||
"windows-core 0.61.2",
|
||||
"windows-link 0.1.3",
|
||||
"windows-threading 0.1.0",
|
||||
"windows-link",
|
||||
"windows-result",
|
||||
"windows-strings",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5886,9 +5807,9 @@ version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
|
||||
dependencies = [
|
||||
"windows-core 0.62.2",
|
||||
"windows-link 0.2.1",
|
||||
"windows-threading 0.2.1",
|
||||
"windows-core",
|
||||
"windows-link",
|
||||
"windows-threading",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5913,45 +5834,20 @@ dependencies = [
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||
|
||||
[[package]]
|
||||
name = "windows-numerics"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
|
||||
dependencies = [
|
||||
"windows-core 0.61.2",
|
||||
"windows-link 0.1.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-numerics"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
|
||||
dependencies = [
|
||||
"windows-core 0.62.2",
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-result"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
|
||||
dependencies = [
|
||||
"windows-link 0.1.3",
|
||||
"windows-core",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5960,16 +5856,7 @@ version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
|
||||
dependencies = [
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-strings"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
|
||||
dependencies = [
|
||||
"windows-link 0.1.3",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5978,7 +5865,7 @@ version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
|
||||
dependencies = [
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6005,7 +5892,7 @@ version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||
dependencies = [
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6039,22 +5926,13 @@ dependencies = [
|
||||
"windows_x86_64_msvc 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-threading"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
|
||||
dependencies = [
|
||||
"windows-link 0.1.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-threading"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"
|
||||
dependencies = [
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6063,7 +5941,7 @@ version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631"
|
||||
dependencies = [
|
||||
"windows-link 0.2.1",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6251,8 +6129,8 @@ dependencies = [
|
||||
"webkit2gtk",
|
||||
"webkit2gtk-sys",
|
||||
"webview2-com",
|
||||
"windows 0.62.2",
|
||||
"windows-core 0.62.2",
|
||||
"windows",
|
||||
"windows-core",
|
||||
"windows-version",
|
||||
"x11-dl",
|
||||
]
|
||||
@@ -6297,7 +6175,7 @@ checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd"
|
||||
|
||||
[[package]]
|
||||
name = "xtask"
|
||||
version = "1.5.0"
|
||||
version = "1.6.0"
|
||||
dependencies = [
|
||||
"pipdock-core",
|
||||
]
|
||||
@@ -6321,7 +6199,7 @@ checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
@@ -6369,7 +6247,7 @@ dependencies = [
|
||||
"proc-macro-crate 3.5.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
"zbus_names",
|
||||
"zvariant",
|
||||
"zvariant_utils",
|
||||
@@ -6432,7 +6310,7 @@ checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
@@ -6472,7 +6350,7 @@ checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6526,7 +6404,7 @@ dependencies = [
|
||||
"proc-macro-crate 3.5.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
"zvariant_utils",
|
||||
]
|
||||
|
||||
@@ -6539,6 +6417,6 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"syn 3.0.9",
|
||||
"syn 3.0.10",
|
||||
"winnow 1.0.4",
|
||||
]
|
||||
+2
-2
@@ -3,11 +3,11 @@ resolver = "3"
|
||||
members = ["crates/pipdock-core", "crates/pipdock-cli", "src-tauri", "xtask"]
|
||||
|
||||
[workspace.package]
|
||||
version = "1.5.0"
|
||||
version = "1.6.0"
|
||||
edition = "2024"
|
||||
rust-version = "1.99"
|
||||
license = "GPL-3.0-only"
|
||||
repository = "https://github.com/poli0981/pipdock"
|
||||
repository = "https://github.com/poli0981org/pipdock"
|
||||
authors = ["Kokone (poli0981)"]
|
||||
# Applications, not libraries: nothing here belongs on crates.io, and cargo-deny treats a
|
||||
# publishable crate's licence and path dependencies as a published one's (deny.toml).
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
# PipDock
|
||||
|
||||
[](https://github.com/poli0981/pipdock/actions/workflows/ci-rust.yml)
|
||||
[](https://github.com/poli0981/pipdock/actions/workflows/ci-node.yml)
|
||||
[](https://github.com/poli0981/pipdock/actions/workflows/codeql.yml)
|
||||
[](https://github.com/poli0981/pipdock/releases)
|
||||
[](https://github.com/poli0981org/pipdock/actions/workflows/ci-rust.yml)
|
||||
[](https://github.com/poli0981org/pipdock/actions/workflows/ci-node.yml)
|
||||
[](https://github.com/poli0981org/pipdock/actions/workflows/codeql.yml)
|
||||
[](https://github.com/poli0981org/pipdock/releases)
|
||||
[](LICENSE)
|
||||
|
||||
**A friendly dock for your Python environments.** Inspect, install, update, and clean up Python packages in bulk — through a keyboard-first GUI or a scriptable CLI — without ever hand-typing another `pip install` incantation or guessing why an upgrade broke your project.
|
||||
|
||||
> Repo: `poli0981/pipdock` · License: **GPL-3.0-only** · Platform: **Windows 10/11** · Contact: [contact@poli0981.dev](mailto:contact@poli0981.dev) · [other channels](https://poli0981.dev/links/)
|
||||
> Repo: `poli0981org/pipdock` · License: **GPL-3.0-only** · Platform: **Windows 10/11** · Contact: [contact@poli0981.dev](mailto:contact@poli0981.dev) · [other channels](https://poli0981.dev/links/)
|
||||
|
||||
> **Status: maintenance mode, since 1.6.0.** PipDock is complete for what it set out to do, and is kept correct, safe and current rather than extended: dependency and security updates, major runtime upgrades, bug, UI/UX and accessibility fixes, and wording fixes in either language — no new features. [CONTRIBUTING.md](CONTRIBUTING.md#scope-in-maintenance-mode) says what is accepted. The repository moved from `poli0981/pipdock` to the **poli0981org** organization on 2026-11-21; the old address redirects.
|
||||
|
||||
---
|
||||
|
||||
@@ -50,7 +52,7 @@
|
||||
|
||||
| Area | What you get |
|
||||
|---|---|
|
||||
| Environments | Auto-discovery of installed Pythons — the Windows registry (PEP 514), the `py` launcher and the Pythons `uv python list` reports — plus a `.venv`, `venv`, `env` or `.env` folder in the folder PipDock was started from. Adding an environment by path is not in the app yet; the CLI takes any interpreter or environment folder with `--env` |
|
||||
| Environments | Auto-discovery of installed Pythons — the Windows registry (PEP 514), the `py` launcher and the Pythons `uv python list` reports — plus a `.venv`, `venv`, `env` or `.env` folder in the folder PipDock was started from. **Add interpreter…** puts any other Python or virtual environment on the list (`pipdock env add` in the CLI), and *Remove from list* takes it off |
|
||||
| PEP 668 guard | Pythons marked externally managed are refused by default. An override in Settings, off by default, asks before it turns on, and while it applies every screen that can change that Python says so |
|
||||
| Installed | Full package list per env; up-to-date packages dimmed, outdated badged |
|
||||
| Updates | Bulk update with group dry-run resolve, held-back explanations, 3-way conflict choices. The preview names every package *Force latest* would break, anything left out because it needs a different Python, and withdrawn (yanked) releases |
|
||||
@@ -65,7 +67,7 @@
|
||||
| pip upkeep | Check & update pip itself per environment |
|
||||
| CLI | `pipdock` — full parity for core operations, JSON output, CI-friendly exit codes |
|
||||
| Requirements | Export an environment as `requirements.txt`; import one and preview what it would install, with every line it will not use reported by number |
|
||||
| Disk usage | Everything PipDock writes is under `%LOCALAPPDATA%\PipDock\data\`. Settings shows it and clears the parts that are safe to clear — snapshots (`snapshots\`), the Code Health tools environment (`tools\`) and the Security tab's audit environment (`audit\`). `index.db` (package index, settings, pins, your acceptance of the legal documents) is shown but never cleared; the logs (`logs\`) are deleted automatically after 14 days |
|
||||
| Disk usage | Everything PipDock writes is under `%LOCALAPPDATA%\PipDock\data\`. Settings shows it and clears the parts that are safe to clear — snapshots (`snapshots\`), the Code Health tools environment (`tools\`) and the Security tab's audit environment (`audit\`). `index.db` (package index, settings, pins, the interpreters you added, your acceptance of the legal documents) is shown but never cleared; the logs (`logs\`) are deleted automatically after 14 days |
|
||||
| Logs | PipDock keeps its own log, one file per day in `data\logs\`, and never sends it anywhere. It records the commands PipDock ran, so it holds package names and file paths. Settings shows the folder and copies the recent lines for a bug report |
|
||||
| Keyboard | `Ctrl+K` command palette, `Ctrl+1`–`Ctrl+9` tabs (by key position, so AZERTY and other layouts work too), `/` for Search, full keyboard traversal |
|
||||
| i18n | English + Tiếng Việt, remembered across restarts |
|
||||
@@ -73,7 +75,7 @@
|
||||
|
||||
## Install
|
||||
|
||||
Download the installer (NSIS `.exe` or `.msi`) from [GitHub Releases](https://github.com/poli0981/pipdock/releases).
|
||||
Download the installer (NSIS `.exe` or `.msi`) from [GitHub Releases](https://github.com/poli0981org/pipdock/releases).
|
||||
|
||||
PipDock does not update itself — grab a new build from the same page when you want one. That is deliberate: a self-updater is a standing remote-code-execution path into a tool that already runs subprocesses against your interpreters, and it is not worth the convenience (see [docs/SECURITY.md](docs/SECURITY.md) §5).
|
||||
|
||||
@@ -88,10 +90,16 @@ PipDock does not update itself — grab a new build from the same page when you
|
||||
> From 1.4.0 the `.exe` and `.msi` also carry a build-provenance attestation. A checksum published beside a file cannot prove where the file came from — whoever could replace one could replace both — but the attestation proves the installer was built by this repository's release workflow. With the [GitHub CLI](https://cli.github.com/):
|
||||
>
|
||||
> ```powershell
|
||||
> gh attestation verify .\PipDock_<version>_x64-setup.exe --repo poli0981/pipdock
|
||||
> gh attestation verify .\PipDock_<version>_x64-setup.exe --repo poli0981org/pipdock
|
||||
> ```
|
||||
>
|
||||
> It succeeds only when GitHub holds an attestation from this repository for that exact file. If it fails, do not run the file.
|
||||
> That is for 1.6.0 and later. **1.4.0 and 1.5.0 were built before the repository moved to the poli0981org organization** (2026-11-21), and their attestations stayed with the account that made them, so `--repo` finds none for them. Verify those against that account and the repository's old name instead:
|
||||
>
|
||||
> ```powershell
|
||||
> gh attestation verify .\PipDock_1.5.0_x64-setup.exe --owner poli0981 --signer-repo poli0981/pipdock
|
||||
> ```
|
||||
>
|
||||
> Either succeeds only when GitHub holds an attestation from this repository's release workflow for that exact file. If it fails, do not run the file.
|
||||
|
||||
## Quick start
|
||||
|
||||
@@ -115,10 +123,10 @@ pipdock snapshot rollback latest
|
||||
|
||||
## Documentation
|
||||
|
||||
**Using PipDock?** The [wiki](https://github.com/poli0981/pipdock/wiki) is the user-facing set —
|
||||
[Getting Started](https://github.com/poli0981/pipdock/wiki/Getting-Started),
|
||||
[Troubleshooting](https://github.com/poli0981/pipdock/wiki/Troubleshooting) and an
|
||||
[FAQ](https://github.com/poli0981/pipdock/wiki/FAQ) that explains the design decisions rather than
|
||||
**Using PipDock?** The [wiki](https://github.com/poli0981org/pipdock/wiki) is the user-facing set —
|
||||
[Getting Started](https://github.com/poli0981org/pipdock/wiki/Getting-Started),
|
||||
[Troubleshooting](https://github.com/poli0981org/pipdock/wiki/Troubleshooting) and an
|
||||
[FAQ](https://github.com/poli0981org/pipdock/wiki/FAQ) that explains the design decisions rather than
|
||||
just stating them. Everything below is for reading the code.
|
||||
|
||||
| Doc | Purpose |
|
||||
@@ -134,7 +142,7 @@ just stating them. Everything below is for reading the code.
|
||||
| [docs/ERROR-CATALOG.md](docs/ERROR-CATALOG.md) | Error codes, stderr detection patterns, user guidance |
|
||||
| [docs/SECURITY.md](docs/SECURITY.md) | Threat model, PEP 668 policy, supply-chain hygiene |
|
||||
| [docs/TESTING.md](docs/TESTING.md) | Test strategy incl. disposable-venv integration tests |
|
||||
| [docs/RELEASE-CI.md](docs/RELEASE-CI.md) | CI callers into `poli0981/.github`, release pipeline |
|
||||
| [docs/RELEASE-CI.md](docs/RELEASE-CI.md) | Workflows, branch protection, Dependabot, release pipeline |
|
||||
| [docs/I18N.md](docs/I18N.md) | EN/VI localization rules |
|
||||
| [docs/ROADMAP.md](docs/ROADMAP.md) | Spike week, milestones, exit criteria |
|
||||
| [ACCESSIBILITY.md](ACCESSIBILITY.md) | What is supported, what has been tested, what is known not to work, and how to report a barrier |
|
||||
@@ -146,7 +154,7 @@ just stating them. Everything below is for reading the code.
|
||||
|
||||
PipDock is built to work with a keyboard alone, with a screen reader and under a Windows contrast theme, and `pipdock` on the command line is plain text with no colour and nothing that animates. The target is WCAG 2.2 AA; it is a target and not a conformance claim, and [ACCESSIBILITY.md](ACCESSIBILITY.md) says exactly what has been tested, by whom, and what is known to fall short.
|
||||
|
||||
If something gets in your way, [open an accessibility issue](https://github.com/poli0981/pipdock/issues/new?template=accessibility.yml) or write to [accessibility@poli0981.dev](mailto:accessibility@poli0981.dev) — in English or Vietnamese, with no GitHub account needed and no diagnosis expected.
|
||||
If something gets in your way, [open an accessibility issue](https://github.com/poli0981org/pipdock/issues/new?template=accessibility.yml) or write to [accessibility@poli0981.dev](mailto:accessibility@poli0981.dev) — in English or Vietnamese, with no GitHub account needed and no diagnosis expected.
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -172,4 +180,6 @@ PipDock is an independent project. It is not affiliated with or endorsed by the
|
||||
|
||||
PipDock là ứng dụng Windows (GUI + CLI) giúp kiểm tra, cài đặt, cập nhật và gỡ **hàng loạt** gói thư viện Python một cách an toàn: luôn chạy dry-run xem trước thay đổi, xử lý xung đột phiên bản với 3 lựa chọn rõ ràng, tự chụp snapshot trước mỗi lần chạy để rollback một chạm, cảnh báo khi gỡ gói mà gói khác đang phụ thuộc, và tổng kết "13 thành công, 2 thất bại" kèm lý do từng gói. Hỗ trợ engine pip hoặc uv (chọn trong Settings), tìm gói tức thì nhờ cache chỉ mục PyPI, kèm module Code Health (deptry/vulture/ruff) để dọn dependency thừa và dead code. Không thu thập dữ liệu. Giấy phép GPL-3.0.
|
||||
|
||||
**Khả năng tiếp cận:** PipDock dùng được chỉ với bàn phím, với trình đọc màn hình (đã thử với Narrator) và ở chế độ tương phản cao của Windows. Chi tiết, kể cả những gì chưa được kiểm thử, nằm trong [ACCESSIBILITY.md](ACCESSIBILITY.md). Nếu gặp rào cản, hãy [mở issue](https://github.com/poli0981/pipdock/issues/new?template=accessibility.yml) hoặc viết tới [accessibility@poli0981.dev](mailto:accessibility@poli0981.dev) — tiếng Việt cũng được.
|
||||
**Trạng thái: giai đoạn bảo trì, từ bản 1.6.0.** PipDock đã làm đủ những gì nó đặt ra, và từ nay được giữ cho đúng, an toàn và cập nhật chứ không mở rộng thêm: cập nhật phụ thuộc định kỳ, sửa lỗi bảo mật (CVE mức High trở lên hoặc lỗi nghiêm trọng của runtime), nâng cấp lớn ngôn ngữ/runtime/framework, sửa lỗi, lỗi UI/UX và rào cản tiếp cận, sửa câu chữ hoặc bản dịch dễ gây hiểu nhầm — **không nhận tính năng mới**; issue hay PR đề xuất tính năng sẽ tự động được gắn nhãn và đóng. Repo đã chuyển từ `poli0981/pipdock` sang tổ chức **poli0981org** ngày 2026-11-21; địa chỉ cũ vẫn tự chuyển hướng. Chi tiết trong [CONTRIBUTING.md](CONTRIBUTING.md#scope-in-maintenance-mode).
|
||||
|
||||
**Khả năng tiếp cận:** PipDock dùng được chỉ với bàn phím, với trình đọc màn hình (đã thử với Narrator) và ở chế độ tương phản cao của Windows. Chi tiết, kể cả những gì chưa được kiểm thử, nằm trong [ACCESSIBILITY.md](ACCESSIBILITY.md). Nếu gặp rào cản, hãy [mở issue](https://github.com/poli0981org/pipdock/issues/new?template=accessibility.yml) hoặc viết tới [accessibility@poli0981.dev](mailto:accessibility@poli0981.dev) — tiếng Việt cũng được.
|
||||
@@ -3,6 +3,59 @@
|
||||
Newest first. See [`README.md`](README.md) for the conventions, and `docs/ROADMAP.md` for what each
|
||||
slice cost and what it taught — that is a different document for a different reader.
|
||||
|
||||
## 1.6.0 — 2026-11-21
|
||||
|
||||
**Add any Python, and the move to maintenance mode.** PipDock can now manage a virtual environment
|
||||
wherever it lives — the one core feature that was still missing — and with this release it moves
|
||||
from being developed to being maintained. ([#119](https://github.com/poli0981org/pipdock/pull/119),
|
||||
[#120](https://github.com/poli0981org/pipdock/pull/120))
|
||||
|
||||
### Added
|
||||
|
||||
- **Add interpreter…** on Environments — beside *Rescan*, in the empty screen, and in `Ctrl+K`.
|
||||
Pick any `python.exe`, typically the one in a virtual environment's `Scripts` folder, and it is
|
||||
added to the list, selected, and remembered across restarts. Until now the app only found a venv
|
||||
named `.venv`, `venv`, `env` or `.env` in the folder it was started from, which for an installed
|
||||
app is its own install folder — so most project environments were out of reach.
|
||||
- **Remove from list** on every interpreter you added. It only forgets the entry; nothing on disk is
|
||||
touched, and the environment's pins and snapshots are kept for when you add it again. An added
|
||||
environment that has since been deleted stays listed with its error, so you can remove it.
|
||||
- The same from the command line: `pipdock env add <path>` and `pipdock env remove <path>`, and
|
||||
`pipdock env list` shows what you added after what it discovered.
|
||||
|
||||
### Changed
|
||||
|
||||
- **PipDock checks a path you give it before running anything.** An interpreter you pick, or pass
|
||||
with `--env`, `env use` or `env add`, has to be a file named `python.exe` (or `python3.exe`,
|
||||
`python3.12.exe`, the free-threaded `python3.14t.exe`), and cannot be one of PipDock's own tool
|
||||
environments. Anything else is refused
|
||||
with `PD-ENV-001`, whose message now reads "That interpreter is missing, or PipDock cannot run it."
|
||||
An interpreter you added is checked again whenever the list is read, and a default set with
|
||||
`env use` before 1.6.0 is checked when it is used — if it is refused, it is skipped with a
|
||||
warning, as a deleted one already was.
|
||||
- **A virtual environment made with `--symlinks` is its own environment.** Its pins, snapshots and
|
||||
reports were filed under the Python it was made from, because its `python.exe` is a link to that
|
||||
Python. They are kept apart now; any made before 1.6.0 stay with that Python.
|
||||
- **The repository moved to `github.com/poli0981org/pipdock`.** The bug-report button, the legal
|
||||
documents, About and the docs point there; the old address redirects.
|
||||
- **The first-run screen asks once more.** The privacy policy now names the interpreter paths you
|
||||
add (kept until you remove them) and the repository's new address, so the documents changed.
|
||||
|
||||
### Verifying a download
|
||||
|
||||
`gh attestation verify .\PipDock_1.6.0_x64-setup.exe --repo poli0981org/pipdock` verifies this
|
||||
release and later ones. **The command in earlier READMEs no longer works for 1.4.0 and 1.5.0**: an
|
||||
attestation stays with the account that made it, so verify those with
|
||||
`--owner poli0981 --signer-repo poli0981/pipdock` instead.
|
||||
|
||||
### What maintenance mode means for you
|
||||
|
||||
- Bugs, UI/UX problems and accessibility barriers are what PipDock is now maintained for, along
|
||||
with dependency and security updates, major runtime upgrades and wording fixes. There is a new
|
||||
issue form for wrong or misleading text, in English or Vietnamese.
|
||||
- **New features are not taken.** An issue or pull request asking for one is labelled and closed
|
||||
automatically, with a link explaining why. `CONTRIBUTING.md` says what is accepted.
|
||||
|
||||
## 1.5.0 — 2026-11-10
|
||||
|
||||
**The accessibility release.** PipDock could already be driven from the keyboard and read by
|
||||
|
||||
@@ -275,13 +275,23 @@ enum Command {
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
enum EnvCommand {
|
||||
/// List discovered environments, their sources and PEP 668 flags.
|
||||
/// List discovered environments and the ones added with `env add`, their sources and PEP 668 flags.
|
||||
List,
|
||||
/// Set the default environment.
|
||||
Use {
|
||||
/// Interpreter or environment directory.
|
||||
path: PathBuf,
|
||||
},
|
||||
/// Add an interpreter discovery does not find to the list (the GUI's Add interpreter…).
|
||||
Add {
|
||||
/// Interpreter or environment directory.
|
||||
path: PathBuf,
|
||||
},
|
||||
/// Take an interpreter added with `env add` off the list. Nothing on disk is touched.
|
||||
Remove {
|
||||
/// Interpreter or environment directory, as it was added.
|
||||
path: PathBuf,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
@@ -395,6 +405,8 @@ async fn main() -> ExitCode {
|
||||
}
|
||||
Command::Schema { type_name } => run::schema(type_name),
|
||||
Command::Env(EnvCommand::Use { path }) => run::env_use(&cli.global, path).await,
|
||||
Command::Env(EnvCommand::Add { path }) => run::env_add(&cli.global, path).await,
|
||||
Command::Env(EnvCommand::Remove { path }) => run::env_remove(&cli.global, path),
|
||||
Command::Audit => run::audit(&cli.global).await,
|
||||
Command::PipUpgrade => run::pip_upgrade(&cli.global).await,
|
||||
Command::Snapshot(SnapshotCommand::Rollback { id }) => {
|
||||
|
||||
+155
-46
@@ -217,8 +217,8 @@ pub async fn select_env(opts: &GlobalOpts) -> Result<PyEnv> {
|
||||
/// CLI-SPEC §2 and `--env`'s own help text: `--env` wins; then the default `env use` set; then a
|
||||
/// `.venv` in the working directory. The default was written by `env use` and read by nothing, so
|
||||
/// `env use` reported success and every later command ignored it (X3). A default whose interpreter
|
||||
/// is gone is said on stderr and skipped, rather than failing a command the user ran somewhere a
|
||||
/// `.venv` would have answered.
|
||||
/// is gone, or that [`envs::validate_interpreter`] refuses, is said on stderr and skipped, rather
|
||||
/// than failing a command the user ran somewhere a `.venv` would have answered.
|
||||
///
|
||||
/// Returns the probe, not just the `PyEnv`, so a command that needs the listing does not probe a
|
||||
/// second time — `list` did, and paid twice on every invocation (X28).
|
||||
@@ -228,7 +228,8 @@ pub async fn select_env(opts: &GlobalOpts) -> Result<PyEnv> {
|
||||
/// default that mutates the wrong environment.
|
||||
pub async fn select(opts: &GlobalOpts) -> Result<envs::ProbeResult> {
|
||||
if let Some(path) = &opts.env {
|
||||
return envs::probe(&interpreter_in(path), EnvSource::Manual).await;
|
||||
let interpreter = envs::validate_interpreter(&envs::interpreter_in(path), &app_data_dir())?;
|
||||
return envs::probe(&interpreter, EnvSource::Manual).await;
|
||||
}
|
||||
|
||||
let stored = Store::open(&app_data_dir())
|
||||
@@ -237,12 +238,23 @@ pub async fn select(opts: &GlobalOpts) -> Result<envs::ProbeResult> {
|
||||
if let Some(default) = stored {
|
||||
let interpreter = PathBuf::from(&default.interpreter);
|
||||
if interpreter.is_file() {
|
||||
return envs::probe(&interpreter, EnvSource::Manual).await;
|
||||
// Checked like `--env`: a default written by 1.5.0 or earlier never was, and the file
|
||||
// may have changed since. Refused, it is skipped with a warning, as a gone one is.
|
||||
match envs::validate_interpreter(&interpreter, &app_data_dir()) {
|
||||
Ok(checked) => return envs::probe(&checked, EnvSource::Manual).await,
|
||||
Err(e) => eprintln!(
|
||||
"warning: the default environment is not used: {}; `pipdock env use` sets \
|
||||
another",
|
||||
e.message
|
||||
),
|
||||
}
|
||||
} else {
|
||||
eprintln!(
|
||||
"warning: the default environment ({}) no longer exists; `pipdock env use` sets \
|
||||
another",
|
||||
default.interpreter
|
||||
);
|
||||
}
|
||||
eprintln!(
|
||||
"warning: the default environment ({}) no longer exists; `pipdock env use` sets another",
|
||||
default.interpreter
|
||||
);
|
||||
}
|
||||
|
||||
let cwd = std::env::current_dir().unwrap_or_default();
|
||||
@@ -257,35 +269,29 @@ pub async fn select(opts: &GlobalOpts) -> Result<envs::ProbeResult> {
|
||||
))
|
||||
}
|
||||
|
||||
/// Accept either an interpreter path or an environment directory, as CLI-SPEC §2 promises.
|
||||
fn interpreter_in(path: &Path) -> PathBuf {
|
||||
if path.is_file() {
|
||||
return path.to_path_buf();
|
||||
}
|
||||
let exe: PathBuf = if cfg!(windows) {
|
||||
["Scripts", "python.exe"].iter().collect()
|
||||
} else {
|
||||
["bin", "python"].iter().collect()
|
||||
};
|
||||
let candidate = path.join(&exe);
|
||||
if candidate.is_file() {
|
||||
candidate
|
||||
} else {
|
||||
path.to_path_buf()
|
||||
}
|
||||
}
|
||||
|
||||
/// `pipdock env list`
|
||||
///
|
||||
/// # Errors
|
||||
/// Never fails as a whole: an interpreter that cannot be probed is reported in place rather than
|
||||
/// aborting the listing, because one broken environment must not hide the rest.
|
||||
pub async fn env_list(opts: &GlobalOpts) -> Result<Exit> {
|
||||
let candidates = envs::scan().await;
|
||||
// The interpreters `env add` (or the GUI's Add interpreter…) put on the list, after discovery's
|
||||
// own. A store that cannot be read costs those rows, not the listing.
|
||||
let manual: Vec<PathBuf> = Store::open(&app_data_dir())
|
||||
.and_then(|store| store.manual_envs())
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(|m| PathBuf::from(m.interpreter))
|
||||
.collect();
|
||||
let candidates = envs::scan_with(&manual).await;
|
||||
|
||||
// Through `probe_listed`, as the GUI's `env_scan` goes: an added entry is checked again before
|
||||
// it runs, because what it was when added says nothing about what it is now.
|
||||
let app_data = app_data_dir();
|
||||
let mut rows = Vec::new();
|
||||
for Candidate { path, source } in candidates {
|
||||
let probed = envs::probe(&path, source).await;
|
||||
for candidate in candidates {
|
||||
let probed = envs::probe_listed(&candidate, &app_data).await;
|
||||
let Candidate { path, source } = candidate;
|
||||
rows.push((path, source, probed));
|
||||
}
|
||||
|
||||
@@ -293,20 +299,7 @@ pub async fn env_list(opts: &GlobalOpts) -> Result<Exit> {
|
||||
let payload: Vec<serde_json::Value> = rows
|
||||
.iter()
|
||||
.map(|(path, source, probed)| match probed {
|
||||
Ok(p) => serde_json::json!({
|
||||
"interpreter": path,
|
||||
"source": source,
|
||||
"python": p.env.python_version,
|
||||
"externallyManaged": p.env.externally_managed,
|
||||
"hiddenUserSite": p.env.hidden_user_site,
|
||||
"packages": p.dists.len(),
|
||||
"envHash": envs::env_hash(path),
|
||||
// Same field the GUI's EnvRow carries, out of the same list, so `env list`
|
||||
// and the Environments screen cannot disagree about which pip is installed.
|
||||
"pipVersion": p.dists.iter()
|
||||
.find(|d| d.name.as_str() == "pip")
|
||||
.map(|d| d.version.0.clone()),
|
||||
}),
|
||||
Ok(p) => env_json(path, *source, p),
|
||||
Err(e) => serde_json::json!({
|
||||
"interpreter": path,
|
||||
"source": source,
|
||||
@@ -1020,7 +1013,7 @@ pub fn schema(type_name: &str) -> Result<Exit> {
|
||||
/// `PD-ENV-001` when the path is not a usable interpreter — chosen deliberately over accepting it
|
||||
/// silently, because a default that does not work fails on every later command instead of this one.
|
||||
pub async fn env_use(opts: &GlobalOpts, path: &Path) -> Result<Exit> {
|
||||
let interpreter = interpreter_in(path);
|
||||
let interpreter = envs::validate_interpreter(&envs::interpreter_in(path), &app_data_dir())?;
|
||||
let probed = envs::probe(&interpreter, EnvSource::Manual).await?;
|
||||
let store = Store::open(&app_data_dir())?;
|
||||
|
||||
@@ -1043,6 +1036,110 @@ pub async fn env_use(opts: &GlobalOpts, path: &Path) -> Result<Exit> {
|
||||
Ok(Exit::Success)
|
||||
}
|
||||
|
||||
/// One probed environment as `env list --json` prints it — and `env add --json`, which promises the
|
||||
/// same element, so the two are built here once rather than kept in step by hand.
|
||||
fn env_json(path: &Path, source: EnvSource, probed: &envs::ProbeResult) -> serde_json::Value {
|
||||
serde_json::json!({
|
||||
"interpreter": path,
|
||||
"source": source,
|
||||
"python": probed.env.python_version,
|
||||
"externallyManaged": probed.env.externally_managed,
|
||||
"hiddenUserSite": probed.env.hidden_user_site,
|
||||
"packages": probed.dists.len(),
|
||||
"envHash": envs::env_hash(path),
|
||||
// Same field the GUI's EnvRow carries, out of the same list, so `env list` and the
|
||||
// Environments screen cannot disagree about which pip is installed.
|
||||
"pipVersion": probed.dists.iter()
|
||||
.find(|d| d.name.as_str() == "pip")
|
||||
.map(|d| d.version.0.clone()),
|
||||
})
|
||||
}
|
||||
|
||||
/// `pipdock env add <path>` — the GUI's *Add interpreter…* (PRD P0-1).
|
||||
///
|
||||
/// Validated, probed, then stored, so the list never gains an entry that was refused or broken on
|
||||
/// arrival. `--json` prints the entry in the shape of an `env list --json` element — not always the
|
||||
/// element `env list` will show, which takes the discovered source and spelling when discovery also
|
||||
/// finds the interpreter.
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-ENV-001` when the path is missing, not named like a Python interpreter, or one of PipDock's
|
||||
/// own environments; `PD-ENV-003` when the probe fails; `PD-INT-001` when the store cannot be
|
||||
/// written.
|
||||
pub async fn env_add(opts: &GlobalOpts, path: &Path) -> Result<Exit> {
|
||||
let interpreter = envs::validate_interpreter(&envs::interpreter_in(path), &app_data_dir())?;
|
||||
let probed = envs::probe(&interpreter, EnvSource::Manual).await?;
|
||||
Store::open(&app_data_dir())?.add_manual_env(
|
||||
&envs::env_hash(&interpreter),
|
||||
&interpreter.display().to_string(),
|
||||
&jiff::Timestamp::now().to_string(),
|
||||
)?;
|
||||
|
||||
if opts.json {
|
||||
print_json(&env_json(&interpreter, EnvSource::Manual, &probed));
|
||||
} else if !opts.quiet {
|
||||
println!(
|
||||
"added: {} (Python {})",
|
||||
interpreter.display(),
|
||||
probed.env.python_version
|
||||
);
|
||||
}
|
||||
Ok(Exit::Success)
|
||||
}
|
||||
|
||||
/// `pipdock env remove <path>`
|
||||
///
|
||||
/// Matched by identity, and by the path as stored when the file is gone — a deleted venv cannot be
|
||||
/// canonicalized into the identity it was added under, and it is exactly the entry someone wants
|
||||
/// gone. A directory is matched as the venv whose interpreter it would hold, existing or not:
|
||||
/// `interpreter_in` resolves only what is there, and the first version of this command answered
|
||||
/// "not on the list" for the one case it exists for — found by its own test. Not being on the list
|
||||
/// is not an error: the list is what was asked about, and it is right.
|
||||
///
|
||||
/// What was typed is made absolute first — `env add .venv` stores an absolute path, so `env remove
|
||||
/// .venv` has to compare one, and a relative path never matched (independent review, 1.6.0).
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-INT-001` when the store cannot be read or written.
|
||||
pub fn env_remove(opts: &GlobalOpts, path: &Path) -> Result<Exit> {
|
||||
let store = Store::open(&app_data_dir())?;
|
||||
let absolute = |p: PathBuf| std::path::absolute(&p).unwrap_or(p);
|
||||
let interpreter = absolute(envs::interpreter_in(path));
|
||||
let candidates = [interpreter.clone(), absolute(envs::venv_interpreter(path))];
|
||||
let entry = store.manual_envs()?.into_iter().find(|m| {
|
||||
candidates
|
||||
.iter()
|
||||
.any(|c| m.env_hash == envs::env_hash(c) || same_path(&m.interpreter, c))
|
||||
});
|
||||
let removed = match &entry {
|
||||
Some(m) => store.remove_manual_env(&m.env_hash, &m.interpreter)?,
|
||||
None => false,
|
||||
};
|
||||
let shown = entry.map_or_else(|| interpreter.display().to_string(), |m| m.interpreter);
|
||||
|
||||
if opts.json {
|
||||
print_json(&serde_json::json!({ "interpreter": shown, "removed": removed }));
|
||||
} else if !opts.quiet {
|
||||
if removed {
|
||||
println!("removed from the list: {shown} (nothing on disk was changed)");
|
||||
} else {
|
||||
println!("not on the list: {shown}");
|
||||
}
|
||||
}
|
||||
Ok(Exit::Success)
|
||||
}
|
||||
|
||||
/// Whether a stored path and a typed one name the same file, without asking the file system —
|
||||
/// which, for a deleted venv, has nothing to say. Case-insensitive on Windows (invariant 9).
|
||||
fn same_path(stored: &str, typed: &Path) -> bool {
|
||||
let stored = Path::new(stored);
|
||||
if cfg!(windows) {
|
||||
stored.as_os_str().eq_ignore_ascii_case(typed.as_os_str())
|
||||
} else {
|
||||
stored == typed
|
||||
}
|
||||
}
|
||||
|
||||
/// `pipdock tools sync`
|
||||
///
|
||||
/// The re-sync `PD-HLT-001`'s shipped copy already tells users to run — until now there was no way
|
||||
@@ -2270,8 +2367,20 @@ mod tests {
|
||||
#[test]
|
||||
fn an_env_directory_resolves_to_its_interpreter() {
|
||||
// CLI-SPEC §2 accepts "interpreter or env dir"; a non-existent path is passed through so
|
||||
// the probe reports PD-ENV-001 against what the user actually typed.
|
||||
// the validator reports PD-ENV-001 against what the user actually typed.
|
||||
let missing = Path::new("definitely-not-here");
|
||||
assert_eq!(interpreter_in(missing), missing);
|
||||
assert_eq!(envs::interpreter_in(missing), missing);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_stored_path_matches_what_was_typed_in_any_case_on_windows() {
|
||||
let stored = r"D:\work\proj\myenv\Scripts\python.exe";
|
||||
assert!(same_path(stored, Path::new(stored)));
|
||||
assert_eq!(
|
||||
same_path(stored, Path::new(&stored.to_lowercase())),
|
||||
cfg!(windows),
|
||||
"case-folded on Windows only"
|
||||
);
|
||||
assert!(!same_path(stored, Path::new(r"D:\work\other\python.exe")));
|
||||
}
|
||||
}
|
||||
@@ -154,6 +154,8 @@ fn subcommand_help_is_stable() {
|
||||
for (parent, child) in [
|
||||
("env", "list"),
|
||||
("env", "use"),
|
||||
("env", "add"),
|
||||
("env", "remove"),
|
||||
("pin", "add"),
|
||||
("pin", "remove"),
|
||||
("pin", "list"),
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
//! `env add`, `env remove` and `env list` over the list the GUI's *Add interpreter…* shares (1.6.0).
|
||||
//!
|
||||
//! The paths that need no Python, which are the ones a refactor is likeliest to break unseen: a
|
||||
//! file that is not an interpreter is refused before anything runs it and nothing is stored; an
|
||||
//! added interpreter whose file has since gone is still listed — with `PD-ENV-001`, because that is
|
||||
//! the row a person needs in order to remove it — and is removed by the path it was added under.
|
||||
//! A stored entry, or a stored default, that is no longer a Python is checked again and never run.
|
||||
//! The success path of `env add` probes a real interpreter, which `ci-integration.yml` has.
|
||||
//!
|
||||
//! Each test has an app-data root of its own: the store is a file, and tests run in parallel.
|
||||
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use assert_cmd::Command;
|
||||
use pipdock_core::store::Store;
|
||||
|
||||
fn scratch(tag: &str) -> PathBuf {
|
||||
let dir = std::env::temp_dir().join(format!("pd-manual-{tag}-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
std::fs::create_dir_all(&dir).expect("create scratch dir");
|
||||
dir
|
||||
}
|
||||
|
||||
/// `%LOCALAPPDATA%\PipDock\data`, as the binary will compute it from `LOCALAPPDATA`.
|
||||
fn app_data(local: &Path) -> PathBuf {
|
||||
local
|
||||
.join(pipdock_core::APP_DATA_DIR_NAME)
|
||||
.join(pipdock_core::APP_DATA_SUBDIR)
|
||||
}
|
||||
|
||||
fn pipdock(local: &Path) -> Command {
|
||||
let mut cmd = Command::cargo_bin("pipdock").expect("the `pipdock` binary builds");
|
||||
cmd.env("NO_COLOR", "1")
|
||||
.env("COLUMNS", "100")
|
||||
.env("LOCALAPPDATA", local);
|
||||
cmd
|
||||
}
|
||||
|
||||
fn manual_rows(local: &Path) -> Vec<serde_json::Value> {
|
||||
let out = pipdock(local)
|
||||
.args(["env", "list", "--json"])
|
||||
.output()
|
||||
.expect("runs");
|
||||
assert!(out.status.success(), "env list exits 0");
|
||||
let all: Vec<serde_json::Value> =
|
||||
serde_json::from_slice(&out.stdout).expect("env list --json is one JSON document");
|
||||
all.into_iter()
|
||||
.filter(|row| row["source"] == "manual")
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn another_program_is_refused_before_it_runs_and_nothing_is_stored() {
|
||||
let local = scratch("refused");
|
||||
let other = local.join(if cfg!(windows) {
|
||||
"notepad.exe"
|
||||
} else {
|
||||
"notepad"
|
||||
});
|
||||
std::fs::write(&other, "").expect("an empty file that is not Python");
|
||||
|
||||
let out = pipdock(&local)
|
||||
.args(["env", "add"])
|
||||
.arg(&other)
|
||||
.output()
|
||||
.expect("runs");
|
||||
assert_eq!(
|
||||
out.status.code(),
|
||||
Some(3),
|
||||
"PD-ENV-001 is an environment error"
|
||||
);
|
||||
let stderr = String::from_utf8_lossy(&out.stderr);
|
||||
assert!(stderr.contains("error[PD-ENV-001]"), "{stderr}");
|
||||
assert!(stderr.contains("is not a Python interpreter"), "{stderr}");
|
||||
let store = Store::open(&app_data(&local)).expect("the store opens");
|
||||
assert!(
|
||||
store.manual_envs().expect("reads").is_empty(),
|
||||
"a refused path is never listed"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_entry_whose_file_is_gone_is_listed_with_its_error_and_removed_by_its_path() {
|
||||
let local = scratch("gone");
|
||||
let gone = local
|
||||
.join("deleted-venv")
|
||||
.join("Scripts")
|
||||
.join("python.exe");
|
||||
{
|
||||
let store = Store::open(&app_data(&local)).expect("the store opens");
|
||||
store
|
||||
.add_manual_env(
|
||||
&pipdock_core::envs::env_hash(&gone),
|
||||
&gone.display().to_string(),
|
||||
"2026-11-21T00:00:00Z",
|
||||
)
|
||||
.expect("added, as a venv later deleted would have been");
|
||||
}
|
||||
|
||||
let rows = manual_rows(&local);
|
||||
assert_eq!(rows.len(), 1, "{rows:?}");
|
||||
assert_eq!(rows[0]["interpreter"], gone.display().to_string());
|
||||
assert_eq!(rows[0]["error"]["code"], "PD-ENV-001");
|
||||
|
||||
// By the environment directory, as a person would type it: the file cannot be canonicalized
|
||||
// any more, so the stored path is what matches.
|
||||
let venv = local.join("deleted-venv");
|
||||
let out = pipdock(&local)
|
||||
.args(["env", "remove"])
|
||||
.arg(&venv)
|
||||
.output()
|
||||
.expect("runs");
|
||||
assert!(out.status.success());
|
||||
let stdout = String::from_utf8_lossy(&out.stdout);
|
||||
assert!(stdout.contains("removed from the list"), "{stdout}");
|
||||
assert!(manual_rows(&local).is_empty(), "gone from the listing");
|
||||
|
||||
// Removing it again is not an error: the list is right.
|
||||
let out = pipdock(&local)
|
||||
.args(["env", "remove", "--json"])
|
||||
.arg(&gone)
|
||||
.output()
|
||||
.expect("runs");
|
||||
assert!(out.status.success());
|
||||
let doc: serde_json::Value = serde_json::from_slice(&out.stdout).expect("one JSON document");
|
||||
assert_eq!(doc["removed"], false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_entry_is_removed_by_a_relative_path_typed_where_it_lives() {
|
||||
// `env add .venv` stores an absolute path; `env remove .venv`, typed in the same folder, has to
|
||||
// reach it. Relative text never matched before the path was made absolute.
|
||||
let local = scratch("relative");
|
||||
let stored = local.join("rel-venv").join("Scripts").join("python.exe");
|
||||
{
|
||||
let store = Store::open(&app_data(&local)).expect("the store opens");
|
||||
store
|
||||
.add_manual_env(
|
||||
&pipdock_core::envs::env_hash(&stored),
|
||||
&stored.display().to_string(),
|
||||
"2026-11-21T00:00:00Z",
|
||||
)
|
||||
.expect("added");
|
||||
}
|
||||
let out = pipdock(&local)
|
||||
.current_dir(&local)
|
||||
.args(["env", "remove", "rel-venv", "--json"])
|
||||
.output()
|
||||
.expect("runs");
|
||||
assert!(out.status.success());
|
||||
let doc: serde_json::Value = serde_json::from_slice(&out.stdout).expect("one JSON document");
|
||||
assert_eq!(doc["removed"], true, "{doc}");
|
||||
let store = Store::open(&app_data(&local)).expect("the store opens");
|
||||
assert!(store.manual_envs().expect("reads").is_empty());
|
||||
}
|
||||
|
||||
/// An empty file named like another program, which nothing should ever run.
|
||||
fn not_python(local: &Path) -> PathBuf {
|
||||
let other = local.join(if cfg!(windows) {
|
||||
"notepad.exe"
|
||||
} else {
|
||||
"notepad"
|
||||
});
|
||||
std::fs::write(&other, "").expect("an empty file that is not Python");
|
||||
other
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_added_entry_that_is_no_longer_python_is_listed_with_its_error_and_never_run() {
|
||||
// What the file was when it was added says nothing about what it is now: a `python.exe` that is
|
||||
// a link can be pointed at another program. Written to the store directly, since no `env add`
|
||||
// would accept it — which is the point: the listing is checked on its own account.
|
||||
let local = scratch("relisted");
|
||||
let other = not_python(&local);
|
||||
{
|
||||
let store = Store::open(&app_data(&local)).expect("the store opens");
|
||||
store
|
||||
.add_manual_env(
|
||||
&pipdock_core::envs::env_hash(&other),
|
||||
&other.display().to_string(),
|
||||
"2026-11-21T00:00:00Z",
|
||||
)
|
||||
.expect("stored");
|
||||
}
|
||||
|
||||
let rows = manual_rows(&local);
|
||||
assert_eq!(
|
||||
rows.len(),
|
||||
1,
|
||||
"still listed, so it can be removed: {rows:?}"
|
||||
);
|
||||
assert_eq!(rows[0]["error"]["code"], "PD-ENV-001");
|
||||
let message = rows[0]["error"]["message"].as_str().unwrap_or_default();
|
||||
assert!(message.contains("is not a Python interpreter"), "{message}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_default_that_is_not_python_is_skipped_with_a_warning() {
|
||||
// `env use` checked nothing before 1.6.0, so a stored default can name any file.
|
||||
let local = scratch("default");
|
||||
let other = not_python(&local);
|
||||
{
|
||||
let store = Store::open(&app_data(&local)).expect("the store opens");
|
||||
store
|
||||
.remember_env(
|
||||
&pipdock_core::envs::env_hash(&other),
|
||||
&other.display().to_string(),
|
||||
"2026-11-21T00:00:00Z",
|
||||
true,
|
||||
)
|
||||
.expect("stored");
|
||||
}
|
||||
let empty = local.join("no-venv-here");
|
||||
std::fs::create_dir_all(&empty).expect("a folder with nothing to fall back to");
|
||||
|
||||
let out = pipdock(&local)
|
||||
.current_dir(&empty)
|
||||
.arg("list")
|
||||
.output()
|
||||
.expect("runs");
|
||||
let stderr = String::from_utf8_lossy(&out.stderr);
|
||||
assert_eq!(out.status.code(), Some(3), "{stderr}");
|
||||
assert!(
|
||||
stderr.contains("warning: the default environment is not used"),
|
||||
"{stderr}"
|
||||
);
|
||||
assert!(stderr.contains("is not a Python interpreter"), "{stderr}");
|
||||
assert!(stderr.contains("error[PD-ENV-001]"), "{stderr}");
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: crates/pipdock-cli/tests/golden.rs
|
||||
expression: "stdout_of(&[parent, child, \"--help\"])"
|
||||
---
|
||||
Add an interpreter discovery does not find to the list (the GUI's Add interpreter…)
|
||||
|
||||
Usage: pipdock env add [OPTIONS] <PATH>
|
||||
|
||||
Arguments:
|
||||
<PATH>
|
||||
Interpreter or environment directory
|
||||
|
||||
Options:
|
||||
--env <PATH>
|
||||
Interpreter or environment directory. Defaults to the one `env use` set, else an auto-detected `.venv` in the working directory
|
||||
|
||||
--engine <ENGINE>
|
||||
Override the configured engine for this invocation
|
||||
|
||||
Possible values:
|
||||
- pip: `<python> -m pip`
|
||||
- uv: `uv pip --python <python>`
|
||||
|
||||
--json
|
||||
Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6).
|
||||
|
||||
Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents.
|
||||
|
||||
-y, --yes
|
||||
Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces
|
||||
|
||||
--quiet
|
||||
Do not stream engine output to stderr. (The log file is written regardless.)
|
||||
|
||||
--verbose
|
||||
Also write the log to stderr, at debug level
|
||||
|
||||
--log-file <PATH>
|
||||
Also write the log to this file. The daily log in `data\logs\` is always kept
|
||||
|
||||
--no-snapshot
|
||||
DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning.
|
||||
|
||||
This is the sole documented escape from DATA-FLOW §9.2, and it exists because a throwaway CI container has nothing to roll back to.
|
||||
|
||||
-h, --help
|
||||
Print help (see a summary with '-h')
|
||||
@@ -2,7 +2,7 @@
|
||||
source: crates/pipdock-cli/tests/golden.rs
|
||||
expression: "stdout_of(&[parent, child, \"--help\"])"
|
||||
---
|
||||
List discovered environments, their sources and PEP 668 flags
|
||||
List discovered environments and the ones added with `env add`, their sources and PEP 668 flags
|
||||
|
||||
Usage: pipdock env list [OPTIONS]
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: crates/pipdock-cli/tests/golden.rs
|
||||
expression: "stdout_of(&[parent, child, \"--help\"])"
|
||||
---
|
||||
Take an interpreter added with `env add` off the list. Nothing on disk is touched
|
||||
|
||||
Usage: pipdock env remove [OPTIONS] <PATH>
|
||||
|
||||
Arguments:
|
||||
<PATH>
|
||||
Interpreter or environment directory, as it was added
|
||||
|
||||
Options:
|
||||
--env <PATH>
|
||||
Interpreter or environment directory. Defaults to the one `env use` set, else an auto-detected `.venv` in the working directory
|
||||
|
||||
--engine <ENGINE>
|
||||
Override the configured engine for this invocation
|
||||
|
||||
Possible values:
|
||||
- pip: `<python> -m pip`
|
||||
- uv: `uv pip --python <python>`
|
||||
|
||||
--json
|
||||
Machine-readable output: exactly one JSON document on stdout (CLI-SPEC §6).
|
||||
|
||||
Prompts, warnings and engine output go to stderr. This said "NDJSON for streaming commands" until [VERSION], when several commands printed several documents.
|
||||
|
||||
-y, --yes
|
||||
Assume the default at every prompt: a held-back package keeps its compatible version and an impossible one is skipped. Only `--strategy latest` forces
|
||||
|
||||
--quiet
|
||||
Do not stream engine output to stderr. (The log file is written regardless.)
|
||||
|
||||
--verbose
|
||||
Also write the log to stderr, at debug level
|
||||
|
||||
--log-file <PATH>
|
||||
Also write the log to this file. The daily log in `data\logs\` is always kept
|
||||
|
||||
--no-snapshot
|
||||
DANGEROUS: skip the pre-batch snapshot. CI images only; prints a warning.
|
||||
|
||||
This is the sole documented escape from DATA-FLOW §9.2, and it exists because a throwaway CI container has nothing to roll back to.
|
||||
|
||||
-h, --help
|
||||
Print help (see a summary with '-h')
|
||||
@@ -7,9 +7,11 @@ Manage environments
|
||||
Usage: pipdock env [OPTIONS] <COMMAND>
|
||||
|
||||
Commands:
|
||||
list List discovered environments, their sources and PEP 668 flags
|
||||
use Set the default environment
|
||||
help Print this message or the help of the given subcommand(s)
|
||||
list List discovered environments and the ones added with `env add`, their sources and PEP 668 flags
|
||||
use Set the default environment
|
||||
add Add an interpreter discovery does not find to the list (the GUI's Add interpreter…)
|
||||
remove Take an interpreter added with `env add` off the list. Nothing on disk is touched
|
||||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
--env <PATH>
|
||||
|
||||
@@ -21,7 +21,7 @@ async-trait = "0.1.92"
|
||||
jiff = { version = "0.2.38", features = ["serde"] }
|
||||
nucleo = "0.5.0"
|
||||
reqwest = { version = "0.13.5", default-features = false, features = ["rustls", "http2", "json", "gzip", "charset"] }
|
||||
rusqlite = { version = "0.41.1", features = ["bundled"] }
|
||||
rusqlite = { version = "0.43.0", features = ["bundled"] }
|
||||
schemars = "1.2.3"
|
||||
serde = { version = "1.0.229", features = ["derive"] }
|
||||
serde_json = "1.0.154"
|
||||
|
||||
@@ -47,7 +47,9 @@ pub struct ProbeResult {
|
||||
|
||||
/// Identity of an environment: SHA-256 of the canonicalized interpreter path (ARCHITECTURE §6).
|
||||
///
|
||||
/// Case-folded on Windows — see the SP-6 note above. This value keys the pin store, the snapshot
|
||||
/// Case-folded on Windows — see the SP-6 note above. Links are resolved, except that a venv's own
|
||||
/// interpreter is resolved only up to its folder (since 1.6.0, [`canonical_interpreter`] says why):
|
||||
/// a `--symlinks` venv is not the Python it was made from. This value keys the pin store, the snapshot
|
||||
/// directory and the recents list, so a change here orphans a user's data.
|
||||
#[must_use]
|
||||
pub fn env_hash(interpreter: &Path) -> String {
|
||||
@@ -211,8 +213,159 @@ pub struct Candidate {
|
||||
/// Sources are queried independently and merged by canonical identity, so a Chocolatey shim and
|
||||
/// the installation it points at collapse into one entry (SP-6). The **first** source to report a
|
||||
/// path wins, and sources are ordered so the more authoritative one is asked first.
|
||||
///
|
||||
/// Discovery alone: interpreters a person added are not here. Code Health's choice of a Python to
|
||||
/// build its tools venv with reads this, and should choose among installations, not among whatever
|
||||
/// the user pointed the Environments screen at.
|
||||
pub async fn scan() -> Vec<Candidate> {
|
||||
scan_reporting(&|_| {}).await
|
||||
scan_reporting(&[], &|_| {}).await
|
||||
}
|
||||
|
||||
/// Discovery plus the interpreters a person added (*Browse…*, `pipdock env add`), for the two
|
||||
/// listings — the Environments screen and `pipdock env list`.
|
||||
pub async fn scan_with(manual: &[PathBuf]) -> Vec<Candidate> {
|
||||
scan_reporting(manual, &|_| {}).await
|
||||
}
|
||||
|
||||
/// Refuse an interpreter path a person supplied before anything runs it (SECURITY §2).
|
||||
///
|
||||
/// Discovery finds interpreters where Python installs them. A path from *Browse…*, `pipdock env
|
||||
/// add`, `env use` or `--env` can name anything, and the probe **runs** the file — so this is the
|
||||
/// enforcement point, not the picker, which only suggests:
|
||||
///
|
||||
/// - it must exist and be a file, or there is nothing to probe;
|
||||
/// - its name must be `python.exe`, `python3.exe`, `python3.12.exe` or the free-threaded
|
||||
/// `python3.14t.exe` (`python`, `python3`, … off
|
||||
/// Windows), so that adding an interpreter is not a way to start any program with PipDock's
|
||||
/// arguments. `pythonw.exe` is refused too: it has no console, the probe's output would be empty,
|
||||
/// and the failure would read as a broken environment instead of the wrong file;
|
||||
/// - it must not be one of PipDock's own environments — Code Health's tools venv or the Security
|
||||
/// tab's audit venv — which PipDock builds and replaces itself, and which a user's update would
|
||||
/// quietly break. The check is on resolved paths too, or `..` or a link would walk past it.
|
||||
///
|
||||
/// **Returns the path as given, made absolute — never with its links resolved.** A venv made with
|
||||
/// `--symlinks` has a `Scripts\python.exe` that is a link to the base interpreter, and running the
|
||||
/// *link* is what makes Python find the venv's `pyvenv.cfg`. The first version returned the
|
||||
/// canonical path, so `--env .venv` ran — and *Add interpreter…* stored — the base Python instead
|
||||
/// of the venv: an update meant for a project would have changed the system's Python. Found by an
|
||||
/// independent review of 1.6.0 and reproduced before fixing. Where the link really points is still
|
||||
/// checked: a `python.exe` that links to another program is another program, and is refused.
|
||||
///
|
||||
/// A Microsoft Store app-execution alias (`%LOCALAPPDATA%\Microsoft\WindowsApps\python.exe`) is a
|
||||
/// file Windows will not resolve at all (os error 1920); it is judged by its own path, and accepted,
|
||||
/// as discovery has always listed it.
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-ENV-001` for each refusal, the message saying which. A missing file reads exactly as the
|
||||
/// probe's own "no interpreter at …", so a caller that validates first changes no output.
|
||||
pub fn validate_interpreter(path: &Path, app_data: &Path) -> Result<PathBuf> {
|
||||
use crate::health::project::plain;
|
||||
let refuse = |why: String| PdError::new(Code::EnvInterpreterMissing, why);
|
||||
if !path.is_file() {
|
||||
return Err(refuse(format!("no interpreter at {}", path.display())));
|
||||
}
|
||||
if !is_python_name(path) {
|
||||
return Err(refuse(format!(
|
||||
"{} is not a Python interpreter PipDock will run: the file has to be python.exe \
|
||||
(or python3.exe, python3.12.exe, python3.14t.exe)",
|
||||
path.display()
|
||||
)));
|
||||
}
|
||||
let absolute = std::path::absolute(path)
|
||||
.map(plain)
|
||||
.map_err(|e| refuse(format!("cannot read {}: {e}", path.display())))?;
|
||||
let target = path.canonicalize().map(plain).ok();
|
||||
if let Some(target) = &target
|
||||
&& !is_python_name(target)
|
||||
{
|
||||
return Err(refuse(format!(
|
||||
"{} leads to {}, which is not a Python interpreter PipDock will run",
|
||||
path.display(),
|
||||
target.display()
|
||||
)));
|
||||
}
|
||||
let own_dirs: Vec<PathBuf> = [
|
||||
crate::health::tools_dir(app_data),
|
||||
crate::health::audit_dir(app_data),
|
||||
]
|
||||
.iter()
|
||||
.flat_map(|dir| {
|
||||
[
|
||||
dir.canonicalize().map(plain).ok(),
|
||||
std::path::absolute(dir).map(plain).ok(),
|
||||
]
|
||||
})
|
||||
.flatten()
|
||||
.collect();
|
||||
let inside_own = |p: &Path| own_dirs.iter().any(|own| p.starts_with(own));
|
||||
if inside_own(&absolute) || target.as_deref().is_some_and(inside_own) {
|
||||
return Err(refuse(format!(
|
||||
"{} is one of PipDock's own environments, which it manages itself",
|
||||
path.display()
|
||||
)));
|
||||
}
|
||||
Ok(absolute)
|
||||
}
|
||||
|
||||
/// `python`, `python3` or `python3.12`, with `.exe` on Windows; any case. A version may end in `t`,
|
||||
/// the free-threaded build's name (`python3.14t.exe`, PEP 703) — the python.org installer puts one
|
||||
/// beside `python.exe`, and the registry reports it; refusing it was found by running `env list`
|
||||
/// against this machine's own Pythons.
|
||||
fn is_python_name(path: &Path) -> bool {
|
||||
let Some(name) = path.file_name().and_then(|n| n.to_str()) else {
|
||||
return false;
|
||||
};
|
||||
let name = name.to_ascii_lowercase();
|
||||
let stem = if cfg!(windows) {
|
||||
match name.strip_suffix(".exe") {
|
||||
Some(stem) => stem,
|
||||
None => return false,
|
||||
}
|
||||
} else {
|
||||
name.as_str()
|
||||
};
|
||||
let Some(version) = stem.strip_prefix("python") else {
|
||||
return false;
|
||||
};
|
||||
let version = match version.strip_suffix('t') {
|
||||
Some(threaded) if !threaded.is_empty() => threaded,
|
||||
_ => version,
|
||||
};
|
||||
version.is_empty()
|
||||
|| (version.split('.').count() <= 2
|
||||
&& version
|
||||
.split('.')
|
||||
.all(|part| !part.is_empty() && part.bytes().all(|b| b.is_ascii_digit())))
|
||||
}
|
||||
|
||||
/// An interpreter path, or the interpreter inside an environment directory (CLI-SPEC §2).
|
||||
///
|
||||
/// `<dir>\Scripts\python.exe` on Windows, `<dir>/bin/python` elsewhere; anything else comes back
|
||||
/// unchanged, for [`validate_interpreter`] to refuse with the path the person gave.
|
||||
#[must_use]
|
||||
pub fn interpreter_in(path: &Path) -> PathBuf {
|
||||
if path.is_file() {
|
||||
return path.to_path_buf();
|
||||
}
|
||||
let candidate = venv_interpreter(path);
|
||||
if candidate.is_file() {
|
||||
candidate
|
||||
} else {
|
||||
path.to_path_buf()
|
||||
}
|
||||
}
|
||||
|
||||
/// Where a virtual environment's interpreter is, whether or not it is there: `<dir>\Scripts\python.exe`
|
||||
/// on Windows, `<dir>/bin/python` elsewhere. `pipdock env remove <dir>` needs the answer for a venv
|
||||
/// that has been deleted — exactly the entry someone wants gone, and one [`interpreter_in`] can no
|
||||
/// longer resolve.
|
||||
#[must_use]
|
||||
pub fn venv_interpreter(dir: &Path) -> PathBuf {
|
||||
if cfg!(windows) {
|
||||
dir.join("Scripts").join("python.exe")
|
||||
} else {
|
||||
dir.join("bin").join("python")
|
||||
}
|
||||
}
|
||||
|
||||
/// Where a discovery sweep currently is.
|
||||
@@ -260,11 +413,21 @@ pub enum ScanPhase {
|
||||
/// How many sources a sweep reads, for the `total` a caller renders against.
|
||||
const SCAN_SOURCES: usize = 5;
|
||||
|
||||
/// Discover environments, reporting progress as each source is read.
|
||||
/// Discover environments, reporting progress as each source is read, and append the interpreters a
|
||||
/// person added.
|
||||
///
|
||||
/// `manual` comes last, so an interpreter discovery also finds keeps the discovered source — the
|
||||
/// chip says where Python put it, which is the more useful fact. Unlike every discovered path, a
|
||||
/// manual one is kept **when its file is gone**: dropping it would make an entry the user added
|
||||
/// vanish without a word, and with no row there would be nothing to remove it from. Its probe then
|
||||
/// fails with `PD-ENV-001`, whose remedy is exactly that removal.
|
||||
///
|
||||
/// The callback is synchronous and must not block: it is called between sources, on the task
|
||||
/// driving the scan.
|
||||
pub async fn scan_reporting(report: &(dyn Fn(ScanProgress) + Sync)) -> Vec<Candidate> {
|
||||
pub async fn scan_reporting(
|
||||
manual: &[PathBuf],
|
||||
report: &(dyn Fn(ScanProgress) + Sync),
|
||||
) -> Vec<Candidate> {
|
||||
let step = |phase: ScanPhase, done: usize| ScanProgress {
|
||||
phase,
|
||||
done,
|
||||
@@ -299,8 +462,69 @@ pub async fn scan_reporting(report: &(dyn Fn(ScanProgress) + Sync)) -> Vec<Candi
|
||||
.or_insert(Candidate { path, source });
|
||||
}
|
||||
}
|
||||
merge_manual(found, manual)
|
||||
}
|
||||
|
||||
found.into_values().collect()
|
||||
/// Discovered candidates in canonical order, then the manual ones no source already reported, in
|
||||
/// the order they were added.
|
||||
///
|
||||
/// Compared by the path as listed — made absolute, case-folded on Windows — and **not** by
|
||||
/// [`canonical_interpreter`]: the first version compared identities, and while identity still
|
||||
/// followed a venv's link, a venv made with `--symlinks` collapsed into the base interpreter its
|
||||
/// `python.exe` points at and the venv a person added was never listed. Identity resolves other
|
||||
/// links still, and what a person added is listed as they added it.
|
||||
fn merge_manual(found: BTreeMap<String, Candidate>, manual: &[PathBuf]) -> Vec<Candidate> {
|
||||
let mut out: Vec<Candidate> = found.into_values().collect();
|
||||
let mut seen: std::collections::HashSet<String> =
|
||||
out.iter().map(|c| listing_key(&c.path)).collect();
|
||||
for path in manual {
|
||||
if seen.insert(listing_key(path)) {
|
||||
out.push(Candidate {
|
||||
path: path.clone(),
|
||||
source: EnvSource::Manual,
|
||||
});
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// A path as a listing compares it: absolute, case-folded on Windows, links left alone.
|
||||
fn listing_key(path: &Path) -> String {
|
||||
let absolute = std::path::absolute(path).unwrap_or_else(|_| path.to_path_buf());
|
||||
let text = absolute.display().to_string();
|
||||
if cfg!(windows) {
|
||||
text.to_lowercase()
|
||||
} else {
|
||||
text
|
||||
}
|
||||
}
|
||||
|
||||
/// Probe a candidate a listing returned — the one place both heads decide what a listing runs.
|
||||
///
|
||||
/// An added interpreter goes through [`validate_interpreter`] again on **every** listing, not only
|
||||
/// on the day it was added: that check said what the file was then, and a `python.exe` that is a
|
||||
/// link can be pointed at another program afterwards. `env_scan` and `env list` probed stored
|
||||
/// entries unchecked until an independent review of 1.6.0 said so. A discovered path is probed as
|
||||
/// found — discovery read it from where Python installs interpreters, and no person typed it.
|
||||
///
|
||||
/// # Errors
|
||||
/// What [`validate_interpreter`] or [`probe`] reports: `PD-ENV-001` for a file that is gone (in the
|
||||
/// probe's own words) or is not a Python PipDock will run, `PD-ENV-003` for a probe that fails.
|
||||
pub async fn probe_listed(candidate: &Candidate, app_data: &Path) -> Result<ProbeResult> {
|
||||
if candidate.source == EnvSource::Manual {
|
||||
let path = candidate.path.clone();
|
||||
let app_data = app_data.to_path_buf();
|
||||
// On a blocking thread: the check reads the file system (`rust:S7493`).
|
||||
tokio::task::spawn_blocking(move || validate_interpreter(&path, &app_data))
|
||||
.await
|
||||
.map_err(|e| {
|
||||
PdError::new(
|
||||
Code::IntUnexpected,
|
||||
format!("interpreter check stopped: {e}"),
|
||||
)
|
||||
})??;
|
||||
}
|
||||
probe(&candidate.path, candidate.source).await
|
||||
}
|
||||
|
||||
/// PEP 514 registry entries: `HKCU`, and both views of `HKLM`.
|
||||
@@ -465,6 +689,223 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
fn scratch(name: &str) -> PathBuf {
|
||||
let dir = std::env::temp_dir().join(format!("pd-envs-{name}-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
std::fs::create_dir_all(&dir).expect("create scratch dir");
|
||||
dir
|
||||
}
|
||||
|
||||
/// An empty file at `dir/rel`, which is all [`validate_interpreter`] looks at — it never runs it.
|
||||
fn touch(dir: &Path, rel: &str) -> PathBuf {
|
||||
let path = dir.join(rel);
|
||||
std::fs::create_dir_all(path.parent().expect("a parent")).expect("parents");
|
||||
std::fs::write(&path, "").expect("write");
|
||||
path
|
||||
}
|
||||
|
||||
fn exe(stem: &str) -> String {
|
||||
if cfg!(windows) {
|
||||
format!("{stem}.exe")
|
||||
} else {
|
||||
stem.to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_a_file_named_like_python_is_accepted() {
|
||||
// The free-threaded build (PEP 703) is `python3.14t.exe`, beside `python.exe` in the same
|
||||
// install — the registry lists it on this repository's own reference machine.
|
||||
for name in [
|
||||
"python",
|
||||
"PYTHON",
|
||||
"python3",
|
||||
"python3.12",
|
||||
"Python3.14",
|
||||
"python3.14t",
|
||||
"python3t",
|
||||
] {
|
||||
assert!(is_python_name(Path::new(&exe(name))), "{name}");
|
||||
}
|
||||
// pythonw has no console; the rest are other programs, or versions that are not versions.
|
||||
for name in [
|
||||
"pythonw",
|
||||
"pythonw3.14t",
|
||||
"pythont",
|
||||
"python3.14tt",
|
||||
"notepad",
|
||||
"py",
|
||||
"python3.12.1",
|
||||
"python3.",
|
||||
"python.3",
|
||||
"python3x",
|
||||
"mypython",
|
||||
] {
|
||||
assert!(!is_python_name(Path::new(&exe(name))), "{name}");
|
||||
}
|
||||
if cfg!(windows) {
|
||||
assert!(
|
||||
!is_python_name(Path::new("python.bat")),
|
||||
"a script is not an exe"
|
||||
);
|
||||
assert!(
|
||||
!is_python_name(Path::new("python")),
|
||||
"Windows needs the .exe"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_missing_interpreter_reads_exactly_as_the_probe_says_it() {
|
||||
// The CLI's error-envelope goldens pin this sentence for `--env C:/definitely/not/here`.
|
||||
let err = validate_interpreter(Path::new("C:/definitely/not/here"), &scratch("missing"))
|
||||
.expect_err("nothing there");
|
||||
assert_eq!(err.code, Code::EnvInterpreterMissing);
|
||||
assert_eq!(err.message, "no interpreter at C:/definitely/not/here");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn another_program_is_refused_before_anything_runs_it() {
|
||||
let dir = scratch("other");
|
||||
let notepad = touch(&dir, &exe("notepad"));
|
||||
let err = validate_interpreter(¬epad, &dir.join("data")).expect_err("not python");
|
||||
assert_eq!(err.code, Code::EnvInterpreterMissing);
|
||||
assert!(
|
||||
err.message.contains("is not a Python interpreter"),
|
||||
"{}",
|
||||
err.message
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_python_is_accepted_and_comes_back_absolute_and_plain() {
|
||||
let dir = scratch("ok");
|
||||
let python = touch(&dir, &format!("proj/.venv/Scripts/{}", exe("python")));
|
||||
let got = validate_interpreter(&python, &dir.join("data")).expect("a python");
|
||||
assert!(
|
||||
!got.display().to_string().starts_with(r"\\?\"),
|
||||
"no verbatim prefix: {}",
|
||||
got.display()
|
||||
);
|
||||
assert_eq!(got, std::path::absolute(&python).expect("absolute"));
|
||||
}
|
||||
|
||||
/// A link, or `None` where this machine may not make one (Windows without Developer Mode).
|
||||
fn link(target: &Path, at: &Path) -> Option<()> {
|
||||
std::fs::create_dir_all(at.parent().expect("a parent")).expect("parents");
|
||||
#[cfg(windows)]
|
||||
let made = std::os::windows::fs::symlink_file(target, at);
|
||||
#[cfg(not(windows))]
|
||||
let made = std::os::unix::fs::symlink(target, at);
|
||||
made.ok()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_symlinked_venv_keeps_its_own_path_and_a_link_to_another_program_is_refused() {
|
||||
// `python -m venv --symlinks`: the venv's python.exe links to the base interpreter, and
|
||||
// only running the link finds the venv. Resolving it handed back — and stored — the base.
|
||||
let dir = scratch("links");
|
||||
let base = touch(&dir, &format!("base/{}", exe("python")));
|
||||
let venv_python = dir.join("venv").join("Scripts").join(exe("python"));
|
||||
let Some(()) = link(&base, &venv_python) else {
|
||||
eprintln!("skipped: this machine cannot create symbolic links");
|
||||
return;
|
||||
};
|
||||
let got = validate_interpreter(&venv_python, &dir.join("data")).expect("a python");
|
||||
assert_eq!(got, std::path::absolute(&venv_python).expect("absolute"));
|
||||
assert_ne!(
|
||||
got,
|
||||
std::path::absolute(&base).expect("absolute"),
|
||||
"not the base"
|
||||
);
|
||||
|
||||
// A python.exe that is really another program is still another program.
|
||||
let other = touch(&dir, &format!("tools/{}", exe("notepad")));
|
||||
let disguised = dir.join("disguise").join(exe("python"));
|
||||
link(&other, &disguised).expect("links work here");
|
||||
let err = validate_interpreter(&disguised, &dir.join("data")).expect_err("not python");
|
||||
assert!(err.message.contains("leads to"), "{}", err.message);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pipdocks_own_environments_are_refused_even_through_dot_dot() {
|
||||
let dir = scratch("own");
|
||||
let app_data = dir.join("data");
|
||||
for own in ["tools", "audit"] {
|
||||
let python = touch(&app_data, &format!("{own}/.venv/Scripts/{}", exe("python")));
|
||||
let err = validate_interpreter(&python, &app_data).expect_err("PipDock's own");
|
||||
assert!(err.message.contains("PipDock's own"), "{}", err.message);
|
||||
|
||||
// Reached the long way round: canonicalized before the comparison, or `..` walks past.
|
||||
let sideways = app_data
|
||||
.join("elsewhere")
|
||||
.join("..")
|
||||
.join(own)
|
||||
.join(".venv")
|
||||
.join("Scripts")
|
||||
.join(exe("python"));
|
||||
std::fs::create_dir_all(app_data.join("elsewhere")).expect("dir");
|
||||
let err = validate_interpreter(&sideways, &app_data).expect_err("still PipDock's own");
|
||||
assert!(err.message.contains("PipDock's own"), "{}", err.message);
|
||||
}
|
||||
// A sibling whose name merely starts with "tools" is someone else's.
|
||||
let neighbour = touch(&app_data, &format!("tools-mine/{}", exe("python")));
|
||||
validate_interpreter(&neighbour, &app_data).expect("not inside tools");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_environment_directory_resolves_to_its_interpreter() {
|
||||
let dir = scratch("dir");
|
||||
let inside = if cfg!(windows) {
|
||||
format!("venv/Scripts/{}", exe("python"))
|
||||
} else {
|
||||
"venv/bin/python".to_owned()
|
||||
};
|
||||
let python = touch(&dir, &inside);
|
||||
assert_eq!(interpreter_in(&dir.join("venv")), python);
|
||||
assert_eq!(interpreter_in(&python), python, "a file is itself");
|
||||
let nothing = dir.join("nothing-here");
|
||||
assert_eq!(
|
||||
interpreter_in(¬hing),
|
||||
nothing,
|
||||
"left for the validator to refuse"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn manual_entries_come_last_and_never_shadow_discovery() {
|
||||
let discovered = PathBuf::from(r"C:\Python314\python.exe");
|
||||
let mut found = BTreeMap::new();
|
||||
found.insert(
|
||||
canonical_interpreter(&discovered),
|
||||
Candidate {
|
||||
path: discovered.clone(),
|
||||
source: EnvSource::Registry,
|
||||
},
|
||||
);
|
||||
let manual = [
|
||||
PathBuf::from(r"D:\work\proj\myenv\Scripts\python.exe"),
|
||||
// The same interpreter the registry reported, in other casing: discovery keeps it.
|
||||
PathBuf::from(r"c:\python314\python.exe"),
|
||||
// Added twice, listed once.
|
||||
PathBuf::from(r"D:\work\proj\myenv\Scripts\python.exe"),
|
||||
// Gone from disk: still listed, so it can be removed.
|
||||
PathBuf::from(r"E:\gone\python.exe"),
|
||||
];
|
||||
let merged = merge_manual(found, &manual);
|
||||
let sources: Vec<_> = merged.iter().map(|c| (c.path.clone(), c.source)).collect();
|
||||
let mut expected = vec![(discovered, EnvSource::Registry)];
|
||||
if !cfg!(windows) {
|
||||
// Off Windows the casing differs, so the second is its own interpreter.
|
||||
expected.push((manual[0].clone(), EnvSource::Manual));
|
||||
expected.push((manual[1].clone(), EnvSource::Manual));
|
||||
} else {
|
||||
expected.push((manual[0].clone(), EnvSource::Manual));
|
||||
}
|
||||
expected.push((manual[3].clone(), EnvSource::Manual));
|
||||
assert_eq!(sources, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn env_hash_is_stable_and_case_insensitive_on_windows() {
|
||||
// SP-6: the Chocolatey shim and the direct install differ only in casing. Two hashes for
|
||||
@@ -692,4 +1133,37 @@ mod tests {
|
||||
.expect_err("missing interpreter must fail");
|
||||
assert_eq!(err.code, Code::EnvInterpreterMissing);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn an_added_entry_is_checked_again_on_every_listing() {
|
||||
// The store held a Python when it was added; what it holds now is another program. Refused
|
||||
// before anything runs it, and still a row — PD-ENV-001 — so it can be removed.
|
||||
let dir = scratch("relisted");
|
||||
let added = Candidate {
|
||||
path: touch(&dir, &exe("notepad")),
|
||||
source: EnvSource::Manual,
|
||||
};
|
||||
let err = probe_listed(&added, &dir.join("data"))
|
||||
.await
|
||||
.expect_err("refused");
|
||||
assert_eq!(err.code, Code::EnvInterpreterMissing);
|
||||
assert!(
|
||||
err.message.contains("is not a Python interpreter"),
|
||||
"{}",
|
||||
err.message
|
||||
);
|
||||
|
||||
// An entry whose file is gone reads exactly as the probe has always said it.
|
||||
let gone = Candidate {
|
||||
path: dir.join("deleted").join(exe("python")),
|
||||
source: EnvSource::Manual,
|
||||
};
|
||||
let err = probe_listed(&gone, &dir.join("data"))
|
||||
.await
|
||||
.expect_err("gone");
|
||||
assert_eq!(
|
||||
err.message,
|
||||
format!("no interpreter at {}", gone.path.display())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -625,9 +625,19 @@ pub fn user_file_error(path: &Path, e: &std::io::Error) -> PdError {
|
||||
/// — a Chocolatey shim yields `c:\python314\python.exe` where the direct install yields
|
||||
/// `C:\Python314\python.exe`. `env_hash` is derived from this string (ARCHITECTURE §6), so without
|
||||
/// case folding one environment would silently split its pins and snapshot history in two.
|
||||
///
|
||||
/// **Links are followed — except the one a virtual environment's own interpreter can be.** A venv
|
||||
/// made with `python -m venv --symlinks` (the default off Windows) has a `python.exe` that links to
|
||||
/// the Python it was made from, and following it made the venv the same environment as its base:
|
||||
/// one pin store, one snapshot history, one cached graph, report and audit. Until 1.6.0 nothing in
|
||||
/// the GUI could list the two apart, so nothing showed it; *Add interpreter…* can, and an
|
||||
/// independent review of 1.6.0 found what came with it. For an interpreter whose environment has a
|
||||
/// `pyvenv.cfg`, the folders are resolved and the file's own name is kept. Only such a venv's
|
||||
/// identity changed: every other path, a copied venv's included, resolves exactly as it did, and a
|
||||
/// linked venv's pins and snapshots from before stay with the base they were always filed under.
|
||||
#[must_use]
|
||||
pub fn canonical_interpreter(path: &Path) -> String {
|
||||
let resolved = std::fs::canonicalize(path).unwrap_or_else(|_| path.to_path_buf());
|
||||
let resolved = identity_path(path);
|
||||
let text = resolved.display().to_string();
|
||||
// Strip the Windows verbatim prefix canonicalize() adds; it is noise in logs and in the hash.
|
||||
let text = text.strip_prefix(r"\\?\").unwrap_or(&text).to_owned();
|
||||
@@ -638,6 +648,21 @@ pub fn canonical_interpreter(path: &Path) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
/// The path [`canonical_interpreter`] names: every link resolved, but a venv's own interpreter only
|
||||
/// up to its folder. A venv is recognised by the `pyvenv.cfg` beside `Scripts\` (`bin/` off
|
||||
/// Windows), which is how Python itself recognises one.
|
||||
fn identity_path(path: &Path) -> PathBuf {
|
||||
if let (Some(dir), Some(name)) = (path.parent(), path.file_name())
|
||||
&& dir
|
||||
.parent()
|
||||
.is_some_and(|prefix| prefix.join("pyvenv.cfg").is_file())
|
||||
&& let Ok(dir) = std::fs::canonicalize(dir)
|
||||
{
|
||||
return dir.join(name);
|
||||
}
|
||||
std::fs::canonicalize(path).unwrap_or_else(|_| path.to_path_buf())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -1083,4 +1108,83 @@ mod tests {
|
||||
let p = canonical_interpreter(Path::new("."));
|
||||
assert!(!p.starts_with(r"\\?\"), "got {p}");
|
||||
}
|
||||
|
||||
fn identity_scratch(name: &str) -> PathBuf {
|
||||
let dir = std::env::temp_dir().join(format!("pd-identity-{name}-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
std::fs::create_dir_all(&dir).expect("scratch dir");
|
||||
dir
|
||||
}
|
||||
|
||||
fn file_at(path: &Path) -> PathBuf {
|
||||
std::fs::create_dir_all(path.parent().expect("a parent")).expect("parents");
|
||||
std::fs::write(path, "").expect("write");
|
||||
path.to_path_buf()
|
||||
}
|
||||
|
||||
/// A file link, or `None` where this machine may not make one (Windows without Developer Mode).
|
||||
fn file_link(target: &Path, at: &Path) -> Option<()> {
|
||||
std::fs::create_dir_all(at.parent().expect("a parent")).expect("parents");
|
||||
#[cfg(windows)]
|
||||
let made = std::os::windows::fs::symlink_file(target, at);
|
||||
#[cfg(not(windows))]
|
||||
let made = std::os::unix::fs::symlink(target, at);
|
||||
made.ok()
|
||||
}
|
||||
|
||||
/// What the identity was before 1.6.0, for every path it did not mean to change.
|
||||
fn resolved_fully(path: &Path) -> String {
|
||||
let text = std::fs::canonicalize(path)
|
||||
.expect("exists")
|
||||
.display()
|
||||
.to_string();
|
||||
let text = text.strip_prefix(r"\\?\").unwrap_or(&text).to_owned();
|
||||
if cfg!(windows) {
|
||||
text.to_lowercase()
|
||||
} else {
|
||||
text
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_venv_made_with_symlinks_is_its_own_environment() {
|
||||
let dir = identity_scratch("venv");
|
||||
let bin = if cfg!(windows) { "Scripts" } else { "bin" };
|
||||
let exe = if cfg!(windows) {
|
||||
"python.exe"
|
||||
} else {
|
||||
"python"
|
||||
};
|
||||
let base = file_at(&dir.join("base").join(exe));
|
||||
|
||||
// A copied venv — Windows' default — resolves exactly as before.
|
||||
let copied = file_at(&dir.join("copied").join(bin).join(exe));
|
||||
file_at(&dir.join("copied").join("pyvenv.cfg"));
|
||||
assert_eq!(canonical_interpreter(&copied), resolved_fully(&copied));
|
||||
assert_eq!(canonical_interpreter(&base), resolved_fully(&base));
|
||||
|
||||
let linked = dir.join("linked").join(bin).join(exe);
|
||||
let Some(()) = file_link(&base, &linked) else {
|
||||
eprintln!("skipped: this machine cannot create symbolic links");
|
||||
return;
|
||||
};
|
||||
// A link that is not a venv's still resolves: two names for one file are one Python.
|
||||
let alias = dir.join("alias").join(exe);
|
||||
file_link(&base, &alias).expect("links work here");
|
||||
assert_eq!(canonical_interpreter(&alias), canonical_interpreter(&base));
|
||||
|
||||
// Before it is a venv, the link is the base; once `pyvenv.cfg` says so, it is itself.
|
||||
assert_eq!(canonical_interpreter(&linked), canonical_interpreter(&base));
|
||||
file_at(&dir.join("linked").join("pyvenv.cfg"));
|
||||
assert_ne!(
|
||||
canonical_interpreter(&linked),
|
||||
canonical_interpreter(&base),
|
||||
"the venv is not the Python it was made from"
|
||||
);
|
||||
let folder = resolved_fully(&dir.join("linked").join(bin));
|
||||
assert_eq!(
|
||||
canonical_interpreter(&linked),
|
||||
format!("{folder}{}{exe}", std::path::MAIN_SEPARATOR)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
use crate::model::EngineId;
|
||||
|
||||
/// Where the template lives. Not configurable: an issue URL a caller can set is a phishing vector.
|
||||
const ISSUE_URL: &str = "https://github.com/poli0981/pipdock/issues/new?template=bug_report.yml";
|
||||
const ISSUE_URL: &str = "https://github.com/poli0981org/pipdock/issues/new?template=bug_report.yml";
|
||||
|
||||
/// What a head knows about the failure it is reporting.
|
||||
#[derive(Debug, Clone, Default)]
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::errors::{Code, PdError, Result};
|
||||
pub const DB_FILE: &str = "index.db";
|
||||
|
||||
/// Schema version this build expects. Bump when adding a migration.
|
||||
pub const SCHEMA_VERSION: i64 = 4;
|
||||
pub const SCHEMA_VERSION: i64 = 5;
|
||||
|
||||
/// An open store.
|
||||
#[derive(Debug)]
|
||||
@@ -192,6 +192,16 @@ impl Store {
|
||||
version TEXT NOT NULL,
|
||||
requires_python TEXT,
|
||||
PRIMARY KEY (normalized, version)
|
||||
);
|
||||
|
||||
-- v5. Interpreters a person added - Browse... in the GUI, `pipdock env add` in the
|
||||
-- CLI - for discovery to list beside its own (PRD P0-1). Not the `envs` table:
|
||||
-- that is the CLI's recents and its starred default, and adding an interpreter to
|
||||
-- the list is not choosing it. Same env_hash as everywhere, case-folded (SP-6).
|
||||
CREATE TABLE IF NOT EXISTS manual_envs (
|
||||
env_hash TEXT PRIMARY KEY,
|
||||
interpreter TEXT NOT NULL,
|
||||
added_at TEXT NOT NULL
|
||||
);",
|
||||
)
|
||||
.map_err(sql)?;
|
||||
@@ -203,6 +213,17 @@ impl Store {
|
||||
}
|
||||
}
|
||||
|
||||
/// An interpreter a person added with *Browse…* or `pipdock env add`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct ManualEnv {
|
||||
/// Identity, case-folded (SP-6).
|
||||
pub env_hash: String,
|
||||
/// The canonical interpreter path, as stored.
|
||||
pub interpreter: String,
|
||||
/// RFC 3339, which orders the list.
|
||||
pub added_at: String,
|
||||
}
|
||||
|
||||
/// A remembered environment (ARCHITECTURE §6, PRD P0-1 "recents persisted").
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct RecentEnv {
|
||||
@@ -285,6 +306,81 @@ impl Store {
|
||||
Ok(self.recent_envs()?.into_iter().find(|e| e.is_default))
|
||||
}
|
||||
|
||||
/// Put an interpreter a person added on the list (PRD P0-1's manual browse).
|
||||
///
|
||||
/// Adding one that is already there keeps its place and its date — the list is in the order
|
||||
/// things were added, and adding again is not a new addition — but takes the path as given
|
||||
/// this time, which is the absolute one [`crate::envs::validate_interpreter`] returned, links
|
||||
/// left alone.
|
||||
///
|
||||
/// Keyed by `env_hash`, so two names for one interpreter are one entry. A venv made with
|
||||
/// `--symlinks` has an identity of its own since 1.6.0 (`exec::canonical_interpreter`), and is
|
||||
/// not its base's entry.
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-INT-001` when the write fails.
|
||||
pub fn add_manual_env(&self, env_hash: &str, interpreter: &str, now: &str) -> Result<()> {
|
||||
self.conn
|
||||
.execute(
|
||||
"INSERT INTO manual_envs (env_hash, interpreter, added_at) VALUES (?1, ?2, ?3)
|
||||
ON CONFLICT (env_hash) DO UPDATE SET interpreter = excluded.interpreter",
|
||||
rusqlite::params![env_hash, interpreter, now],
|
||||
)
|
||||
.map_err(|e| PdError::new(Code::IntUnexpected, format!("manual env store: {e}")))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The interpreters a person added, oldest first.
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-INT-001` when the read fails.
|
||||
pub fn manual_envs(&self) -> Result<Vec<ManualEnv>> {
|
||||
let err = |e: rusqlite::Error| {
|
||||
PdError::new(Code::IntUnexpected, format!("manual env store: {e}"))
|
||||
};
|
||||
let mut stmt = self
|
||||
.conn
|
||||
.prepare(
|
||||
"SELECT env_hash, interpreter, added_at FROM manual_envs
|
||||
ORDER BY added_at, rowid",
|
||||
)
|
||||
.map_err(err)?;
|
||||
let rows = stmt
|
||||
.query_map([], |r| {
|
||||
Ok(ManualEnv {
|
||||
env_hash: r.get(0)?,
|
||||
interpreter: r.get(1)?,
|
||||
added_at: r.get(2)?,
|
||||
})
|
||||
})
|
||||
.map_err(err)?;
|
||||
rows.collect::<std::result::Result<Vec<_>, _>>()
|
||||
.map_err(err)
|
||||
}
|
||||
|
||||
/// Take an interpreter off the list. Only the entry goes: nothing on disk is touched, and the
|
||||
/// pins, snapshots and Health folder keyed to the same `env_hash` stay, ready for the day it
|
||||
/// is added — or discovered — again.
|
||||
///
|
||||
/// **Matched by identity or by the stored path**, case-insensitively for the path. An
|
||||
/// interpreter whose file is gone can no longer be canonicalized into the identity it was added
|
||||
/// under — on a network share the two spellings differ (`\\server\share` against
|
||||
/// `UNC\server\share`) — and that entry, listed with PD-ENV-001, is exactly the one a person
|
||||
/// wants removed. By hash alone, removing it reported success and the next scan brought it back.
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-INT-001` when the write fails. `Ok(false)` when it was not on the list.
|
||||
pub fn remove_manual_env(&self, env_hash: &str, interpreter: &str) -> Result<bool> {
|
||||
let removed = self
|
||||
.conn
|
||||
.execute(
|
||||
"DELETE FROM manual_envs WHERE env_hash = ?1 OR lower(interpreter) = lower(?2)",
|
||||
rusqlite::params![env_hash, interpreter],
|
||||
)
|
||||
.map_err(|e| PdError::new(Code::IntUnexpected, format!("manual env store: {e}")))?;
|
||||
Ok(removed > 0)
|
||||
}
|
||||
|
||||
/// The project folder Code Health last ran in for this environment (CODE-HEALTH-SPEC §3).
|
||||
///
|
||||
/// Per environment, because deptry compares declared dependencies against what is *installed*
|
||||
@@ -351,7 +447,14 @@ mod tests {
|
||||
.filter_map(std::result::Result::ok)
|
||||
.collect();
|
||||
|
||||
for expected in ["envs", "health_projects", "meta_cache", "names", "pins"] {
|
||||
for expected in [
|
||||
"envs",
|
||||
"health_projects",
|
||||
"manual_envs",
|
||||
"meta_cache",
|
||||
"names",
|
||||
"pins",
|
||||
] {
|
||||
assert!(
|
||||
tables.contains(&expected.to_owned()),
|
||||
"missing {expected}: {tables:?}"
|
||||
@@ -458,4 +561,118 @@ mod tests {
|
||||
)
|
||||
.expect("the v4 table exists");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_v4_store_gains_the_manual_list_and_keeps_its_data() {
|
||||
let store = Store::in_memory().expect("open");
|
||||
store
|
||||
.remember_env("h1", r"C:\a\python.exe", "2026-11-01T00:00:00Z", true)
|
||||
.expect("a CLI default from 1.5.0");
|
||||
store
|
||||
.conn()
|
||||
.execute_batch("DROP TABLE manual_envs; PRAGMA user_version = 4;")
|
||||
.expect("rewind to v4");
|
||||
store.migrate().expect("migrate");
|
||||
assert!(store.manual_envs().expect("the v5 table exists").is_empty());
|
||||
assert_eq!(
|
||||
store.default_env().expect("read").map(|e| e.env_hash),
|
||||
Some("h1".to_owned()),
|
||||
"the migration does not touch what was there"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_manual_list_keeps_its_order_and_takes_no_duplicates() {
|
||||
let store = Store::in_memory().expect("open");
|
||||
store
|
||||
.add_manual_env("b", r"D:\b\python.exe", "2026-11-02T00:00:00Z")
|
||||
.expect("add");
|
||||
store
|
||||
.add_manual_env("a", r"D:\a\python.exe", "2026-11-03T00:00:00Z")
|
||||
.expect("add");
|
||||
// Added again, later and spelled differently: one entry, first place, the new spelling.
|
||||
store
|
||||
.add_manual_env("b", r"D:\B\python.exe", "2026-11-04T00:00:00Z")
|
||||
.expect("add again");
|
||||
|
||||
let listed = store.manual_envs().expect("read");
|
||||
assert_eq!(
|
||||
listed
|
||||
.iter()
|
||||
.map(|m| (
|
||||
m.env_hash.as_str(),
|
||||
m.interpreter.as_str(),
|
||||
m.added_at.as_str()
|
||||
))
|
||||
.collect::<Vec<_>>(),
|
||||
[
|
||||
("b", r"D:\B\python.exe", "2026-11-02T00:00:00Z"),
|
||||
("a", r"D:\a\python.exe", "2026-11-03T00:00:00Z"),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn removing_from_the_manual_list_touches_nothing_else() {
|
||||
let store = Store::in_memory().expect("open");
|
||||
store
|
||||
.add_manual_env("h", r"D:\p\python.exe", "2026-11-02T00:00:00Z")
|
||||
.expect("add");
|
||||
store
|
||||
.remember_env("h", r"D:\p\python.exe", "2026-11-02T00:00:00Z", true)
|
||||
.expect("also the CLI default");
|
||||
store
|
||||
.set_health_project("h", r"D:\p", "2026-11-02T00:00:00Z")
|
||||
.expect("and Health's folder");
|
||||
|
||||
assert!(
|
||||
!store
|
||||
.remove_manual_env("other", r"D:\elsewhere\python.exe")
|
||||
.expect("remove"),
|
||||
"neither the identity nor the path matches"
|
||||
);
|
||||
assert!(
|
||||
store.remove_manual_env("h", "unused").expect("remove"),
|
||||
"it was there"
|
||||
);
|
||||
assert!(
|
||||
!store.remove_manual_env("h", "unused").expect("again"),
|
||||
"and is not now"
|
||||
);
|
||||
assert!(store.manual_envs().expect("read").is_empty());
|
||||
assert!(
|
||||
store.default_env().expect("read").is_some(),
|
||||
"the CLI default is another list"
|
||||
);
|
||||
assert_eq!(
|
||||
store.health_project("h").expect("read").as_deref(),
|
||||
Some(r"D:\p"),
|
||||
"keyed data outlives the entry"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_gone_interpreter_is_removed_by_its_stored_path_when_its_identity_moved() {
|
||||
// Added while the file was there, under the identity its canonical path hashed to; once the
|
||||
// file is gone the row's identity is the hash of the stored text, which on a network share
|
||||
// is spelled differently. The stored path, in any case, still matches.
|
||||
let store = Store::in_memory().expect("open");
|
||||
store
|
||||
.add_manual_env(
|
||||
"hash-of-unc-spelling",
|
||||
r"\\server\share\proj\Scripts\python.exe",
|
||||
"2026-11-02T00:00:00Z",
|
||||
)
|
||||
.expect("add");
|
||||
assert!(
|
||||
store
|
||||
.remove_manual_env(
|
||||
"hash-of-the-stored-text",
|
||||
r"\\SERVER\share\proj\Scripts\python.exe"
|
||||
)
|
||||
.expect("remove"),
|
||||
"matched by the path"
|
||||
);
|
||||
assert!(store.manual_envs().expect("read").is_empty());
|
||||
}
|
||||
}
|
||||
+18
-11
@@ -1,6 +1,6 @@
|
||||
# AI disclosure
|
||||
|
||||
*Last updated 2026-10-17, for PipDock 1.4.0.*
|
||||
*Last updated 2026-11-21, for PipDock 1.6.0.*
|
||||
|
||||
**PipDock was written with substantial help from an AI coding assistant, under human review.** This
|
||||
page says which model, what it did, what it did not do, and how you can check any of it yourself.
|
||||
@@ -13,10 +13,10 @@ commit trailers. Nothing here changes the licence or the warranty position — s
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Model | **Claude Opus 5** — first commit through 1.3.0 · **Claude Opus 5.5** — 1.4.0 and the maintenance after it, through 2026-11-04 · **Claude Fable 5.2** — from 2026-11-10, which is 1.5.0 |
|
||||
| Model | **Claude Opus 5** — first commit through 1.3.0 · **Claude Opus 5.5** — 1.4.0 and the maintenance after it, through 2026-11-04 · **Claude Fable 5.2** — 2026-11-10, which is 1.5.0 · **Claude Opus 5.5** — 2026-11-21, the move to poli0981org and 1.6.0 |
|
||||
| Vendor | **Anthropic** ([anthropic.com](https://www.anthropic.com)) |
|
||||
| Interface | [Claude Code](https://claude.com/claude-code), Anthropic's CLI/desktop coding agent |
|
||||
| Period | 2026-07-27 → 2026-08-21 (first commit to 1.3.0) · 2026-10-16 → 2026-10-17 (1.4.0) · 2026-10-20 → 2026-11-04 (CI and dependency maintenance) · 2026-11-10 (1.5.0) |
|
||||
| Period | 2026-07-27 → 2026-08-21 (first commit to 1.3.0) · 2026-10-16 → 2026-10-17 (1.4.0) · 2026-10-20 → 2026-11-04 (CI and dependency maintenance) · 2026-11-10 (1.5.0) · 2026-11-21 (the move to poli0981org, 1.6.0) |
|
||||
|
||||
The trailer on each commit records which model produced it, and `git log` is the authoritative
|
||||
history — the table above is a summary of it, not a substitute.
|
||||
@@ -48,12 +48,14 @@ load-bearing, and all four caught real defects the review-by-reading did not:
|
||||
described: all three Code Health tools exit non-zero on findings and vulture uses 3; deptry
|
||||
reports a *module* name rather than the distribution providing it; ruff's rule URL is keyed by
|
||||
rule name, not code. Each is now pinned by a test because a document was not enough.
|
||||
3. **CI is a second reviewer that cannot be talked round.** Five checks block every pull
|
||||
request — formatting, clippy and the test suite; `cargo audit`; `npm audit`; lint, typecheck,
|
||||
tests and build of the frontend; and CodeQL for JavaScript/TypeScript — and `main` is protected
|
||||
so that the owner cannot bypass them. Integration tests against real pip and uv in disposable
|
||||
venvs run on every pull request that touches what they cover, and `cargo deny`, CodeQL for Rust
|
||||
and Actions, and a Tauri version check run on all of them without being required.
|
||||
3. **CI is a second reviewer that cannot be talked round.** Eight checks block every pull
|
||||
request — formatting, clippy and the test suite; `cargo audit`; `cargo deny`; `npm audit`; the
|
||||
npm licence check; the Tauri version check; lint, typecheck, tests and build of the frontend;
|
||||
and CodeQL for JavaScript/TypeScript — and `main` is protected so that the owner cannot bypass
|
||||
them. Integration tests against real pip and uv in disposable venvs run on every pull request
|
||||
that touches what they cover, and CodeQL for Rust and Actions, SonarQube Cloud and Qodana run
|
||||
on all of them without being required. Since 2026-11-21 every one of those workflows lives in
|
||||
this repository; none calls code another account can change.
|
||||
4. **The built application was driven by hand before release.** Before 1.0.0 the owner did it —
|
||||
on a real machine, in Windows Sandbox and in a Windows 10 VM — following `docs/TESTING.md` §4's
|
||||
charter, and several defects were found that way and only that way. For 1.4.0 the assistant
|
||||
@@ -74,7 +76,12 @@ load-bearing, and all four caught real defects the review-by-reading did not:
|
||||
the assistant carried it out under the same two conditions. The owner's own keyboard and
|
||||
Narrator testing of 1.4.0 is theirs and is recorded as theirs in `ACCESSIBILITY.md`; the
|
||||
assistant cannot run a screen reader, and that file says which checks were a person's and which
|
||||
were a machine's.
|
||||
were a machine's. 1.6.0 was released the same way again. Moving the repository to the
|
||||
poli0981org organization and putting PipDock in maintenance mode were the owner's decisions,
|
||||
and the transfer itself was the owner's own action; the owner then approved a plan naming every
|
||||
outward step — the two pull requests, the change to `main`'s required checks, the tag, the
|
||||
published release, the announcement in Discussions, the repository description, the new labels
|
||||
and the wiki — and the assistant carried it out under the same two conditions.
|
||||
- **Anything requiring a legal or security judgment** was raised for a decision rather than taken —
|
||||
for example the PEP 668 override's default, and whether a `mailto:` scheme belonged in the
|
||||
browser-launch allowlist.
|
||||
@@ -116,5 +123,5 @@ thing to trust.
|
||||
## Questions
|
||||
|
||||
`code@poli0981.dev`, or open a discussion at
|
||||
[github.com/poli0981/pipdock](https://github.com/poli0981/pipdock/discussions). If you think
|
||||
[github.com/poli0981org/pipdock](https://github.com/poli0981org/pipdock/discussions). If you think
|
||||
something in this page is inaccurate, that is worth an issue.
|
||||
@@ -35,7 +35,7 @@ pipdock/
|
||||
├─ src-tauri/ # Tauri 2 app (commands + events only)
|
||||
├─ ui/ # React 19 + TS + Tailwind 4 + Vite 8 + Zustand + i18next
|
||||
├─ legal/ # EULA, Disclaimer, Privacy, Third-Party (public — legal gate links here)
|
||||
├─ .github/ # caller workflows into poli0981/.github + issue templates
|
||||
├─ .github/ # workflows (all project-local), their scripts, issue templates
|
||||
└─ docs/
|
||||
```
|
||||
|
||||
@@ -140,7 +140,8 @@ From `requires_dist` the core builds the **reverse-dependency graph** used by: h
|
||||
## 6. Storage (`%LOCALAPPDATA%\PipDock\data\`)
|
||||
|
||||
```text
|
||||
index.db # SQLite, schema v4: names, meta_cache, envs (recents, default),
|
||||
index.db # SQLite, schema v5: names, meta_cache, envs (the CLI's recents, default),
|
||||
# manual_envs (interpreters added with Browse… or `env add`, v5),
|
||||
# pins(env_hash, pkg, mode, version, reason), health_projects,
|
||||
# kv (settings, consent, index refresh stamp), release_meta
|
||||
snapshots/<env_hash>/<id>.freeze.txt + <id>.meta.json # id: 20261016T145809-423560600Z
|
||||
@@ -151,7 +152,7 @@ logs/pipdock.<date>.log, logs/pipdock-cli.<date>.log # one file per head per U
|
||||
|
||||
**There is no `config.json`.** This block listed one until 1.4.0; settings and the consent record have always been rows in `index.db`'s `kv` table (`settings::load`), because the store already exists, already handles concurrent access, and a second on-disk format is a second thing to migrate.
|
||||
|
||||
`env_hash` = SHA-256 of the canonicalized interpreter path, case-folded on Windows (SP-6). Snapshot `.meta.json` records trigger (which plan), engine, package count, and app version; the engine is what a rollback with the other engine reads (DATA-FLOW §8). Snapshot ids are fixed width, so they sort as the times they name — the timestamp with its punctuation swapped out used to trim its fraction, so `…09-42Z` sorted after `…09-4235606Z` — and the timeline orders by `created_at` either way (M43).
|
||||
`env_hash` = SHA-256 of the canonicalized interpreter path, case-folded on Windows (SP-6). Links are resolved — two names for one Python are one environment — **except a venv's own interpreter**, resolved only up to its folder since 1.6.0: a `--symlinks` venv's `python.exe` links to the Python it was made from, and following it filed the venv's pins, snapshots and reports under that base. A venv is recognised by its `pyvenv.cfg`; no other path's identity changed. Snapshot `.meta.json` records trigger (which plan), engine, package count, and app version; the engine is what a rollback with the other engine reads (DATA-FLOW §8). Snapshot ids are fixed width, so they sort as the times they name — the timestamp with its punctuation swapped out used to trim its fraction, so `…09-42Z` sorted after `…09-4235606Z` — and the timeline orders by `created_at` either way (M43).
|
||||
|
||||
**The store migrates only when it is behind.** `user_version` is compared with `store::SCHEMA_VERSION` (4) and the batch runs only when the database is older: every open used to run it — a `journal_mode` write and eight `CREATE TABLE`s, on a store some paths open twice per lookup — and an older build set the version back down, so the next newer one re-ran them (M38). v4 added `release_meta(normalized, version, requires_python)`: a release's `Requires-Python` as PyPI publishes it, never refreshed because an uploaded release's metadata never changes. A NULL there means "declares none"; "unknown" is never stored.
|
||||
|
||||
@@ -168,9 +169,10 @@ This table is the surface. A command that is not listed here does not exist; add
|
||||
| Command | Returns | Purpose |
|
||||
|---|---|---|
|
||||
| `app_info` | `AppInfo` | PipDock's version, and the hash of the legal documents this build ships against. |
|
||||
| `env_scan` | `EnvRow[]` | Discover environments, streaming `scan-progress`. A probe failure is reported on its own row, never fatal to the scan. Carries `pipVersion` and `healthProject`, both read before the probe loop so the store guard is never held across a probe. Probes run four at a time (they ran in series until 1.4.0), each under its own 60 s watchdog, so one hung interpreter costs its own row; rows keep discovery order. |
|
||||
| `env_add_manual` | `EnvRow` | Persist an interpreter chosen through *Browse…*. **Not implemented** — the one entry left in `NOT_YET` (`src-tauri/src/lib.rs`), owed by M3. |
|
||||
| `env_probe` | `EnvRow` | Probe one interpreter without persisting it. Takes an optional `source`: absent means *Browse…*, and a **refresh must pass the row's own**, or the row comes back relabelled `manual`. Fills every field `env_scan` does, because `upgradePip` replaces the row wholesale. |
|
||||
| `env_scan` | `EnvRow[]` | Discover environments, streaming `scan-progress`. A probe failure is reported on its own row, never fatal to the scan. Carries `pipVersion` and `healthProject`, both read before the probe loop so the store guard is never held across a probe. Probes run four at a time (they ran in series until 1.4.0), each under its own 60 s watchdog, so one hung interpreter costs its own row; rows keep discovery order. An added interpreter is validated again before its probe (`envs::probe_listed`, which `pipdock env list` shares): what it was when added says nothing about what a link points at now. |
|
||||
| `env_add_manual` | `EnvRow` | Add an interpreter chosen through *Add interpreter…* (*Browse…*, PRD P0-1) to the list `env_scan` appends to discovery, and return its row (1.6.0; the last entry `NOT_YET` held). `envs::validate_interpreter` first — an existing file named like Python, not one of PipDock's own venvs — then the probe, then the store, so a refused or broken interpreter is never listed. The row carries the path that is stored: absolute, links left alone — a `--symlinks` venv's `python.exe` *is* the venv, and its target is the base interpreter. The frontend merges the row by that path, not by `envHash`: two names for one Python share a hash. |
|
||||
| `env_remove_manual` | `boolean` | Take an added interpreter off that list, by the path its row shows; `false` when it was not on it. The path, not `envHash`: for a file that is gone the hash is recomputed from the stored text and can differ from the one it was added under, so removal by hash reported success while the entry stayed. Touches nothing on disk, and leaves the pins, snapshots and Health folder keyed to it. |
|
||||
| `env_probe` | `EnvRow` | Probe one interpreter without persisting it. Takes an optional `source`: absent means manual, and a **refresh must pass the row's own**, or the row comes back relabelled `manual`. A `manual` path is validated as `env_add_manual` validates one — a check on what the webview *says*, not an enforcement point (SECURITY §2, backlog X36-b). Fills every field `env_scan` does, because `upgradePip` replaces the row wholesale. |
|
||||
| `env_export` | `string` | Write the environment's `Engine::freeze` document to a user-chosen path and return it (PRD P1-3). Byte for byte, with no formatter: a freeze *is* a requirements file, and a constraints file is the same body under a different name. Rust-side for `health_save_report`'s reason — `dialog:allow-save` asks for a path and grants no `fs`. |
|
||||
| `requirements_read` | `ParsedRequirements` | Read a `requirements.txt` into install specs **and whatever it could not use**. The skipped lines are the point: an include or an editable install means the file asks for something PipDock will not do, and the user has to see that before a preview claims to represent their file. |
|
||||
| `pkg_list` | `Dist[]` | Installed distributions, read from `probe.py` rather than the engine — see §4 and DATA-FLOW §7. |
|
||||
@@ -269,7 +271,7 @@ Zustand stores: `useEnvStore`, `usePlanStore`, `useIndexStore`, `useSettingsStor
|
||||
| rusqlite | 0.41.x (0.41.1; `libsqlite3-sys` 0.39.1, SQLite 3.54.1). 0.41 needed no code change: its new PRAGMA-name check accepts the three the store uses (`foreign_keys`, `journal_mode`, `user_version`), and its use-after-free fix is in `busy_handler`/`trace_v2`, which the store never registers. **Held at 0.37 until 1.4.0**: `libsqlite3-sys` 0.38's build script used the then-unstable `cfg_select!`, which did not compile on Rust 1.94.1. It is stable since 1.95, so the toolchain move met the hold's own condition. Nothing here used the `u64`/`usize` `ToSql` impls (off by default since 0.38) or `prepare_cached` (optional since 0.38). |
|
||||
| rfd | 0.17.x (0.17.2), **the same rfd `tauri-plugin-dialog` compiles** — src-tauri takes it only for the start-up failure dialog, so its range follows the plugin's (^0.17 since 2.8.4) and `cargo tree -i rfd --target all` shows one copy. Held at 0.16 until 2026-11-04 for that reason. |
|
||||
| TypeScript | **held at 6.0.x** (6.0.3; 7.0.2 is latest). `typescript-eslint` 8.72.1 still peers on `>=4.8.4 <6.1.0`, so anything from 6.1 on — 7.x included — fails `npm ci` with `ERESOLVE` before a single check runs. Revisit when typescript-eslint widens its range. |
|
||||
| ESLint | **10.x (10.14.0), with `eslint-plugin-react` deliberately absent.** That plugin caps at ESLint 9, which drags in a `minimatch`/`brace-expansion` chain carrying six high-severity advisories and would fail `npm audit` in CI. The one rule it was wanted for — no hardcoded JSX strings (I18N §1) — is a local rule in `eslint.config.js`, which also implements the documented allowlist precisely. ESLint 10.14 and `typescript-eslint` 8.72 take `minimatch ^10.2`, and GHSA-g3hv-75wg-m249 (moderate, 2026-10-30) is fixed only in 11.0.1, so `npm audit` lists it; the gate is `--audit-level=high` and the patterns minimatch sees here are `eslint.config.js`'s own, so it is tolerated until ESLint moves rather than forced with an `overrides` across a major. |
|
||||
| ESLint | **10.x (10.15.0), with `eslint-plugin-react` deliberately absent.** That plugin caps at ESLint 9, which drags in a `minimatch`/`brace-expansion` chain carrying six high-severity advisories and would fail `npm audit` in CI. The one rule it was wanted for — no hardcoded JSX strings (I18N §1) — is a local rule in `eslint.config.js`, which also implements the documented allowlist precisely. GHSA-g3hv-75wg-m249 (minimatch, moderate, 2026-10-30) was fixed only in 11.0.1, which ESLint 10.14 and `typescript-eslint` 8.72 did not accept, so it was tolerated rather than forced with an `overrides` across a major; ESLint 10.15 and `typescript-eslint` 8.73 moved to minimatch 11 (11.0.9 throughout, 2026-11-21), and `npm audit` is clean. |
|
||||
|
||||
**TypeScript is the one hold left, and Dependabot no longer proposes it:** `.github/dependabot.yml` ignores `typescript >=6.1.0`, with the reason beside the rule. A hold is a compile or install failure, not a preference, so such a PR would be closed rather than merged until the stated condition changes. `cargo audit` runs with `--deny warnings`, so a new informational advisory fails CI unless `.cargo/audit.toml` records why it is tolerated (SECURITY §7).
|
||||
|
||||
|
||||
+15
-2
@@ -86,7 +86,20 @@ the per-user site-packages directory — so its package count can be lower than
|
||||
is non-null exactly when that applies, and null inside a venv. See SECURITY §2.
|
||||
|
||||
**`venv_scan` matches exactly four directory names**: `.venv`, `venv`, `env`, `.env`. A virtual
|
||||
environment called anything else is invisible to `env list`, and you have to name it with `--env`.
|
||||
environment called anything else is not discovered — name it with `--env` for one command, or put
|
||||
it on the list for good (the GUI's *Add interpreter…* writes the same list):
|
||||
|
||||
```powershell
|
||||
pipdock env add D:\work\scraper\myenv
|
||||
```
|
||||
|
||||
It appears in `env list` after discovery's own rows, with `source: "manual"`, and in the GUI's
|
||||
Environments screen. `pipdock env remove D:\work\scraper\myenv` takes it off again; nothing on disk
|
||||
is touched, and its pins and snapshots stay for the day it comes back. Since 1.6.0 a path you give
|
||||
`--env`, `env use` or `env add` must be named like a Python interpreter (`python.exe`,
|
||||
`python3.exe`, `python3.12.exe`, the free-threaded `python3.14t.exe`) and must not be one of
|
||||
PipDock's own venvs, or it is refused
|
||||
with PD-ENV-001 before anything runs it.
|
||||
|
||||
Make one the default so you can stop typing `--env`:
|
||||
|
||||
@@ -522,7 +535,7 @@ lives in `pipdock-core` (`pins::suggest`, `requirements::parse`, `cache::usage`,
|
||||
| Command palette | `Ctrl+K` | not applicable |
|
||||
|
||||
If you want one of these on the command line, say so in an
|
||||
[issue](https://github.com/poli0981/pipdock/issues) — the core function is already there.
|
||||
[issue](https://github.com/poli0981org/pipdock/issues) — the core function is already there.
|
||||
|
||||
**The PEP 668 override is GUI-only for a different reason, and stays so.** It is meant to be hard
|
||||
to reach — a decision made in the GUI, behind a confirm — and a flag would put it one shell-history
|
||||
|
||||
+7
-3
@@ -27,7 +27,7 @@
|
||||
|
||||
**Which environment.** In order:
|
||||
|
||||
1. `--env` — an interpreter, or an environment directory whose `Scripts\python.exe` is used;
|
||||
1. `--env` — an interpreter, or an environment directory whose `Scripts\python.exe` is used; refused with PD-ENV-001 unless it is named like a Python interpreter and outside PipDock's own venvs (SECURITY §2);
|
||||
2. the default `pipdock env use` stored. If its interpreter is gone, stderr says `` warning: the default environment (<path>) no longer exists; `pipdock env use` sets another `` and the search goes on;
|
||||
3. the first of `.venv`, `venv`, `env`, `.env` in the working directory that holds an interpreter.
|
||||
|
||||
@@ -38,8 +38,10 @@ Nothing found is PD-ENV-001 (exit 3), naming all three ways. Only `env use` writ
|
||||
## 3. Commands
|
||||
|
||||
```text
|
||||
pipdock env list # discovered envs, sources, PEP 668 flags
|
||||
pipdock env list # discovered envs, then the added ones; sources, PEP 668 flags
|
||||
pipdock env use <path> # set the default env (§2)
|
||||
pipdock env add <path> # add an interpreter or env dir to the list (the GUI's Add interpreter…)
|
||||
pipdock env remove <path> # take an added one off the list; nothing on disk changes
|
||||
pipdock list [--outdated] # installed packages, from the probe; --outdated asks the index
|
||||
pipdock search <query> [--limit n] # local fuzzy index search (n defaults to 20)
|
||||
pipdock info <pkg> # cached PyPI metadata
|
||||
@@ -139,8 +141,10 @@ An error's exit is derived from its code's area (`run::exit_for`) rather than wr
|
||||
| `snapshot create` | The new snapshot's `SnapshotMeta` |
|
||||
| `snapshot list` | `[SnapshotMeta]` |
|
||||
| `snapshot diff` | `Diff`, as a rollback with this engine would see it; the lines no index can restore are printed in text mode only |
|
||||
| `env list` | An array, one object per discovered interpreter: `interpreter`, `source`, `python`, `externallyManaged`, `hiddenUserSite`, `packages` (a count), `envHash`, `pipVersion` — or `interpreter`, `source` and `error: {code, message}` for one that could not be probed, without failing the rest |
|
||||
| `env list` | An array, one object per discovered interpreter and then per added one (`source: "manual"`, 1.6.0): `interpreter`, `source`, `python`, `externallyManaged`, `hiddenUserSite`, `packages` (a count), `envHash`, `pipVersion` — or `interpreter`, `source` and `error: {code, message}` for one that could not be probed, without failing the rest |
|
||||
| `env use` | The `PyEnv` that is now the default |
|
||||
| `env add` | The added interpreter in the shape of one `env list` element, `source: "manual"`. When discovery also finds that interpreter, `env list` shows it under the discovered source and spelling instead, and the added entry waits unseen |
|
||||
| `env remove` | `{interpreter, removed}` — `removed` is false when it was not on the list, which is not an error (exit 0) |
|
||||
| `list` | `[Dist]`, from the probe; with `--outdated`, `[OutdatedDist]` |
|
||||
| `search` | `[Hit]` |
|
||||
| `info` | `{meta: PackageMeta, freshness: Freshness}` |
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
| Code | Detection (stderr/context pattern) | Cause | User action (EN; VI mirrored in locale files) |
|
||||
|---|---|---|---|
|
||||
| PD-ENV-001 | interpreter path missing/not executable — checked before the probe, and since 1.4.0 also a failed spawn of an interpreter that is not there (it read as PD-ENG-001, "install the engine") | env deleted or moved | Re-scan environments; remove stale entry |
|
||||
| PD-ENV-001 | interpreter path missing/not executable — checked before the probe, and since 1.4.0 also a failed spawn of an interpreter that is not there (it read as PD-ENG-001, "install the engine"). Since 1.6.0 also a path a person supplied that `envs::validate_interpreter` refuses: not named like a Python interpreter (or a link to something that is not), or inside PipDock's own tools or audit venv — checked when it is added, again on every listing, and for the CLI's stored default when it is used | env deleted or moved; the wrong file picked | Re-scan environments; remove stale entry — *Remove from list* on an added row (1.6.0), the first time this advice had a button |
|
||||
| PD-ENV-002 | **Raised by PipDock** on the fresh probe every mutating flow starts with (`flow::preamble`, DATA-FLOW §2): the `EXTERNALLY-MANAGED` marker beside the stdlib, never inside a venv — before any engine command. With the Settings override on, a flow raises it only for pip 23.0, which enforces PEP 668 and has no `--break-system-packages` (it arrived in 23.0.1); pip upkeep refuses a managed Python whatever the setting (DATA-FLOW §7). The `externally-managed-environment` stderr rule is a backstop | PEP 668 protected Python | Use a virtual env; system override only via Settings (discouraged) |
|
||||
| PD-ENV-003 | probe.py non-zero / unparseable; `ModuleNotFoundError` in engine stderr | broken env metadata | Open logs; recreate the venv. A venv under a folder with non-ASCII characters no longer lands here: since 1.4.0 the probe runs under `-X utf8` (ARCHITECTURE §4) |
|
||||
| PD-ENG-001 | engine binary not found: a program that cannot be started (uv not on PATH), `No module named pip`, or `ensurepip` failing to rebuild pip. A missing *interpreter* is PD-ENV-001 and an over-long command line PD-SYS-001 — both were this code before 1.4.0 | pip/uv missing | Install engine or switch engine in Settings |
|
||||
@@ -55,7 +55,7 @@ GUI: `code · localized one-liner · [Details ⌄ stderr tail ≤ 40 lines] · [
|
||||
|
||||
1. The GUI keeps a ring buffer (last 64 KB, `LOG_RING_BUFFER_BYTES`) of engine stdout/stderr, cleared when a plan begins. It holds engine output only: PipDock's own log (`data\logs\`, new in 1.4.0) is not in it and not in the URL — Settings' Logs row copies that log's tail on its own (`logs_tail`).
|
||||
2. **Report bug** builds a prefilled GitHub new-issue URL against `.github/ISSUE_TEMPLATE/bug_report.yml`:
|
||||
`https://github.com/poli0981/pipdock/issues/new?template=bug_report.yml&pd-version=…&os=…&engine=…&python=…&error-code=…&log-excerpt=…`
|
||||
`https://github.com/poli0981org/pipdock/issues/new?template=bug_report.yml&pd-version=…&os=…&engine=…&python=…&error-code=…&log-excerpt=…`
|
||||
Given the environment, `python` carries the engine's version too (`Python 3.12.4 · pip 26.2.1`); the GUI asks for it only when the user clicks, which costs a subprocess (U31).
|
||||
3. URL budget: GitHub rejects very long URLs, so `log-excerpt` is cut, tail-biased, until its **percent-encoded** form fits 6 000 characters (`BUG_REPORT_EXCERPT_CHARS`). The cap was applied before encoding until 1.4.0, and encoding decides what GitHub sees — an accented letter costs up to nine bytes, a path separator three — so a log full of Vietnamese paths built a ~20 KB link and GitHub answered with an error page instead of the form (M51). The full log is not lost: the error row's *Copy full log* puts the whole ring on the clipboard (`BugReportLink.log`), and hides itself when there is nothing to copy.
|
||||
4. Nothing is ever sent automatically — the user reviews the issue form in their browser. This is the entire "telemetry" story, and the row says so beside the button rather than leaving the user to guess what "Report bug" does.
|
||||
|
||||
+5
-3
@@ -39,7 +39,7 @@ PipDock's thesis: **don't reimplement the resolver — explain it.** Wrap pip/uv
|
||||
|
||||
| # | Feature | Notes |
|
||||
|---|---|---|
|
||||
| P0-1 | Environment discovery & switcher | PEP 514 registry + `py -0p` + `uv python list` + known venv dirs + manual browse. Recents persisted. **Manual browse is not built:** `env_add_manual` is the one command still owed (`NOT_YET`), so a venv is found only as a `.venv`, `venv`, `env` or `.env` in the working directory, or named with the CLI's `--env`. **Recents:** the CLI's `env use` default is stored and, since 1.4.0, honoured; the GUI's selection lasts for the session. |
|
||||
| P0-1 | Environment discovery & switcher | PEP 514 registry + `py -0p` + `uv python list` + known venv dirs + manual browse. Recents persisted. **Manual browse shipped in 1.6.0**, the last command `NOT_YET` held: *Add interpreter…* on Environments (and `pipdock env add`) puts any `python.exe` on a list stored in `index.db` and shown after discovery's own, and *Remove from list* (`env remove`) takes it off. Before it the GUI saw a venv only as a `.venv`, `venv`, `env` or `.env` in its working directory — the install folder, for an installed app — so almost no project venv was reachable from the GUI. **Recents:** the CLI's `env use` default is stored and, since 1.4.0, honoured; the GUI's selection lasts for the session. |
|
||||
| P0-2 | PEP 668 guard | Detect `EXTERNALLY-MANAGED`; block by default with explanation; explicit opt-in override only. **The override works since 1.4.0.** It saved and nothing read it, so turning it on changed nothing — and the guard decided on whatever the caller last cached, while the rollback flow had no guard at all. Every mutating flow now decides on a fresh probe; turning the override on asks first, and a chip is shown wherever it applies (SECURITY §3). |
|
||||
| P0-3 | Installed list | Per-env; up-to-date rows dimmed; outdated rows badged and mirrored into Updates tab. |
|
||||
| P0-4 | Updates flow | Group dry-run resolve → preview diff → 3-way conflict choices → two-phase execution → `pip check` post-verify → summary report. **Three parts of this worked only from 1.4.0:** *Force latest* was recorded and never read, so a forced resolve was the held-back one again — it now forces, and the preview names what it breaks before anything runs (DISCLAIMER §2); a post-run check that could not run reported `ok`, and now says it could not; and PipDock enforces `Requires-Python` itself (hard invariant 10), where PD-PKG-001 had never been raised. |
|
||||
@@ -47,7 +47,7 @@ PipDock's thesis: **don't reimplement the resolver — explain it.** Wrap pip/uv
|
||||
| P0-6 | Bulk uninstall + reverse-dep guard | Warn "removing X breaks Y, Z" before execution; `--force` override. |
|
||||
| P0-7 | Pins | Per-env pin list; pinned packages excluded from *Select all*; lock icon in lists. |
|
||||
| P0-8 | Snapshots & rollback | Auto snapshot (freeze + metadata) before every batch; diff view; minimal-ops rollback. |
|
||||
| P0-9 | Engine setting (pip / uv) | Auto-detect uv on first run; switch any time in Settings; engine badge in status bar. **Auto-detect is not implemented, and is owed** (audit backlog X19): a fresh install drives pip (`Settings::default`). `settings.rs` places the detection in Settings, as a choice made where it can be seen, rather than in a read of an empty store — and the CLI follows the stored setting rather than probing `PATH` — but nothing in Settings makes it yet. What exists since 1.4.0 is the half it needs: Settings shows each engine's version for the selected environment beside its radio, *not found* when it is not installed. |
|
||||
| P0-9 | Engine setting (pip / uv) | Auto-detect uv on first run; switch any time in Settings; engine badge in status bar. **Auto-detect is not implemented, and is owed** (audit backlog X19): a fresh install drives pip (`Settings::default`). `settings.rs` places the detection in Settings, as a choice made where it can be seen, rather than in a read of an empty store — and the CLI follows the stored setting rather than probing `PATH` — but nothing in Settings makes it yet. What exists since 1.4.0 is the half it needs: Settings shows each engine's version for the selected environment beside its radio, *not found* when it is not installed. | **Not planned (maintenance mode, 1.6.0)**: the owner decided on 2026-11-21 that the half which exists — Settings shows each engine and its version, and switching is one click — is enough, and a first-run prompt is a new surface rather than a fix.
|
||||
| P0-10 | pip upkeep | Show pip version per env; one-click `python -m pip install --upgrade pip`. |
|
||||
| P0-11 | Code Health tab | deptry + vulture + ruff from PipDock's isolated tools env; report + safe `ruff --fix`. (Promoted to v1 by owner decision 2026-07.) |
|
||||
| P0-12 | CLI core parity | env / list / search / install / update / uninstall / pin / snapshot / doctor / health. JSON output. |
|
||||
@@ -66,10 +66,12 @@ PipDock's thesis: **don't reimplement the resolver — explain it.** Wrap pip/uv
|
||||
| P1-4 | **Partly shipped, 1.1.0.** Cache manager | Shows and clears **PipDock's own** disk usage: snapshots, the Code Health tools venv and, since 1.2.0, the Security tab's audit venv. Logs (1.4.0) are not a target — the sweep keeps 14 days and nothing more, and Settings' Logs row says where they are. `index.db` is reported but not clearable — it holds settings, pins and the consent record in the same file, so "clear the cache" must never take them. **The engine caches (`pip cache`, `uv cache`) are not covered** and are a separate item: they belong to the engine, live outside `%LOCALAPPDATA%\PipDock\`, and purging them is a subprocess rather than a file delete. |
|
||||
| P1-5 | **Shipped 1.1.0.** Command palette | Ctrl+K fuzzy action launcher (terminal-tech signature feature). |
|
||||
| P1-6 | **Shipped 1.3.0.** Dependency view | "Who holds this back" for a selected package: the focused package between its dependents and its dependencies, each edge carrying the specifier written on it, each neighbour clickable to re-centre, plus the two transitive counts and any requirement nothing installed satisfies. **Not a node-link diagram, and that is a measurement rather than a shortcut** — on a 352-package environment a depth-1 neighbourhood is a median of 7 nodes but depth 2 is a median of 172 and exceeds 60 for 212 of 352 packages, and there are over 2000 distinct paths from `setuptools` to a root. So it is drawn at depth 1, depth is navigated by re-centring, and the transitive answer is a count. Added no runtime dependency. |
|
||||
| P1-7 | Scheduled check | Optional background outdated-check with toast (no auto-apply, ever). |
|
||||
| P1-7 | **Not planned (maintenance mode, 1.6.0).** Scheduled check | Optional background outdated-check with toast (no auto-apply, ever). Every prerequisite is absent — no toast, no notification, autostart or tray plugin, nothing on a timer, no surface for a background failure (ROADMAP) — and the persona it serves already has the CLI in Task Scheduler, a recipe CLI-SPEC ships. Building it would be one plugin and a permanent background process for one line of text. |
|
||||
|
||||
### P2 — later
|
||||
|
||||
**Not planned while PipDock is in maintenance mode (from 1.6.0).** Kept as the record of what was considered; CONTRIBUTING.md says what is taken instead.
|
||||
|
||||
| # | Feature | Notes |
|
||||
|---|---|---|
|
||||
| P2-1 | macOS / Linux builds | Tauri makes this near-free; test matrix is the real cost. |
|
||||
|
||||
+37
-44
@@ -1,50 +1,42 @@
|
||||
# PipDock — Release & CI
|
||||
|
||||
*Version 0.2 · 2026-07-27 · CI reuses the `poli0981/.github` ops repo where a suitable reusable workflow exists, and is project-local where one does not. The ops repo's suite was audited on 2026-07-27, and its CodeQL and notifier reusables re-read on 2026-10-17 (see §1 note) — do not assume a reusable exists without checking.*
|
||||
*Version 0.3 · 2026-11-21 · Every workflow is project-local. Until the repository moved to the poli0981org organization (2026-11-21) four of them were callers into the owner's personal ops repo, `poli0981/.github`, at `@main`; §1 says what replaced each and why.*
|
||||
|
||||
## 1. Workflows (`.github/workflows/`)
|
||||
|
||||
| Workflow | Kind | Triggers | Jobs |
|
||||
|---|---|---|---|
|
||||
| `ci-rust.yml` | **project-local** | PR, push main | `fmt · clippy · test` (`windows-latest`): `cargo fmt --check`, clippy `-D warnings`, `cargo test --workspace --locked`. `cargo audit` (`ubuntu-latest`): a prebuilt `cargo-audit`, `--deny warnings`. `cargo deny` (`ubuntu-latest`): licences, sources, bans (`deny.toml`) |
|
||||
| `ci-node.yml` | caller → ops `reusable-web-react.yml` + two local jobs | PR, push main | Node 26, `npm ci`, lint / typecheck / Vitest (each runs only if the npm script exists), `vite build`; local jobs `npm audit --audit-level=high` (after `npm ci --ignore-scripts`) and `tauri lockstep` (`scripts/check-tauri-lockstep.mjs`) |
|
||||
| `ci-integration.yml` | project-local | PR touching what its end-to-end steps run through (the path list is in the file), nightly, Mondays, dispatch | Windows runner, Python 3.10 and 3.14: the disposable-venv suite (TESTING L2); Mondays and dispatch only, the fixture-drift re-capture against the newest pip and uv |
|
||||
| `codeql.yml` | caller → ops `reusable-codeql.yml` | PR, push main, weekly | `languages: '["javascript-typescript", "rust", "actions"]'` |
|
||||
| `security-scan.yml` | **project-local** | daily, dispatch | `cargo audit` and `npm audit` against `main` (SECURITY §7) |
|
||||
| `sonar.yml` | **project-local** | PR, push main, dispatch (`main` only) | `token present` (`ubuntu-latest`) → `coverage · analysis` (`windows-latest`): vitest and `cargo llvm-cov` LCOV, clippy's JSON, then `sonarqube-scan-action` with `sonar.projectVersion` from `package.json` and `sonar.qualitygate.wait`. Skipped when the run has no `SONAR_TOKEN` (Dependabot and fork PRs), and for a dispatch from any branch but `main` — the plan analyses `main` and PRs only. `sonar-project.properties` holds the scope |
|
||||
| `release.yml` | **project-local** | tag `v*`; dispatch (`tag`, `dry_run`) | `Build · checksum` (`windows-latest`, read-only) → `Attest · draft` (`ubuntu-latest`); see §3 |
|
||||
| `announce-release.yml` | caller → ops `announce-release.yml` | release published; dispatch (re-runs) | Discord release announcement |
|
||||
| `notify-ci-failure.yml` | caller → ops `notify-ci-failure.yml` | `workflow_run` completed for `CI / Rust`, `CI / Node`, `CI / Integration`, `Security scan`, `SonarCloud` — **by name** | Discord CI-failure notification |
|
||||
| Workflow | Triggers | Jobs |
|
||||
|---|---|---|
|
||||
| `ci-rust.yml` | PR, push main | `fmt · clippy · test` (`windows-latest`): `cargo fmt --check`, clippy `-D warnings`, `cargo test --workspace --locked`. `cargo audit` (`ubuntu-latest`): a prebuilt `cargo-audit`, `--deny warnings`. `cargo deny` (`ubuntu-latest`): licences, sources, bans (`deny.toml`) |
|
||||
| `ci-node.yml` | PR, push main | `lint · typecheck · test · build` (Node 26, `npm ci`, ESLint, `tsc`, Vitest, `vite build`); `npm audit --audit-level=high` (after `npm ci --ignore-scripts`); `npm licences` (`scripts/check-licenses.mjs` and its `node --test` suite — §2); `tauri lockstep` (`scripts/check-tauri-lockstep.mjs`) |
|
||||
| `ci-integration.yml` | PR touching what its end-to-end steps run through (the path list is in the file), nightly, Mondays, dispatch | Windows runner, Python 3.10 and 3.14: the disposable-venv suite (TESTING L2); Mondays and dispatch only, the fixture-drift re-capture against the newest pip and uv |
|
||||
| `codeql.yml` | PR, push main, weekly | `Analyze (<language>)` for `javascript-typescript`, `rust` and `actions`, all `build-mode: none` |
|
||||
| `qodana.yml` | PR, push main, dispatch | `tokens present` → `qodana · rust` (Docker, `qodana-rust.yaml`) and `qodana · ts/js` (native, `qodana-js.yaml`), one Qodana Cloud project and token each; skipped without a token, like `sonar.yml` |
|
||||
| `security-scan.yml` | daily, dispatch | `cargo audit` and `npm audit` against `main` (SECURITY §7) |
|
||||
| `sonar.yml` | PR, push main, dispatch (`main` only) | `token present` (`ubuntu-latest`) → `coverage · analysis` (`windows-latest`): vitest and `cargo llvm-cov` LCOV, clippy's JSON, then `sonarqube-scan-action` with `sonar.projectVersion` from `package.json` and `sonar.qualitygate.wait`. Skipped when the run has no `SONAR_TOKEN` (Dependabot and fork PRs), and for a dispatch from any branch but `main` — the plan analyses `main` and PRs only. `sonar-project.properties` holds the scope and the project, `poli0981org_pipdock` since 2026-11-21 |
|
||||
| `release.yml` | tag `v*`; dispatch (`tag`, `dry_run`) | `Build · checksum` (`windows-latest`, read-only) → `Attest · draft` (`ubuntu-latest`); see §3 |
|
||||
| `notify.yml` | `workflow_run` of the workflows above, **by name**; release published; dispatch (`tag`, to announce again) | `ci-failure` → `DISCORD_CI_WEBHOOK`; `announce` → `DISCORD_RELEASES_WEBHOOK` and `DISCORD_REPO_WEBHOOK`, both through `.github/scripts/discord_notify.py` (standard library; `DRY_RUN=1` prints instead of posting) |
|
||||
|
||||
**`notify-ci-failure.yml` names its workflows, and a new workflow is added to it by its exact `name:`.** `workflows: ['*']` — the ops repo's own caller example — is not a wildcard to `workflow_run`: it matched nothing, so `main` stayed red from 2026-09-23 with every failure unreported. The reusable reports only failures on the default branch, and skips by name any workflow that has a dedicated notifier (CodeQL, Dependabot, deploy, Pages, release), which is why `CodeQL` and `Release` are not listed: listing them would only create skipped runs. A failed `Release` run therefore reaches no Discord channel; whoever pushed the tag has to watch it.
|
||||
**`notify.yml` names its workflows, and a new workflow is added to it by its exact `name:`.** `workflows: ['*']` — the ops repo's old caller example — is not a wildcard to `workflow_run`: it matched nothing, so `main` stayed red from 2026-09-23 with every failure unreported. It reports a failure from any event but a pull request, filtering on the event alone — never on a branch name, which a fork controls. CodeQL, Qodana and Release are listed: the ops-repo notifier skipped anything named like CodeQL or Release because of "dedicated notifiers" PipDock never had, so a failed Release run reached no channel at all.
|
||||
|
||||
**Ops-repo audit (2026-07-27; CodeQL and the notifier re-read 2026-10-17) — why the table looks like this:**
|
||||
**Why nothing calls the ops repo any more (2026-11-21).** The repository moved to the poli0981org organization so that the projects the owner maintains seriously sit apart from the ones made for fun, and a project in the organization should not run code another account can change. The four callers were exactly that: `@main` of `poli0981/.github`, unpinned, and its notifier checked out that repository's `main` and ran *its* Python script with PipDock's Discord webhooks in the environment. Each was small enough to copy, as OmniDeck — the organization's other project — had already done:
|
||||
|
||||
- The reusable suite covers assembly, c-cpp, chrome-extension, desktop-csharp, go, jvm, macos-swift, php, python, r, ruby and web-react. **There is no Rust reusable and no Tauri reusable**, and only `reusable-desktop-csharp.yml` uses a Windows runner — hence `ci-rust.yml`, `release.yml` and `security-scan.yml` are project-local. There is no SonarQube reusable either (re-checked 2026-10-25), so `sonar.yml` is project-local too.
|
||||
- `reusable-web-react.yml` has **no `working-directory` input** (it runs `npm ci` at the repo root — hence `package.json` lives at the root with Vite's `root: './ui'`, see ARCHITECTURE §2) and **no `npm audit` step**, hence the extra local job.
|
||||
- `reusable-codeql.yml` *documents* csharp, python, javascript-typescript, ruby, c-cpp, java-kotlin, go and swift, but hands `languages` straight to `codeql-action`, with `build-mode: none` for anything outside its autobuild list — so `rust` and `actions` run through it unchanged. This bullet said **CodeQL has no Rust analyzer**, so Rust's coverage came from clippy and `cargo audit` alone; the premise stopped being true in 2025, and `codeql.yml` now asks for both. Only the JavaScript/TypeScript analysis is a required check (§2).
|
||||
- Portfolio notifications are **Discord-only**, driven by the ops repo's `.github/scripts/discord_notify.py`. There is no multi-platform `notify.py`.
|
||||
- `reusable-web-react.yml` became `ci-node.yml`'s `lint · typecheck · test · build` job. It took two things with it: the `pages: write` and `id-token: write` grants its always-skipped Pages job forced on the caller (permissions are validated at startup regardless of `if:`), and the `dist` artifact nothing downloaded. Its missing `working-directory` input was why `package.json` sits at the repository root; the layout stays, because SonarCloud, Qodana, the scripts and Tauri's configuration all assume it now (ARCHITECTURE §2).
|
||||
- `reusable-codeql.yml` became `codeql.yml`'s matrix job, with `codeql-action` pinned by commit where the reusable used `@v4`, and the same `category` values, so the alerts keep their history. Rust and Actions run as they did through the reusable, which handed `languages` straight to the action.
|
||||
- `notify-ci-failure.yml` and `announce-release.yml` became `notify.yml`, with the script vendored from OmniDeck's self-contained notifier.
|
||||
|
||||
**Permissions matrix (explicit in every caller — the Phase-5 lesson: callers without a `permissions:` block default everything to `none`):**
|
||||
**Every action is pinned by commit**, with its version in a comment for Dependabot to update — GitHub's own `actions/*` included, which had used major tags. A write permission sits on the job that needs it, never the workflow (SonarCloud S8233):
|
||||
|
||||
```yaml
|
||||
# codeql.yml
|
||||
# every workflow
|
||||
permissions: { contents: read }
|
||||
# codeql.yml — analyze
|
||||
permissions: { actions: read, contents: read, packages: read, security-events: write }
|
||||
# announce-release.yml / notify-ci-failure.yml
|
||||
permissions: { contents: read, actions: read }
|
||||
# ci-node.yml — the workflow, and the one job that calls the reusable
|
||||
permissions: { contents: read }
|
||||
# web: { contents: read, pages: write, id-token: write }
|
||||
# release.yml — the workflow, then each job (§3)
|
||||
permissions: { contents: read }
|
||||
# build: { contents: read }
|
||||
# publish: { contents: write, id-token: write, attestations: write }
|
||||
# ci-rust.yml / ci-integration.yml / security-scan.yml / sonar.yml
|
||||
permissions: { contents: read }
|
||||
# qodana.yml — rust, js
|
||||
permissions: { contents: read, checks: write, pull-requests: write, security-events: write }
|
||||
# release.yml — publish (§3)
|
||||
permissions: { contents: write, id-token: write, attestations: write }
|
||||
```
|
||||
|
||||
**The lesson has a converse: a caller must grant at least what the callee's jobs declare, even for a job that will be skipped**, because permissions are validated at startup regardless of `if:`. `reusable-codeql.yml`'s analyze job asks for `packages: read`, and a caller without it got a `startup_failure` with no logs to explain it; `reusable-web-react.yml` declares a Pages-deploy job needing `pages: write` and `id-token: write`, skipped here by `deploy-pages: false` and validated all the same. A write is granted on the job that needs it, never the workflow (SonarCloud S8233), so no other job holds one. This block showed neither of those grants and gave `release.yml` `contents: write` across the board; since 1.4.0 the release's write lives on its publish job alone.
|
||||
|
||||
## 2. Branch & version policy
|
||||
|
||||
`main` protected (PR + green CI required). SemVer; tags `vX.Y.Z`, and `release.yml` refuses a tag that does not match all five version fields (§3). Commit subjects follow Conventional Commits, but nothing generates a changelog from them — this line said a generator did. `changelog/` is written by hand, for a user, under the rules in `changelog/README.md`; a draft release's notes are GitHub's generated list of merged pull requests.
|
||||
@@ -53,7 +45,7 @@ permissions: { contents: read }
|
||||
|
||||
| Setting | Value | Why |
|
||||
|---|---|---|
|
||||
| Required checks | `fmt · clippy · test`, `cargo audit`, `lint · typecheck · test · build / build`, `npm audit`, `analyze / Analyze (javascript-typescript)` | the five that ran on **every** PR when the payload was set; four more do now (below) |
|
||||
| Required checks | `fmt · clippy · test`, `cargo audit`, `cargo deny`, `lint · typecheck · test · build`, `npm audit`, `npm licences`, `tauri lockstep`, `Analyze (javascript-typescript)` | eight, all running on **every** PR (below) |
|
||||
| Check app | pinned to `app_id: 15368` (`github-actions`) | a check from another app cannot satisfy a requirement |
|
||||
| `enforce_admins` | `true` | the owner is the only contributor; protection that exempts them protects nothing |
|
||||
| Required approvals | **0** | a solo owner cannot approve their own PR, so 1 would deadlock. A PR is still required |
|
||||
@@ -64,17 +56,18 @@ permissions: { contents: read }
|
||||
|
||||
**`CI / Integration` is deliberately excluded, and this is the trap worth remembering:** its `pull_request` trigger is `paths:`-filtered, so on a docs-only or UI-only PR it never starts — and a required check that never starts stays *pending forever*. Requiring it would deadlock exactly the PRs it has no opinion about. `Re-capture against the latest engines` runs on no PR at all (Mondays and dispatch only) and is excluded for the same reason. The bare `CodeQL` check belongs to the `github-advanced-security` app rather than Actions and is left out too.
|
||||
|
||||
**Four more run on every PR and are not in the payload** — `cargo deny`, `tauri lockstep`, and CodeQL's `analyze / Analyze (rust)` and `analyze / Analyze (actions)` — all added in 1.4.0, after the five above were set (re-read 2026-10-17; the payload is unchanged). Until they are added, a red one is advice rather than a gate, which matters most for `tauri lockstep`: its whole purpose is to stop one half of a Tauri bump merging alone. `Security scan` runs on no PR and can never be required. SonarQube Cloud is not required either, in either form: `SonarCloud Code Analysis` is reported by the SonarCloud app, which the payload's `app_id` pin would not accept, and `sonar.yml`'s `coverage · analysis` is *skipped* on every PR without a token — Dependabot's — and a skipped job satisfies a requirement, so requiring it would gate exactly the PRs it never looks at.
|
||||
**The payload has had two shapes.** The first, set on 2026-08-14, held five checks — `fmt · clippy · test`, `cargo audit`, `lint · typecheck · test · build / build`, `npm audit` and `analyze / Analyze (javascript-typescript)` — and two of those names were the ops repo's: a reusable workflow's check is `<caller job> / <callee job>`, so a rename upstream would have deadlocked every PipDock PR with no failing check to point at. The second, set on 2026-11-21 when the callers became local jobs, renames those two to `lint · typecheck · test · build` and `Analyze (javascript-typescript)` and adds three that had run on every PR since 1.4.0 as advice rather than gates: `cargo deny`, `npm licences` (new that day) and `tauri lockstep`, whose whole purpose is to stop one half of a Tauri bump merging alone. **A required name is now this repository's alone, so renaming a job means changing this payload in the same change.**
|
||||
|
||||
**Two required contexts are named by the ops repo, not by this one.** `analyze / Analyze (javascript-typescript)` and `lint · typecheck · test · build / build` come from `poli0981/.github`'s reusables. If either job is renamed upstream, every PipDock PR deadlocks with no obvious cause and no failing check to point at — the fix is to update the protection payload, not the code.
|
||||
**Still not required, and why.** CodeQL's `Analyze (rust)` and `Analyze (actions)` run on every PR and stay advice. `Security scan` runs on no PR and can never be required. SonarQube Cloud is not required in either form: `SonarCloud Code Analysis` is reported by the SonarCloud app, which the payload's `app_id` pin would not accept, and `sonar.yml`'s `coverage · analysis` is *skipped* on every PR without a token — Dependabot's — and a skipped job satisfies a requirement, so requiring it would gate exactly the PRs it never looks at. Qodana is not required for the same reason, and because one of its two linters is a JetBrains early-access build behind an external service.
|
||||
|
||||
**If protection wedges**, `PUT` the same endpoint with `enforce_admins: false`, or `DELETE /branches/main/protection`. Worth knowing before it is needed rather than discovering it during an incident.
|
||||
|
||||
Dependency updates use **Dependabot** (`.github/dependabot.yml`) — the portfolio standard, as evidenced by the ops repo's `dependabot-summary.yml`; there is no Renovate configuration anywhere in the ops repo. **Five ecosystems**, weekly on Mondays: `cargo`, `npm`, `github-actions`, `pip` at `/tools` (the Code Health pins) and, since 1.4.0, `rust-toolchain` — the `rust-toolchain.toml` channel, in a PR of its own because a toolchain brings new clippy lints. Minor and patch updates are grouped per ecosystem; security advisories arrive as **immediate, ungrouped** PRs (Dependabot's default for security updates), and the `pip` ecosystem stays its own group so Code Health pin bumps are reviewable in isolation — a bump there also needs `tools/tools-constraints.txt` regenerated (the command is in its header), and `cargo test` fails until it is (CODE-HEALTH-SPEC §2). Watching `pip`/`uv` releases to trigger the parser-fixture job is the scheduled job in `ci-integration.yml`, not the dependency bot. Since 1.4.0:
|
||||
Dependency updates use **Dependabot** (`.github/dependabot.yml`) — the standard of the owner's ops repo when the CI was set up, and of the poli0981org organization now; nothing here uses Renovate. **Five ecosystems**, weekly on Mondays: `cargo`, `npm`, `github-actions`, `pip` at `/tools` (the Code Health pins) and, since 1.4.0, `rust-toolchain` — the `rust-toolchain.toml` channel, in a PR of its own because a toolchain brings new clippy lints. Minor and patch updates are grouped per ecosystem; security advisories arrive as **immediate, ungrouped** PRs (Dependabot's default for security updates), and the `pip` ecosystem stays its own group so Code Health pin bumps are reviewable in isolation — a bump there also needs `tools/tools-constraints.txt` regenerated (the command is in its header), and `cargo test` fails until it is (CODE-HEALTH-SPEC §2). Watching `pip`/`uv` releases to trigger the parser-fixture job is the scheduled job in `ci-integration.yml`, not the dependency bot. Since 1.4.0:
|
||||
|
||||
- **Cooldowns.** A release must be 3 days old before cargo or npm proposes it (14 for a major), and 7 for Actions and the tool pins. Most yanked or compromised releases are pulled inside that window, and nothing here needs a dependency the day it ships.
|
||||
- **Tauri moves in lockstep.** The `tauri` crate and `@tauri-apps/api` must share a minor or the app refuses to start, and Dependabot bumps Cargo and npm in separate PRs, each green on its own. So each ecosystem groups its Tauri packages (`tauri`, `tauri-*`; `@tauri-apps/*`) ahead of its catch-all group, and `ci-node.yml`'s `tauri lockstep` job fails either PR until its counterpart lands beside it, comparing the core and each plugin with its npm package on `Cargo.lock` and `package-lock.json` — what is built, not what the manifests ask for. **A multi-ecosystem group was considered and not used:** it would put both halves in one PR, but what it does to the dependencies outside its patterns is undocumented, and a wrong guess would silently stop every other update.
|
||||
- **TypeScript is held below 6.1** (`ignore: typescript >=6.1.0`): typescript-eslint 8.71 peers `typescript >=4.8.4 <6.1.0`, so a 6.1 bump fails `npm ci` with ERESOLVE before a single check runs. Remove it once typescript-eslint widens its range (8.72 still peers `<6.1.0`, re-read 2026-10-25, with TypeScript at 7.0).
|
||||
- **Tauri moves in lockstep.** The `tauri` crate and `@tauri-apps/api` must share a minor or the app refuses to start, and Dependabot bumps Cargo and npm in separate PRs, each green on its own. So each ecosystem groups its Tauri packages (`tauri`, `tauri-*`; `@tauri-apps/*`) apart from its catch-all group — by `exclude-patterns` on the catch-all, since 2026-11-21: Dependabot gives a dependency to the *most specific* matching group, it counts a group with `update-types` as more specific than one with patterns alone, and so the order this bullet used to rely on did nothing (that week's Tauri bumps landed in #116 and #118, the catch-alls) — and `ci-node.yml`'s `tauri lockstep` job fails either PR until its counterpart lands beside it, comparing the core and each plugin with its npm package on `Cargo.lock` and `package-lock.json` — what is built, not what the manifests ask for. **A multi-ecosystem group was considered and not used:** it would put both halves in one PR, but what it does to the dependencies outside its patterns is undocumented, and a wrong guess would silently stop every other update.
|
||||
- **TypeScript is held below 6.1** (`ignore: typescript >=6.1.0`): typescript-eslint 8.71 peers `typescript >=4.8.4 <6.1.0`, so a 6.1 bump fails `npm ci` with ERESOLVE before a single check runs. Remove it once typescript-eslint widens its range (8.73 still peers `<6.1.0`, re-read 2026-11-21, with TypeScript at 7.0).
|
||||
- **rfd is held below 0.18** (`ignore: rfd >=0.18.0`, cargo): src-tauri takes rfd only because tauri-plugin-dialog compiles it, and 2.8.4, the newest, still requires `^0.17` — so #112's rfd 0.18 alone would have put a second rfd in the binary. Remove it when the plugin moves, and bump both together.
|
||||
- **Vitest moves as one** (group `vitest`: `vitest`, `@vitest/*`, every update type). `@vitest/coverage-v8`, which `sonar.yml` needs, peers `vitest` at its exact version, so a bump of either alone fails `npm ci` the way the TypeScript one would.
|
||||
- **Labels.** PRs are labelled `dependencies` plus `rust`, `frontend`, `ci` or `code-health`, and the labels must exist in the repository or Dependabot opens its PRs without them (§5).
|
||||
|
||||
@@ -91,8 +84,8 @@ Two jobs, so the token that can write a release never runs the build (SECURITY
|
||||
The frontend is built by tauri's `beforeBuildCommand`, so the workflow does not run `vite build` itself.
|
||||
- **`SHA256SUMS.txt`**, LF line endings, written byte for byte: `Set-Content` wrote CRLF, and `sha256sum -c` on any other platform reads the CR as part of the file name and reports the file missing.
|
||||
- The installers and the checksums are uploaded as the `release-artifacts` workflow artifact.
|
||||
2. **`Attest · draft`** — Ubuntu runner, the only job granted `contents`, `id-token` and `attestations` write. It downloads the build, attests build provenance for the `.exe` and the `.msi` (`actions/attest-build-provenance`, verifiable with `gh attestation verify <file> --repo poli0981/pipdock`), and drafts the GitHub release with GitHub's generated notes and all three files (`softprops/action-gh-release`). Both actions are pinned by commit.
|
||||
3. **Publishing the draft is a human decision**, taken per release; publishing fires `announce-release.yml`'s Discord announcement. For 1.4.0 the owner approved the plan and instructed the assistant to check the installers against `SHA256SUMS.txt` and then publish — `docs/AI-DISCLOSURE.md` records who did what.
|
||||
2. **`Attest · draft`** — Ubuntu runner, the only job granted `contents`, `id-token` and `attestations` write. It downloads the build, attests build provenance for the `.exe` and the `.msi` (`actions/attest-build-provenance`, verifiable with `gh attestation verify <file> --repo poli0981org/pipdock`; an attestation stays with the account that made it, so 1.4.0 and 1.5.0, built before the move to the organization, verify with `--owner poli0981 --signer-repo poli0981/pipdock` and no longer with any `--repo`), and drafts the GitHub release with GitHub's generated notes and all three files (`softprops/action-gh-release`). Both actions are pinned by commit.
|
||||
3. **Publishing the draft is a human decision**, taken per release; publishing fires `notify.yml`'s Discord announcement. For 1.4.0 the owner approved the plan and instructed the assistant to check the installers against `SHA256SUMS.txt` and then publish — `docs/AI-DISCLOSURE.md` records who did what.
|
||||
|
||||
**A dry run** — `workflow_dispatch` with `dry_run` — builds and checksums any ref, a branch before it merges included, and attests and drafts nothing, so the release recipe is tested before a tag depends on it. Without `dry_run`, dispatch builds a version tag only (the `tag` input re-runs one); a branch is refused.
|
||||
|
||||
@@ -100,7 +93,7 @@ This list had a fourth step — a post-release checklist issue, opened automatic
|
||||
|
||||
There is no signing step. **PipDock does not update itself** (SECURITY §5), so no `latest.json` is produced, no artifact is code-signed, and no keypair exists to manage. The attestation is signed through Sigstore with a short-lived certificate bound to the workflow run — which is why the publish job needs `id-token: write` — so it adds no key either.
|
||||
|
||||
Secrets bootstrap: set per-repo with `gh secret set` (the ops repo has no `setup-secrets.sh`) — the Discord webhooks the ops-repo notifiers expect (`DISCORD_RELEASES_WEBHOOK`, `DISCORD_REPO_WEBHOOK`, `DISCORD_CI_WEBHOOK`; the callers pass `secrets: inherit`). That is the whole list.
|
||||
Secrets bootstrap: set per repository with `gh secret set`, none at the organization — the Discord webhooks `notify.yml` posts to (`DISCORD_RELEASES_WEBHOOK`, `DISCORD_REPO_WEBHOOK`, `DISCORD_CI_WEBHOOK`), `SONAR_TOKEN` for `sonar.yml` (re-issued for the `poli0981org` SonarQube Cloud organization on 2026-11-21), and `QODANA_TOKEN_RUST` and `QODANA_TOKEN_TS_JS` for the two Qodana Cloud projects `qodana.yml` reports to. That is the whole list; a transfer between owners keeps a repository's secrets, and it kept these.
|
||||
|
||||
## 4. Artifact & support policy
|
||||
|
||||
@@ -112,8 +105,8 @@ Two active lines at most: latest release gets features; previous minor gets secu
|
||||
- [x] `.github/ISSUE_TEMPLATE/bug_report.yml` (shipped in this suite) + `config.yml` disabling blank issues.
|
||||
- [x] `.github/dependabot.yml` covering cargo, npm, github-actions and the Code Health pins — and the Rust toolchain since 1.4.0.
|
||||
- [x] `rust-toolchain.toml`, `.nvmrc` (26 — it said 24 until 1.5.0, a month after every workflow had moved to 26), `Cargo.lock`/`package-lock.json` committed.
|
||||
- [x] **Repo settings (owner, via the GitHub UI or `gh` — not committable):** branch protection on `main`; disable Advanced Security → CodeQL *Default setup* (the reusable is advanced-setup and is rejected at upload time otherwise); enable Discussions for the issue-template contact links.
|
||||
- [x] **Secrets via `gh secret set`:** the Discord webhooks (`DISCORD_RELEASES_WEBHOOK`, `DISCORD_REPO_WEBHOOK`, `DISCORD_CI_WEBHOOK`). No signing key — see §3.
|
||||
- [x] **Repo settings (owner, via the GitHub UI or `gh` — not committable):** branch protection on `main`; disable Advanced Security → CodeQL *Default setup* (`codeql.yml` is an advanced setup, and is rejected at upload time otherwise); enable Discussions for the issue-template contact links.
|
||||
- [x] **Secrets via `gh secret set`:** the Discord webhooks (`DISCORD_RELEASES_WEBHOOK`, `DISCORD_REPO_WEBHOOK`, `DISCORD_CI_WEBHOOK`), `SONAR_TOKEN`, `QODANA_TOKEN_RUST`, `QODANA_TOKEN_TS_JS` (§3). No signing key — see §3.
|
||||
- [x] App icon settled (`src-tauri/icons/`). It was called a placeholder because nobody had chosen it; the owner chose it in Phase 4, which is what "a brand decision" needed.
|
||||
- [x] README badges: CI, CodeQL, release, license.
|
||||
- [x] **Labels (owner, repo settings — opened by 1.4.0):** `dependencies`, `rust`, `frontend`, `ci` and `code-health` for Dependabot (§2), and `triage` for `bug_report.yml`. None existed on 2026-10-17; all six did by 2026-11-10, when `accessibility` joined them for `accessibility.yml`.
|
||||
|
||||
+179
-3
@@ -740,7 +740,7 @@ Three things it settled that outlive it:
|
||||
|
||||
## Post-1.0 (P1 wave)
|
||||
|
||||
Security tab (pip-audit), pin auto-suggest, requirements/constraints export-import, cache manager, command palette, dependency graph view, scheduled check. **Six of the seven have shipped** — four in 1.1.0, the Security tab in 1.2.0 and the dependency view in 1.3.0; the scheduled check remains. Then P2 candidates by demand: macOS/Linux, per-env engine, elevation broker, winget, JP locale.
|
||||
Security tab (pip-audit), pin auto-suggest, requirements/constraints export-import, cache manager, command palette, dependency graph view, scheduled check. **Six of the seven have shipped** — four in 1.1.0, the Security tab in 1.2.0 and the dependency view in 1.3.0; the scheduled check is **not planned**, decided with the move to maintenance mode in 1.6.0 (*Maintenance mode*, below). Then P2 candidates by demand: macOS/Linux, per-env engine, elevation broker, winget, JP locale.
|
||||
|
||||
**About shipped early, in Phase 4** — see above. Two smaller items were added to this wave rather
|
||||
than done at 1.0:
|
||||
@@ -959,8 +959,9 @@ mode that is *silent*, and the reason SECURITY §4 requires the widening in pros
|
||||
has always said audit never applies anything; "update to fixed version" is the ordinary Update flow,
|
||||
reached by the user.
|
||||
|
||||
**What is left of Post-1.0 is one item**: the scheduled check (PRD P1-7). The dependency view
|
||||
shipped as 1.3.0; its record is below.
|
||||
**Nothing is left of Post-1.0.** The scheduled check (PRD P1-7) was the last item, and on
|
||||
2026-11-21 the owner closed it as not planned, for the reasons the survey below gives; the
|
||||
dependency view shipped as 1.3.0, and its record is below.
|
||||
|
||||
*This paragraph used to point at "the analysis above" for what blocked each of two items. There was
|
||||
no such analysis anywhere in this document* — the survey existed only outside the repository, and
|
||||
@@ -1388,6 +1389,8 @@ starting a slice**: several are cheaper inside a slice that touches the same fil
|
||||
| — | `pipdock-cli` `apply_fix`; `health::fix::dirty` | `health --fix --yes` outside a git repository proceeds: `dirty` answers `None` for a clean tree and for no repository alike | Needs a three-way answer from `dirty`, which the GUI's `health_dirty` shares |
|
||||
| — | `pipdock-cli` | On a terminal, an impossible package is skipped at the prompt without the engine's explanation; `report-bug` points at a log excerpt the CLI never attaches; `uninstall --json --force` warns about "the breakage above", which JSON mode never printed | Small CLI copy fixes |
|
||||
| X36/U55 | `src-tauri/src/commands.rs:425-467,1189-1214,1350-1377` | Save and export accept any path the webview names, and overwrite a sibling without asking | The picker is the only caller today; defence in depth, not a reachable hole |
|
||||
| X36-b | `src-tauri/src/commands.rs` — every command taking a `PyEnv` (`pkg_list`, `pip_upgrade`, `deps_graph`, `plan_resolve`, `health_run`, `audit_run`, `engine_info`…) and `env_probe` | The interpreter a `PyEnv` names is run as the webview hands it back, and `env_probe` validates only a path the webview calls `manual` | Found by 1.6.0's independent review; predates it. The paths come from `env_scan`, which checks added entries itself, so this is defence in depth against a compromised webview — a `validate_interpreter` per command, its own change |
|
||||
| — | `exec.rs:633` `canonical_interpreter` | An interpreter on a share hashes as `unc\server\share\…`: the verbatim prefix `\\?\` is stripped, `\\?\UNC\` is not | Correcting it changes the identity — and orphans the pins and snapshots — of every interpreter on a share |
|
||||
| — | `envs/mod.rs:131-138`, `engine/parse.rs:103-108`, `exec.rs:367-375`, `pins/mod.rs:85-89`, `store/mod.rs:253`, `index/mod.rs:144,448` | Failures that are dropped without a log line (a probe error entry, an unreadable pin row, a Job Object that would not attach…) | The log exists now; each wants a `tracing::warn!` and a look at whether it should surface |
|
||||
| — | `PIP_MIN_VERSION_FOR_REPORT`, `UV_MIN_VERSION`, `probe_supported`, `MIN_PROBE_PYTHON` | Declared floors nothing enforces | Enforcing them is a user-visible refusal and wants its own copy and test |
|
||||
| L56 | `audit.rs:165-168` | An audit's package count includes skipped packages | Cosmetic |
|
||||
@@ -1618,6 +1621,179 @@ said so in the PR: i18next 27 with react-i18next 18, and jsdom 31 — majors ins
|
||||
window, the first with new defaults and stricter `t()` types that want a session of their own —
|
||||
and rfd 0.18, which tauri-plugin-dialog 2.8.4 still pins below.
|
||||
|
||||
## After 1.5.0 — the move to poli0981org — **2026-11-21**
|
||||
|
||||
No version of its own; it ships inside 1.6.0. The owner moved the repository from `poli0981/pipdock`
|
||||
to the **poli0981org** organization, to keep the projects maintained seriously apart from the ones
|
||||
made for fun, and asked for everything that move touches: the alerts and the open Dependabot PRs,
|
||||
Qodana on the owner's Ultimate plan, a licence check for the dependencies, CI that lives in the
|
||||
repository ("mono repo"), and proof that the repository works in its new home. One PR,
|
||||
[#119](https://github.com/poli0981org/pipdock/pull/119), superseding #113–#118.
|
||||
|
||||
**Where it started.** `main` had been red every day since 2026-11-18, and so had `cargo audit` on
|
||||
all four of the week's Dependabot PRs: **RUSTSEC-2026-0543, chrono unmaintained** — in `Cargo.lock`,
|
||||
and compiled into nothing.
|
||||
|
||||
| What | Now |
|
||||
|---|---|
|
||||
| chrono | Listed only because serde_with 3.24's `std` feature carries the weak features `chrono_0_4?/clock` and `chrono_0_4?/std`, which Cargo's lock resolution records even when nothing enables them; `cargo tree -i chrono --target all` prints nothing. Ignored in `.cargo/audit.toml` with that reason and its exit condition |
|
||||
| Dependencies | #113–#118 cherry-picked (Rust 1.100.0, rusqlite 0.42.0, Tauri 2.12.6 with its npm half, the code-health pins, three actions, eleven npm packages) plus jsdom 31.0.1. No new clippy lint fired; neither rusqlite nor jsdom needed a code change; `tools-constraints.txt` regenerated by its header's command came out byte-identical to Dependabot's edit; the drift job, dispatched on the branch, found no engine output moved |
|
||||
| minimatch | GHSA-g3hv-75wg-m249, tolerated since 2026-11-04, is gone: ESLint 10.15 and typescript-eslint 8.73 moved to minimatch 11 (11.0.9 throughout) |
|
||||
| rfd 0.18 (#112) | Not taken. tauri-plugin-dialog 2.8.4 is still the newest and still requires `^0.17`; the ignore is back, with its exit condition |
|
||||
| CI | Every workflow is local and every action pinned by commit (RELEASE-CI §1). Branch protection's payload changed with it: the two names the ops repo owned are renamed, and `cargo deny`, `npm licences` and `tauri lockstep` are required — eight checks |
|
||||
| Licences | `npm licences`: 18 production packages, all MIT, Apache-2.0 or both. Proved to fail on a lockfile with one licence changed to CC-BY-4.0 |
|
||||
| Qodana | Two Qodana Cloud projects, two configs, two tokens; full scans; a Rust baseline; `--fail-threshold 0` |
|
||||
| SonarQube Cloud | `poli0981org_pipdock`, empty until this branch's first analysis; the old project keeps the history to 1.5.0 |
|
||||
|
||||
**What running found that reading did not:**
|
||||
|
||||
- **Dependabot's groups had never worked as written.** It gives a dependency to the *most specific*
|
||||
group, and counts one with `update-types` as more specific than one with patterns alone — its own
|
||||
log: "Skipping tauri-plugin-dialog for group 'tauri' - belongs to more specific group
|
||||
'cargo-minor-patch'". The `tauri` groups caught nothing, while `dependabot.yml` said their order
|
||||
kept Tauri out of the catch-alls. `exclude-patterns` on each catch-all now does.
|
||||
- **Qodana's first Rust result was 0 problems, from 0 files analysed** — the same shape as 1.4.0's
|
||||
"a check that cannot run must not report a pass". The linter container runs as the runner's
|
||||
user, so rustup could not install the toolchain `rust-toolchain.toml` pins (it writes under
|
||||
`/usr/local/rustup`, root's), `cargo metadata` failed, and RustRover loaded no Cargo project and
|
||||
inspected nothing. Fixing that exposed the second half: `CARGO_HOME` was root's too, and the
|
||||
registry download failed with "Permission denied". The bootstrap now points the job's own checkout
|
||||
at the image's toolchain (1.94.0), and `CARGO_HOME` lives in the action's cache mount. The third
|
||||
run analysed the workspace and found 62.
|
||||
- **Of the 62, two are Critical and both are RustRover misreading code rustc compiles**: "value
|
||||
used after being moved" on a `std::io::ErrorKind`, which is `Copy` (`exec.rs`, a test), and
|
||||
"takes 2 parameters, 1 supplied" on an `async_trait` method called through `Box<dyn Engine>`
|
||||
(`commands.rs`). The other 60 are Moderate style: 49 unnecessary path qualifications, 10
|
||||
duplicated fragments, 1 trait-member order in a test fake. All 62 are the baseline; anything
|
||||
new fails the run. Qodana for JS found six and all were fixed: five `React.*` types reached
|
||||
through the UMD global rather than imported, and one High, `step` "possibly null" in
|
||||
`PdPlanPanel` — which TypeScript narrows through an aliased condition and an optional chain, and
|
||||
WebStorm's engine through neither, so it took an explicit `step !== null`.
|
||||
- **SonarQube Cloud's first gate on the branch failed on code it had never seen**: `npm ci` running
|
||||
lifecycle scripts in the web and Qodana jobs (githubactions:S6505). It ran the same way inside the
|
||||
ops repo's reusable, where nothing analysed it. The one package with an install script is
|
||||
fsevents, macOS-only; every `npm ci` in the workflows passes `--ignore-scripts` now.
|
||||
- **An attestation stays with the account that made it.** After the transfer, README's own command
|
||||
— `gh attestation verify <file> --repo poli0981/pipdock` — answered 404 for 1.5.0, and so does
|
||||
`--repo poli0981org/pipdock`: the attestations of 1.4.0 and 1.5.0 are reachable only through the
|
||||
user account that owned the repository when they were made. `--owner poli0981 --signer-repo
|
||||
poli0981/pipdock` verifies them, checked against the real 1.5.0 installer. A user following
|
||||
README to the letter would have been told not to run a genuine build.
|
||||
- **A flaky runner, recorded so it is not chased again.** One integration job failed before any
|
||||
test: rustup on the Windows image reported "detected conflict: `bin\cargo-clippy.exe`" while
|
||||
installing Rust 1.100.0's components. The same toolchain installed cleanly on every other Windows
|
||||
job, and the same job passed on the branch's next run.
|
||||
|
||||
**Kept as it was, on purpose**: `package.json` at the repository root — its original reason (the
|
||||
reusable's missing `working-directory`) is gone, but SonarQube Cloud, Qodana, the scripts and
|
||||
Tauri's configuration all assume the root now. And `pr-mode` is off in `qodana.yml`, where the plan
|
||||
had put it back on: a whole scan is two to three minutes a part, so analysing only a pull
|
||||
request's files would save little and make a result depend on which files changed.
|
||||
|
||||
## 1.6.0 — *Add interpreter…* — **2026-11-21**
|
||||
|
||||
One slice: PRD P0-1's manual browse, the last command `NOT_YET` held, shipped as **Add
|
||||
interpreter…** on Environments and `pipdock env add` / `env remove` in the CLI, over one new table.
|
||||
With it the project moved to maintenance mode (the next section), and the org move above ships in
|
||||
the same version. [#120](https://github.com/poli0981org/pipdock/pull/120).
|
||||
|
||||
**What shipped** (the changelog has it by reader):
|
||||
|
||||
| Piece | What |
|
||||
|---|---|
|
||||
| Core | `envs::validate_interpreter`, the one check a person's path passes: an existing file named like Python (`python3.14t.exe` included), leading to one, and not inside PipDock's own venvs — run and stored as given, made absolute. `envs::probe_listed` checks an added entry again before every listing probes it |
|
||||
| Store | Schema v5, `manual_envs(env_hash, interpreter, added_at)` — apart from the CLI's `envs` recents, which has no source column. Adding again keeps an entry's place |
|
||||
| Discovery | Added entries come after discovery's own and never shadow it. One whose file is gone is still listed, with `PD-ENV-001`, because that is the row a person needs in order to remove it |
|
||||
| IPC | `env_add_manual`, `env_remove_manual`; `NOT_YET` is empty |
|
||||
| GUI | *Add interpreter…* beside *Rescan*, as the empty state's one action and in `Ctrl+K`; *Remove from list* on added rows; a status line mounted before its words; focus to the heading when the focused row goes |
|
||||
| CLI | `env add`, `env remove`; `env list` shows what was added; `--env`, `env use` and the stored default are validated |
|
||||
| Maintenance | `triage.yml` over a tested `.github/scripts/triage.cjs`, the wording issue form, CONTRIBUTING's scope |
|
||||
|
||||
**What running found:**
|
||||
|
||||
- The first name rule refused the free-threaded `python3.14t.exe`, which the python.org installer
|
||||
puts beside `python.exe` and the registry lists — found by running `env list` against the owner's
|
||||
own Pythons, not by any test.
|
||||
- `env remove <dir>` answered "not on the list" for a deleted venv — the one case it exists for —
|
||||
because `interpreter_in` resolves only what is there. Found by its own test.
|
||||
- Qodana for JS flagged a non-ASCII identifier in `triage.cjs`; renamed.
|
||||
- Qodana for Rust failed one run in five on #120 — the last on a commit that changed only this
|
||||
file — with "Unused crate: sha2", the crate `env_hash` is built on. Every run's sanity check finds
|
||||
the Cargo project only partly loaded in its container, and the unused-crate inspection sometimes
|
||||
draws its conclusion from that. A baseline entry would not have held, since its fingerprint
|
||||
hashes neighbouring lines Dependabot rewrites, so the inspection is excluded in
|
||||
`qodana-rust.yaml`, with the reason.
|
||||
- The installed build — the release dry run's NSIS installer, a scratch `LOCALAPPDATA`, driven over
|
||||
CDP: the legal gate once on a fresh profile; an interpreter added, rescanned, updated and rolled
|
||||
back in a scratch venv named `myproj-env` outside the working directory; the entry kept across a
|
||||
restart; the venv deleted and its `PD-ENV-001` row removed from the keyboard, focus to the
|
||||
heading; `env list` and `env remove` agreeing with the screen. **Windows' own file picker was not
|
||||
driven**: screen control was declined, and a release build's `__TAURI_INTERNALS__` cannot be
|
||||
patched to stub it, so every add went through `envAddManual` with a path — the call the picker's
|
||||
result makes.
|
||||
- The review's fixes (below) were smoke-tested the same way on a second dry-run installer, against
|
||||
a real `--symlinks` venv made from the registry's Python 3.14: added as itself, with its own
|
||||
prefix and its own identity, listed beside its base, its own one package against the base's 64,
|
||||
removed and not brought back by a scan; a deleted venv's broken row removed for good; and the
|
||||
installed CLI's `env add`, `env list` and `env remove` agreeing.
|
||||
|
||||
**What an independent review found** once the suites and that smoke were green, reading the diff
|
||||
cold and reproducing with a scratch `LOCALAPPDATA` and the debug CLI. Every fix has a test that was
|
||||
seen to fail first:
|
||||
|
||||
| # | Severity | Found | Now |
|
||||
|---|---|---|---|
|
||||
| 1 | High | `validate_interpreter` returned the canonical path, and every caller ran and stored it. A `--symlinks` venv's `python.exe` is a link to its base, so `env use <venv>` stored `C:\Python315\python.exe` (reproduced) and `--env .venv update --all --yes` would have changed the system Python; the GUI merged the added venv into the registry row by `envHash` and selected that. The name check looked at the link while the target was stored, so a `python.exe` linking to `notepad.exe` stored `notepad.exe` | The path made absolute is run and stored, links left alone; canonicalizing only decides where a link leads and whether it is PipDock's own. The UI merges and removes by path. **Fixing it exposed the identity beneath**: `env_hash` followed the same link, so the venv, listed now beside its base, would have shared the base's pins, snapshots and cached graph, report and audit — a rollback of one offered the other's snapshots. `canonical_interpreter` resolves a venv's own interpreter (recognised by `pyvenv.cfg`) only up to its folder; no other path's identity changed, and a linked venv's earlier pins stay with the base they were filed under. Seen on this machine's real `--symlinks` venv |
|
||||
| 2 | Medium | A Microsoft Store Python was refused: an app-execution alias reports `is_file()` and fails `canonicalize()` with os error 1920, so `--env` and `env use`, which worked in 1.5.0, would have exited 3 | Judged by its own path when it cannot be resolved, as `canonical_interpreter` always fell back |
|
||||
| 3 | Medium | Not an enforcement point over IPC, while SECURITY §2 and `env_probe`'s doc said it was: `env_probe` checks only a path the webview calls `manual`, and every `PyEnv` command runs `env.interpreter` unchecked. Stored entries, and the CLI's default from 1.5.0, were probed unchecked too | Both sentences corrected. Added entries are checked again on every listing (`probe_listed`, both heads), the stored default when it is used. The IPC exposure predates 1.6.0: backlog X36-b |
|
||||
| 4 | Low–Medium | *Remove from list* announced success while the entry stayed, for an entry on a share whose file was gone: the row's `envHash` was recomputed from the stored text, while the identity it was added under had been hashed from `UNC\server\share\…` | Removed by the path the row shows; the store matches either |
|
||||
| 5 | Low–Medium | Re-adding a venv deleted and made again kept the broken row and selected it — a row with no `env`, which nothing loads packages for | The fresh row replaces it and is selected |
|
||||
| 6 | Low | Removing during a scan: the scan had read the list first, so its result brought the row back while the status line said it was gone | Each waits for the other; *Remove from list* is busy while a scan runs |
|
||||
| 7 | Low | `env remove .venv` never matched what `env add .venv` stored | The typed path is made absolute first |
|
||||
| — | — | `env add --json` was documented as printing the entry "exactly as" `env list` would, untrue when discovery also finds it; a Triage failure on a pull request reached no channel | Wording; `notify.yml` reports Triage's `pull_request_target` runs |
|
||||
|
||||
Reviewed and found sound: `triage.yml`'s handling of a stranger's pull request (the base branch's
|
||||
scripts only, no expression reaching a shell, writes that start no runs), who it can close, the
|
||||
v4→v5 migration, the store guard, and the copy in both catalogues.
|
||||
|
||||
**Left, in the backlog with a reason each:** X36-b, the `PyEnv` commands' trust in the webview's
|
||||
path, and the identity of an interpreter on a share.
|
||||
|
||||
## Maintenance mode — from 1.6.0
|
||||
|
||||
**PipDock is maintained rather than developed from 1.6.0 on** (owner decision, 2026-11-21, with the
|
||||
move to the poli0981org organization). 1.6.0 closed the last P0 gap, *Browse…*; nothing else on
|
||||
this page will be built unless it qualifies below. CONTRIBUTING.md, "Scope in maintenance mode",
|
||||
is the public version of this section, and `.github/workflows/triage.yml` enforces its edge.
|
||||
|
||||
**What the work is now:**
|
||||
|
||||
| Kind | What qualifies |
|
||||
|---|---|
|
||||
| Dependencies | Dependabot's weekly proposals, past their cooldowns, one PR superseding the bot's (the 2026-11-04 shape) |
|
||||
| Security | A dependency advisory of High or Critical, or a serious security problem in a runtime or toolchain the program is built with (Node, Rust, WebView2) — fixed promptly, and released when it reaches the shipped binary |
|
||||
| Majors | Language, runtime and framework upgrades — Node, TypeScript, a Rust edition, Tauri — once stable. The held-back i18next 27 + react-i18next 18 pair is the next one, and wants a session of its own |
|
||||
| Defects | Bugs, UI/UX problems and accessibility barriers. **The Audit backlog above is this list**: every row that is a defect is in scope, every row that is a feature (X19, the engine caches) is not |
|
||||
| Wording | English or Vietnamese that is wrong, misleading, or not how people speak; `.github/ISSUE_TEMPLATE/wording.yml` |
|
||||
|
||||
**What is not planned, and why** — each one decided, not dropped:
|
||||
|
||||
| Item | Why not |
|
||||
|---|---|
|
||||
| P1-7, the scheduled check | Every prerequisite is absent (the survey above), and its persona is served by the CLI in Task Scheduler. One plugin and a permanent background process for one line of text |
|
||||
| P0-9's first-run uv detection (backlog X19) | Settings already shows both engines and their versions and switches with one click; a first-run prompt is a new surface, not a fix |
|
||||
| P1-4's engine caches (`pip cache`, `uv cache`) | A different feature wearing the same word (P1 wave, above) |
|
||||
| P2 — macOS/Linux, per-env engine, elevation broker, conda, portable mode, a Japanese locale | Each is a feature, and most a test matrix |
|
||||
| Generating THIRD-PARTY-NOTICES | The licence checks (`cargo deny`, `npm licences`) now hold the claim the inventory makes; the inventory itself stays hand-kept |
|
||||
| Retaking `screenshot/` | The owner's hands, when something visible changes enough to mislead |
|
||||
|
||||
**How the edge is held.** A feature request — titled as one, a `feat:` pull request, or labelled
|
||||
`enhancement` — is labelled `out-of-scope` and closed by `triage.yml` with a bilingual answer that
|
||||
links CONTRIBUTING. Only unmistakable signals count, because closing a real bug report would be
|
||||
worse than leaving a request open; maintainers, bots and anything labelled `policy-exception` are
|
||||
never closed. `workflow_dispatch` on it is a dry run that classifies a title without touching
|
||||
anything.
|
||||
|
||||
## Standing risks
|
||||
|
||||
| Risk | Mitigation |
|
||||
|
||||
+9
-8
@@ -12,11 +12,11 @@ PipDock's job is to run package managers against local environments. The realist
|
||||
- Package names are validated against the PEP 508 name grammar (`^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$` after normalization) and version specs against PEP 440 before entering argv; anything else is rejected client-side with PD-PKG-002.
|
||||
- **The version half has been true only since 1.4.0.** Names always went through `PkgName`; versions were plain strings, so a dock-bay entry of `2.0 ; python_version<'0'` reached argv as one token pip read as a requirement whose marker is false — a silent no-op install. `pep440` is now the one place that says what a version and a specifier set may look like, and every way text arrives passes through it: install specs from either head, imported requirements, the IPC types that carry them, and the installed versions the guard set restates.
|
||||
- **Requirements and constraints reach an engine as files** (`-r <file>`, `-c <file>`) since 1.4.0: restating the installed set one argv entry per package (SP-1) passed Windows' 32,767-character command line at about 1,300 packages. The files hold exactly the tokens argv held — rendered `PinnedSpec`s and validated `Spec`s — and, like `probe.py` and the pins handed to pip-audit, each is an `exec::TempFile`: a fresh random name created with `create_new`, so an existing file is never written through, and deleted on drop.
|
||||
- Interpreter paths come only from discovery (registry/launcher/uv) or an explicit user file-pick; they are canonicalized and existence-checked (PD-ENV-001) before use.
|
||||
- Interpreter paths come only from discovery (registry/launcher/uv/venv scan) or from a person — *Add interpreter…*, `pipdock env add`, `env use`, `--env`. **A path from a person goes through `envs::validate_interpreter` before anything runs it** (since 1.6.0; this line claimed it for two milestones while the only check was existence): it must be an existing file named `python.exe`, `python3.exe`, `python3.12.exe` or the free-threaded `python3.14t.exe`, so the probe — which executes the file — cannot be pointed at another program, and **where it leads** is checked too, so a `python.exe` that links to another program is refused; it must not be inside PipDock's own tools or audit venv, compared canonically so `..` or a link cannot walk past. It is **run and stored as given, made absolute, with its links left alone**: a venv made with `--symlinks` has a `python.exe` that links to its base interpreter, and only running the link finds the venv — the first 1.6.0 build stored the canonical path, so `--env .venv` acted on the base Python. A Microsoft Store app-execution alias, which Windows will not resolve (os error 1920), is judged by its own path. Each refusal is PD-ENV-001. The picker that suggests a path is not the check; `env_add_manual` is, an added entry is checked again on every listing (`envs::probe_listed`, in both heads), and the CLI checks the stored `env use` default when it uses it. **What this is not is an enforcement point against the webview**: `env_probe` checks only a path the webview *says* is manual, and every command taking a `PyEnv` runs `env.interpreter` as the webview hands it back from `env_scan` — the trust backlog X36 records, which predates 1.6.0. An independent review of 1.6.0 found this bullet saying otherwise, the second time it has said more than the code.
|
||||
- `probe.py` is stdlib-only, written to a temp file with a random name, executed with `-I` (isolated mode: ignores `PYTHONPATH`, user site) so a poisoned env cannot inject code into the probe — and with `-X utf8`, because `-I` implies `-E`, which also discards invariant 7's `PYTHONUTF8`/`PYTHONIOENCODING`: until 1.4.0 a venv under a folder named in Vietnamese crashed the probe.
|
||||
- **Owner decision 2026-07-27 (spike SP-6): `-I` stays, and the cost is disclosed rather than hidden.** Isolated mode also disables user site-packages, so on a *non-venv* system Python the probe sees fewer distributions than `pip list` does — measured at 352 vs 375 on the reference machine. Virtual environments, the primary target, have no user site and are unaffected. The probe therefore reports `hidden_user_site`: the user-site path when it exists, is off `sys.path`, and is non-empty; `null` otherwise. Only when it is non-null does the Installed screen show a note naming the path (`env.partialListing`), so the disclosure is accurate rather than a permanent disclaimer. Dropping to `-E` was rejected: a package in user site is part of the untrusted surface the isolation exists to exclude.
|
||||
- Child processes run with inherited user privileges only; PipDock never elevates in v1 (PD-PRM-001 blocks instead — elevation broker is P2 with its own review).
|
||||
- The Code Health **project folder** is a user file-pick that becomes the working directory of three subprocesses and, with `--fix`, the target of a write. It is canonicalized and existence-checked like an interpreter path, and a folder resolving inside `%LOCALAPPDATA%\PipDock\data\tools` is refused — rewriting the tools venv would break Health itself.
|
||||
- The Code Health **project folder** is a user file-pick that becomes the working directory of three subprocesses and, with `--fix`, the target of a write. It is canonicalized and existence-checked, and a folder resolving inside `%LOCALAPPDATA%\PipDock\data\tools` is refused — rewriting the tools venv would break Health itself.
|
||||
- `git` is the one PATH-resolved program PipDock runs with a **user-controlled** working directory (the dirty-tree check). Windows' legacy `CreateProcess` search order would make a `git.exe` planted in a cloned repository win; **verified by planting one** — Rust's `Command` does its own resolution and does not search the current directory. Re-check if the process layer changes. A repository can also name a program for `git status` to run — `core.fsmonitor` in its own `.git/config`, which a project folder downloaded rather than cloned brings with it — so asking "is it safe to write here" would have run it. The check has been `git -c core.fsmonitor=false --no-optional-locks status …` since 1.4.0; a command-line `-c` wins over every config file.
|
||||
|
||||
## 3. PEP 668 policy (protecting the system Python)
|
||||
@@ -57,7 +57,7 @@ That is a deliberate removal, not an omission. A self-updater is a permanent rem
|
||||
|
||||
What replaces it: SHA-256 checksums published per release (`SHA256SUMS.txt`) for manual verification, which the README tells users to check because SmartScreen warns on first run — the binaries are not EV-code-signed. Installer artifacts are NSIS + MSI from the Tauri bundler. Since 1.4.0 the checksum file has LF line endings, written byte for byte: the CRLF one `Set-Content` produced made `sha256sum -c` on any other platform read the CR as part of each file name and report every file missing.
|
||||
|
||||
**From 1.4.0, the installers carry a build-provenance attestation.** The release workflow attests the `.exe` and the `.msi` (`actions/attest-build-provenance`), and `gh attestation verify <file> --repo poli0981/pipdock` proves an installer was built by this repository's release workflow at the tagged commit — which a checksum published beside the file cannot, since whoever could replace one could replace both. The attestation is signed through Sigstore with a short-lived certificate bound to the workflow run, so it adds no key to keep.
|
||||
**From 1.4.0, the installers carry a build-provenance attestation.** The release workflow attests the `.exe` and the `.msi` (`actions/attest-build-provenance`), and `gh attestation verify <file> --repo poli0981org/pipdock` proves an installer was built by this repository's release workflow at the tagged commit (for 1.4.0 and 1.5.0, built before the repository moved to the poli0981org organization on 2026-11-21, the attestations stayed with the account that made them: `--owner poli0981 --signer-repo poli0981/pipdock`) — which a checksum published beside the file cannot, since whoever could replace one could replace both. The attestation is signed through Sigstore with a short-lived certificate bound to the workflow run, so it adds no key to keep.
|
||||
|
||||
**The token that can write a release never runs the build.** Building executes third-party code — every crate's build script, every npm package's install script — so the build job holds a read-only token and keeps no credentials in its checkout; a separate job downloads what it produced, attests it and drafts the release, and is the only one granted `contents`, `id-token` and `attestations` write (RELEASE-CI §3).
|
||||
|
||||
@@ -76,15 +76,16 @@ pip-audit runs **from a venv of its own** in freeze-file mode: `Engine::freeze`
|
||||
## 7. Supply chain of PipDock itself
|
||||
|
||||
- CI: `cargo audit` (RustSec) + `npm audit --audit-level=high` gate every PR, and since 1.4.0 run again **every day against `main`** (`security-scan.yml`). A PR gate fires only when something changes, so an advisory published against a dependency already merged waited for the next PR to trip over it — which is how `main` went red on 2026-09-23 with no PR open to say so — and, because the failure notifier matched no workflow at all, with nobody told. Dependabot keeps the Rust, npm, Actions and Code Health pins and the Rust toolchain current (see RELEASE-CI.md §2).
|
||||
- The `cargo audit` gate is on **vulnerabilities** and is never relaxed. `.cargo/audit.toml` ignores a fixed list of *informational* advisories — unmaintained/unsound — on transitive crates PipDock cannot influence, chiefly Tauri's archived GTK3 bindings and, since 2026-10-20, zbus 5's `zvariant`/`zbus_names`/`zvariant_derive` (folded into zbus 6, which no Tauri plugin requires yet) — both stacks a Windows-only build never compiles. They are listed individually with justification so a **new** advisory still fails CI. Adding macOS/Linux builds (P2-1) is the point at which that block must be re-examined rather than extended.
|
||||
- The `cargo audit` gate is on **vulnerabilities** and is never relaxed. `.cargo/audit.toml` ignores a fixed list of *informational* advisories — unmaintained/unsound — on transitive crates PipDock cannot influence, chiefly Tauri's archived GTK3 bindings and, since 2026-10-20, zbus 5's `zvariant`/`zbus_names`/`zvariant_derive` (folded into zbus 6, which no Tauri plugin requires yet) — both stacks a Windows-only build never compiles — and, since 2026-11-21, chrono, which `Cargo.lock` lists only because serde_with's weak `chrono_0_4?` features make Cargo record it, and which no target compiles at all. They are listed individually with justification so a **new** advisory still fails CI. Adding macOS/Linux builds (P2-1) is the point at which that block must be re-examined rather than extended.
|
||||
- **That "still fails CI" has been true only since 1.4.0.** Informational advisories — unmaintained, unsound, yanked — are cargo-audit *warnings*, and `rustsec/audit-check@v2`, which ran the gate until then, let warnings through; on a pull request it failed only on *critical*, which is how September's advisories passed every PR. The gate is now a prebuilt `cargo-audit` (installed by `taiki-e/install-action`, pinned by commit) run with `--deny warnings`.
|
||||
- `npm audit` installs with `npm ci --ignore-scripts`: it reads the lockfile and builds nothing, so no package's install script has a reason to run.
|
||||
- **`cargo deny`** checks licences, sources and bans on every PR (`deny.toml`, since 1.4.0). Its licence allowlist — each entry GPL-3.0-compatible — turns THIRD-PARTY-NOTICES' "all bundled licenses are GPL-3.0-compatible" from a sentence into a test for every crate the Windows target resolves, transitive ones included; widening the list is a licensing decision, not a CI fix. Only crates.io may supply a crate — no git dependency, no other registry — and wildcard version requirements are refused. Advisories stay `cargo audit`'s, so there is one ignore list rather than two to keep in step. The npm half of the build has no equivalent licence check.
|
||||
- **`cargo deny`** checks licences, sources and bans on every PR (`deny.toml`, since 1.4.0). Its licence allowlist — each entry GPL-3.0-compatible — turns THIRD-PARTY-NOTICES' "all bundled licenses are GPL-3.0-compatible" from a sentence into a test for every crate the Windows target resolves, transitive ones included; widening the list is a licensing decision, not a CI fix. Only crates.io may supply a crate — no git dependency, no other registry — and wildcard version requirements are refused. Advisories stay `cargo audit`'s, so there is one ignore list rather than two to keep in step. **The npm half has the same check since 2026-11-21**: `scripts/check-licenses.mjs` (`npm licences` in `ci-node.yml`) evaluates the SPDX expression of every package `package-lock.json` does not mark `dev` against the same allowlist, entry for entry, and fails on a package that declares none. Both are required checks (RELEASE-CI §2). Qodana's licence audit would have been a third, but it needs a plan the project does not have, and a check this small should not depend on one.
|
||||
- `Cargo.lock` and `package-lock.json` committed; builds are `--locked`.
|
||||
- **The environments PipDock builds for itself install a pinned tree.** Since 1.4.0 `tools/tools-constraints.txt` pins every package beneath the four tools, for the Code Health and the Security-tab venvs alike, so a broken or compromised release of `requests`, `rich` or `msgpack` no longer reaches every user on their next sync (CODE-HEALTH-SPEC §2). The pins are versions, not hashes; `--require-hashes` is in ROADMAP's Audit backlog.
|
||||
- **Workflows** pin third-party actions by commit — `taiki-e/install-action`, `softprops/action-gh-release`, `SonarSource/sonarqube-scan-action`, and `actions/attest-build-provenance` too — while GitHub's own `actions/*` use major tags and the ops repo's reusables `@main`. A write permission sits on the job that needs it, not on the workflow (RELEASE-CI §1). A secret sits on the *step* that needs it: `sonar.yml` builds and tests — every crate's build script, every npm package's — before it scans, so `SONAR_TOKEN` is in the scanner step's environment alone, and the version spliced into the scanner's argv is checked against a version's shape first.
|
||||
- **Workflows** pin every action by commit, with the version in a comment for Dependabot — GitHub's own `actions/*` and `github/codeql-action` included since 2026-11-21, when the last tags went. **No workflow calls another repository's.** Until the move to the poli0981org organization four were callers into the owner's personal ops repo at `@main`, and its notifier checked out that repository's `main` and ran its script with PipDock's Discord webhooks in the environment; those workflows are local now and the script is vendored (RELEASE-CI §1). A write permission sits on the job that needs it, not on the workflow (RELEASE-CI §1). A secret sits on the *step* that needs it: `sonar.yml` builds and tests — every crate's build script, every npm package's — before it scans, so `SONAR_TOKEN` is in the scanner step's environment alone, and the version spliced into the scanner's argv is checked against a version's shape first.
|
||||
- **SonarQube Cloud** analyses every PR and `main` from CI (`sonar.yml`, since 2026-10-25) rather than by automatic analysis, which never saw the Rust code and could import no coverage. Its quality gate is not a required check (RELEASE-CI §2); a red gate on `main` fails the workflow and reaches Discord.
|
||||
- CodeQL enabled via the ops-repo caller with the established permissions block, over **`javascript-typescript`, `rust` and `actions`**. This bullet said `javascript-typescript` only, because "CodeQL has no Rust analyzer" — which stopped being true in 2025, and the reusable hands any language straight to `codeql-action`. `actions` analyses the workflows themselves: write permissions at workflow level and unpinned third-party actions, the class of mistake SonarCloud had been finding by hand. Only the JavaScript/TypeScript analysis is a required check, so Rust's blocking static analysis is still clippy `-D warnings` plus `cargo audit` in `ci-rust.yml`.
|
||||
- CodeQL runs from `codeql.yml` (a caller into the ops repo until 2026-11-21) over **`javascript-typescript`, `rust` and `actions`**. This bullet said `javascript-typescript` only, because "CodeQL has no Rust analyzer" — which stopped being true in 2025, and the ops repo's reusable handed any language straight to `codeql-action`. `actions` analyses the workflows themselves: write permissions at workflow level and unpinned third-party actions, the class of mistake SonarCloud had been finding by hand. Only the JavaScript/TypeScript analysis is a required check, so Rust's blocking static analysis is still clippy `-D warnings` plus `cargo audit` in `ci-rust.yml`.
|
||||
- **Qodana** (`qodana.yml`, since 2026-11-21) runs JetBrains' inspections as two Qodana Cloud projects, one per half of the repository, each with its own token: RustRover's in a Linux container (`qodana-rust.yaml` — it cannot see `#[cfg(windows)]` code, which clippy, CodeQL and SonarQube Cloud cover on Windows) and WebStorm's natively (`qodana-js.yaml`). A run fails on a problem outside its committed baseline, and only those reach Code scanning. It is not a required check: one of its linters is an early-access build behind an external service, and Dependabot's PRs get no token.
|
||||
- Third-party licenses tracked in `legal/THIRD-PARTY-NOTICES.md`, which names the **direct** dependencies the manifests declare and is reconciled against them by hand at each release. It is not generated: an earlier revision of both documents claimed `cargo about`/`license-checker` produced it into a `licenses/` directory, and no such config, directory or release step has ever existed. The complete resolved graph is `Cargo.lock` and `package-lock.json`, both committed. Generating the inventory is tracked as a Post-1.0 item; until it lands, the claim here matches what is done — and `cargo deny` checks the Rust licences without writing the inventory.
|
||||
|
||||
## 8. Data & privacy engineering
|
||||
@@ -99,6 +100,6 @@ Logs contain package names and paths. There was no log until 1.4.0, while the Pr
|
||||
|
||||
## 9. Vulnerability reporting
|
||||
|
||||
Report privately through **GitHub Security Advisories** on `poli0981/pipdock`, or by email to `code@poli0981.dev`; target acknowledgment ≤ 7 days. Coordinated disclosure preferred; in-range CVEs in shipped dependencies trigger a patch release via the standard pipeline.
|
||||
Report privately through **GitHub Security Advisories** on `poli0981org/pipdock`, or by email to `code@poli0981.dev`; target acknowledgment ≤ 7 days. Coordinated disclosure preferred; in-range CVEs in shipped dependencies trigger a patch release via the standard pipeline.
|
||||
|
||||
`.github/SECURITY.md` is the short pointer GitHub's *Security policy* tab renders, and it points here. This file is the policy; that one exists so the tab is not empty.
|
||||
+1
-1
@@ -64,7 +64,7 @@ IPC is mocked at the typed wrapper layer (`ui/src/test/ipc.ts`, a factory each t
|
||||
|
||||
### L4 — CLI (assert_cmd + insta)
|
||||
|
||||
Goldens over the real binary. There is no mocked core — this line promised one, and the CLI has no seam to mock at (`golden.rs` says why) — so what is goldened is everything deterministic without an interpreter: every command's and subcommand's help, which is the flag contract scripts read; the JSON and human error envelope; and `pipdock schema <T>` for every type in `SCHEMA_TYPES`, plus the unknown-type list — **68 snapshots at 1.4.0**. The exit-code table is asserted for the rows reachable without an interpreter (0, 2 and 3); L2 asserts the ones it can reach. A golden diff is a behaviour change: re-bless deliberately, never reflexively.
|
||||
Goldens over the real binary. There is no mocked core — this line promised one, and the CLI has no seam to mock at (`golden.rs` says why) — so what is goldened is everything deterministic without an interpreter: every command's and subcommand's help, which is the flag contract scripts read; the JSON and human error envelope; and `pipdock schema <T>` for every type in `SCHEMA_TYPES`, plus the unknown-type list — **70 snapshots at 1.6.0** (68 at 1.4.0; `env add` and `env remove` brought two). The exit-code table is asserted for the rows reachable without an interpreter (0, 2 and 3); L2 asserts the ones it can reach. A golden diff is a behaviour change: re-bless deliberately, never reflexively.
|
||||
|
||||
**Not covered by a committed test**, though this line claimed both: TTY versus non-TTY prompting, and `--json` payloads checked against `pipdock schema`'s output. CLI-SPEC §6's one-document `--json` rule was verified for 1.4.0 by driving the real binary through every path (ROADMAP), not by a test that stays.
|
||||
|
||||
|
||||
+11
-4
@@ -88,14 +88,21 @@ record of what PipDock ran, which outlives the window. The **console drawer** sl
|
||||
|
||||
## 4. Screens
|
||||
|
||||
**Environments.** Auto-discovered list (source chip: registry / py launcher / uv / venv / manual) with Python version, package count and pip version; PEP 668 envs carry a red `MANAGED` chip and a line pointing at a virtual environment instead. Actions: *Use*, *Open* (the detail view below), *Rescan*, and *Upgrade pip* when pip is below the planner's floor (§5).
|
||||
**Environments.** Auto-discovered list (source chip: registry / py launcher / uv / venv / manual) with Python version, package count and pip version; PEP 668 envs carry a red `MANAGED` chip and a line pointing at a virtual environment instead. Actions: *Use*, *Open* (the detail view below), *Rescan*, *Add interpreter…*, *Remove from list* on a row it added, and *Upgrade pip* when pip is below the planner's floor (§5).
|
||||
|
||||
**This line used to promise three things the screen does not have.** A managed environment is not
|
||||
*disabled*: it can be selected and read, and a change to it is refused with PD-ENV-002 by the flow —
|
||||
decided on a fresh probe since 1.4.0, not on whatever the row last cached — unless the Settings
|
||||
override is on. *Browse…* is still owed: `env_add_manual` is the one command left in `NOT_YET`, so an
|
||||
environment is found only by discovery — the registry, the `py` launcher, `uv python list`, and a
|
||||
`.venv`, `venv`, `env` or `.env` in the working directory. And there is no star-as-default: the
|
||||
override is on. *Browse…* shipped in 1.6.0 as **Add interpreter…**, beside *Rescan* and as the empty state's one
|
||||
action (§7): a native picker filtered to `.exe`, then `env_add_manual`, which refuses anything not
|
||||
named like a Python interpreter or inside PipDock's own venvs before it runs it, and selects the row
|
||||
it adds. An added row carries the `manual` chip and **Remove from list** — kept even when its file
|
||||
is gone, so the `PD-ENV-001` row can be removed — and the outcome is said in a `role="status"`
|
||||
line mounted before its words. Both are busy while a scan runs, and a scan waits for either: a scan
|
||||
that read the list before the change would undo it. An added row is matched to the list by its
|
||||
path, never by `envHash`, which two names for one Python share — and a venv made with `--symlinks`
|
||||
is listed beside the base Python it links to, with an identity of its own (ARCHITECTURE §6). Discovery is unchanged: the registry, the `py` launcher,
|
||||
`uv python list`, and a `.venv`, `venv`, `env` or `.env` in the working directory. And there is no star-as-default: the
|
||||
selection lasts for the session, and a rescan keeps it or falls back to the first usable row. The
|
||||
CLI's `env use` stores a default, honoured since 1.4.0; the GUI does not read it.
|
||||
|
||||
|
||||
+12
-1
@@ -116,9 +116,20 @@ export default tseslint.config(
|
||||
// `scripts/**` is here because `recommendedTypeChecked` above is unscoped: without this,
|
||||
// adding one `.mjs` build script makes `eslint .` fail outright rather than report a lint.
|
||||
{
|
||||
files: ['*.js', '*.ts', 'scripts/**/*.{js,mjs}'],
|
||||
files: ['*.js', '*.ts', 'scripts/**/*.{js,mjs}', '.github/scripts/**/*.{js,cjs,mjs}'],
|
||||
...tseslint.configs.disableTypeChecked,
|
||||
// Node globals: these run under node, not in the webview.
|
||||
languageOptions: { globals: { console: 'readonly', process: 'readonly' } },
|
||||
},
|
||||
|
||||
// The triage helper beside the workflows is CommonJS: actions/github-script loads it with
|
||||
// `require`, and its test does the same so it tests what the workflow runs.
|
||||
{
|
||||
files: ['.github/scripts/**/*.cjs'],
|
||||
languageOptions: {
|
||||
sourceType: 'commonjs',
|
||||
globals: { require: 'readonly', module: 'writable' },
|
||||
},
|
||||
rules: { '@typescript-eslint/no-require-imports': 'off' },
|
||||
},
|
||||
)
|
||||
@@ -1,6 +1,6 @@
|
||||
# PipDock — Privacy Policy
|
||||
|
||||
*Version 1.2 · Effective 2026-10-17 · Governing language: English.*
|
||||
*Version 1.3 · Effective 2026-11-21 · Governing language: English.*
|
||||
|
||||
## 1. The short version
|
||||
|
||||
@@ -13,7 +13,7 @@ All application data lives under `%LOCALAPPDATA%\PipDock\data\` and never leaves
|
||||
| Data | Purpose |
|
||||
|---|---|
|
||||
| Settings (engine, locale, thresholds, consent record) | app configuration |
|
||||
| Environment list, package index cache, and the Python versions each release supports | discovery, instant search, and refusing a version your Python cannot run |
|
||||
| Environment list — including the paths of interpreters you add with *Add interpreter…* or `pipdock env add`, kept until you remove them — package index cache, and the Python versions each release supports | discovery, instant search, and refusing a version your Python cannot run |
|
||||
| Snapshots (package lists of your environments) | rollback |
|
||||
| Pins | update exclusions |
|
||||
| PipDock's own tool environments (`tools\`, `audit\`) | running deptry, vulture and ruff for Code Health, and pip-audit for the Security tab; reinstalled on demand, clearable in Settings |
|
||||
@@ -45,10 +45,10 @@ Material changes to this policy bump the legal documents' version hash, and the
|
||||
|
||||
## 7. Contact
|
||||
|
||||
Privacy questions: email <contact@poli0981.dev>, or open a discussion or issue at <https://github.com/poli0981/pipdock>. The same contact details are listed in the application under **About**.
|
||||
Privacy questions: email <contact@poli0981.dev>, or open a discussion or issue at <https://github.com/poli0981org/pipdock>. The same contact details are listed in the application under **About**.
|
||||
|
||||
---
|
||||
|
||||
## Tóm tắt Tiếng Việt (tham khảo)
|
||||
|
||||
PipDock **không thu thập bất kỳ dữ liệu nào**: không telemetry, không analytics, không tài khoản. Mọi dữ liệu (cài đặt, cache chỉ mục, snapshot, môi trường công cụ riêng của PipDock, log ghi lại các lệnh đã chạy) nằm trong `%LOCALAPPDATA%\PipDock\data\` trên máy bạn; xóa thư mục `data\` là xóa sạch — **đừng xóa thư mục cha**, vì chính chương trình được cài ở đó và xóa nó là gỡ luôn ứng dụng. Ứng dụng **chỉ** kết nối tới pypi.org (dữ liệu gói); PipDock không tự cập nhật nên không bao giờ gọi về GitHub. Một vài nút giao URL cho trình duyệt của bạn mở (github.com, docs.astral.sh, osv.dev, poli0981.dev) — đó là trình duyệt truy cập, sau khi bạn bấm. Nút báo lỗi chỉ mở form GitHub đã điền sẵn — không gì được gửi đi cho tới khi bạn tự xem lại và bấm gửi. Liên hệ: <contact@poli0981.dev>.
|
||||
PipDock **không thu thập bất kỳ dữ liệu nào**: không telemetry, không analytics, không tài khoản. Mọi dữ liệu (cài đặt, cache chỉ mục, đường dẫn các trình thông dịch bạn tự thêm, snapshot, môi trường công cụ riêng của PipDock, log ghi lại các lệnh đã chạy) nằm trong `%LOCALAPPDATA%\PipDock\data\` trên máy bạn; xóa thư mục `data\` là xóa sạch — **đừng xóa thư mục cha**, vì chính chương trình được cài ở đó và xóa nó là gỡ luôn ứng dụng. Ứng dụng **chỉ** kết nối tới pypi.org (dữ liệu gói); PipDock không tự cập nhật nên không bao giờ gọi về GitHub. Một vài nút giao URL cho trình duyệt của bạn mở (github.com, docs.astral.sh, osv.dev, poli0981.dev) — đó là trình duyệt truy cập, sau khi bạn bấm. Nút báo lỗi chỉ mở form GitHub đã điền sẵn — không gì được gửi đi cho tới khi bạn tự xem lại và bấm gửi. Liên hệ: <contact@poli0981.dev>.
|
||||
Generated
+427
-490
File diff suppressed because it is too large.
Load diff
+15
-15
@@ -1,18 +1,18 @@
|
||||
{
|
||||
"name": "pipdock",
|
||||
"version": "1.5.0",
|
||||
"version": "1.6.0",
|
||||
"private": true,
|
||||
"description": "A friendly dock for your Python environments — bulk inspect, install, update and clean up Python packages.",
|
||||
"license": "GPL-3.0-only",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/poli0981/pipdock.git"
|
||||
"url": "git+https://github.com/poli0981org/pipdock.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/poli0981/pipdock/issues"
|
||||
"url": "https://github.com/poli0981org/pipdock/issues"
|
||||
},
|
||||
"homepage": "https://github.com/poli0981/pipdock#readme",
|
||||
"homepage": "https://github.com/poli0981org/pipdock#readme",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
@@ -28,10 +28,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-virtual": "^3.14.26",
|
||||
"@tauri-apps/api": "^2.12.4",
|
||||
"@tauri-apps/api": "^2.12.5",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.5.0",
|
||||
"@tauri-apps/plugin-dialog": "^2.8.4",
|
||||
"@tauri-apps/plugin-opener": "^2.7.2",
|
||||
"@tauri-apps/plugin-opener": "^2.7.3",
|
||||
"i18next": "^26.7.2",
|
||||
"react": "^19.3.1",
|
||||
"react-dom": "^19.3.1",
|
||||
@@ -41,23 +41,23 @@
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@tailwindcss/vite": "^4.3.5",
|
||||
"@tauri-apps/cli": "^2.12.4",
|
||||
"@tauri-apps/cli": "^2.12.5",
|
||||
"@testing-library/jest-dom": "^7.0.1",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@types/node": "^26.6.6",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"@vitejs/plugin-react": "^6.2.1",
|
||||
"@vitest/coverage-v8": "^5.1.0",
|
||||
"axe-core": "^4.14.0",
|
||||
"eslint": "^10.14.0",
|
||||
"@vitejs/plugin-react": "^6.3.0",
|
||||
"@vitest/coverage-v8": "^5.1.1",
|
||||
"axe-core": "^4.14.1",
|
||||
"eslint": "^10.15.0",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.7",
|
||||
"jsdom": "^30.1.3",
|
||||
"eslint-plugin-react-refresh": "^0.5.8",
|
||||
"jsdom": "^31.0.1",
|
||||
"tailwindcss": "^4.3.4",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.72.1",
|
||||
"vite": "^8.3.6",
|
||||
"typescript-eslint": "^8.73.0",
|
||||
"vite": "^8.3.8",
|
||||
"vitest": "^5.1.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# Qodana for the TypeScript/JavaScript half of the repository.
|
||||
#
|
||||
# The second of two Qodana Cloud projects (qodana-rust.yaml says why there are two), with its own
|
||||
# token, QODANA_TOKEN_TS_JS. .github/workflows/qodana.yml passes `--linter qodana-js` and runs it
|
||||
# natively on the runner, after `npm ci` with the Node version every other workflow uses, so the
|
||||
# TypeScript service resolves the same node_modules the build does.
|
||||
|
||||
version: "1.0"
|
||||
|
||||
profile:
|
||||
name: qodana.recommended
|
||||
|
||||
# The Rust workspace is qodana-rust.yaml's. generated.ts is `cargo run -p xtask -- bindings`
|
||||
# output; fixing a finding in it by hand would be undone by the next regeneration.
|
||||
exclude:
|
||||
- name: All
|
||||
paths:
|
||||
- changelog
|
||||
- coverage
|
||||
- crates
|
||||
- dist
|
||||
- docs
|
||||
- legal
|
||||
- node_modules
|
||||
- screenshot
|
||||
- spikes
|
||||
- src-tauri
|
||||
- target
|
||||
- tools
|
||||
- ui/src/ipc/generated.ts
|
||||
- xtask
|
||||
@@ -0,0 +1,64 @@
|
||||
# Qodana for the Rust half of the repository.
|
||||
#
|
||||
# One of two Qodana Cloud projects, each with its own token — QODANA_TOKEN_RUST for this file,
|
||||
# QODANA_TOKEN_TS_JS for qodana-js.yaml — which is JetBrains' layout for a monorepo: every part is
|
||||
# a project of its own, analysed by its own linter, and the two runs never report the same file.
|
||||
# .github/workflows/qodana.yml runs both, and passes `--linter qodana-rust` there rather than here,
|
||||
# so the linter's version is the action's and moves when Dependabot moves the action.
|
||||
#
|
||||
# **What this run cannot see.** The linter is RustRover in a Linux container (it has no native
|
||||
# mode), so code behind `#[cfg(windows)]` — the PEP 514 registry, Job Objects, the `py` launcher —
|
||||
# is inactive to it and is not analysed. Clippy, CodeQL and SonarQube Cloud run on Windows and
|
||||
# cover it; this run adds RustRover's inspections over the code every platform compiles.
|
||||
|
||||
version: "1.0"
|
||||
|
||||
profile:
|
||||
name: qodana.recommended
|
||||
|
||||
# **The container runs as the runner's user, not root**, so nothing can be installed into it — and
|
||||
# that includes the toolchain rust-toolchain.toml pins: rustup writes under /usr/local/rustup,
|
||||
# which root owns, so `cargo metadata` failed with "Permission denied", RustRover loaded no Cargo
|
||||
# project, and the first run reported **0 problems after analysing nothing** (2026-11-21). The job's
|
||||
# own checkout is writable, so the bootstrap points *that copy* at the toolchain the image ships;
|
||||
# the repository's pin is untouched. (GTK and WebKitGTK cannot be installed either, so Tauri's
|
||||
# Linux build scripts do not resolve; that touches macro expansion in src-tauri, not the analysis
|
||||
# of the code around it.)
|
||||
bootstrap: |
|
||||
set -eu
|
||||
shipped=$(rustup toolchain list | grep -m1 'default' | cut -d' ' -f1 || true)
|
||||
if [ -z "$shipped" ]; then shipped=$(rustup toolchain list | head -n1 | cut -d' ' -f1); fi
|
||||
printf '[toolchain]\nchannel = "%s"\n' "$shipped" > rust-toolchain.toml
|
||||
echo "bootstrap: analysing with the image's $shipped instead of the pinned toolchain"
|
||||
cargo metadata --format-version 1 --no-deps > /dev/null && echo "bootstrap: cargo metadata works"
|
||||
|
||||
# Everything that is not Rust belongs to qodana-js.yaml or to no linter at all. Fixtures are
|
||||
# captured engine output and deliberately broken sample projects; snapshots are the CLI's goldens.
|
||||
exclude:
|
||||
- name: All
|
||||
paths:
|
||||
- .github
|
||||
- changelog
|
||||
- coverage
|
||||
- crates/pipdock-cli/tests/snapshots
|
||||
- crates/pipdock-core/tests/fixtures
|
||||
- dist
|
||||
- docs
|
||||
- legal
|
||||
- node_modules
|
||||
- screenshot
|
||||
- spikes
|
||||
- src-tauri/gen
|
||||
- src-tauri/icons
|
||||
- target
|
||||
- tools
|
||||
- ui
|
||||
# **Unused-crate reports are a coin toss in this container.** Every run's sanity check finds the
|
||||
# Cargo project only partly loaded (the Tauri build scripts above) and paths in `model.rs` and
|
||||
# others unresolved; on one run in five on #120 that became "Unused crate: sha2", a crate
|
||||
# `model::sha256_hex` — and so every `env_hash` — is built on, on a commit that changed a Markdown
|
||||
# file. A baseline entry would not hold: its fingerprint hashes the neighbouring lines, which
|
||||
# Dependabot rewrites weekly. Nothing else here checks for unused crates, so this one goes rather
|
||||
# than leave a check that fails at random; `cargo machete` is the backlog row that would replace
|
||||
# it.
|
||||
- name: CargoUnusedDependency
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
[toolchain]
|
||||
channel = "1.99.1"
|
||||
channel = "1.100.0"
|
||||
components = ["rustfmt", "clippy"]
|
||||
targets = ["x86_64-pc-windows-msvc"]
|
||||
profile = "minimal"
|
||||
@@ -0,0 +1,156 @@
|
||||
/**
|
||||
* Fail when a package the production build can bundle is not under a GPL-3.0-compatible licence.
|
||||
*
|
||||
* The npm half of what `deny.toml` does for the crates. THIRD-PARTY-NOTICES says every bundled
|
||||
* licence is compatible with PipDock's GPL-3.0-only; `cargo deny` made that a test for the Rust
|
||||
* side in 1.4.0, and until this script SECURITY §7 had to admit that "the npm half of the build
|
||||
* has no equivalent licence check". Qodana's licence audit would have been one, but it needs the
|
||||
* Ultimate Plus plan, and a check this small should not depend on a plan.
|
||||
*
|
||||
* It reads `package-lock.json` (lockfile v3) and installs nothing. "Production" is every package
|
||||
* not marked `dev`: `devOptional` and `optional` ones stay in, because something the app depends
|
||||
* on can pull them in. The allowlist mirrors `deny.toml`'s, entry for entry; widening either is a
|
||||
* licensing decision, not a CI fix, and the two lists are meant to move together.
|
||||
*/
|
||||
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
|
||||
/** SPDX identifiers accepted on their own — exactly `deny.toml`'s `[licenses] allow`. */
|
||||
export const ALLOWED = new Set([
|
||||
'0BSD',
|
||||
'Apache-2.0',
|
||||
'BSD-3-Clause',
|
||||
'BSL-1.0',
|
||||
'CC0-1.0',
|
||||
'ISC',
|
||||
'MIT',
|
||||
'MIT-0',
|
||||
'MPL-2.0',
|
||||
'Unicode-3.0',
|
||||
'Unlicense',
|
||||
'Zlib',
|
||||
])
|
||||
|
||||
/**
|
||||
* Packages whose lockfile entry carries no usable SPDX expression, each with the licence a person
|
||||
* checked by hand and why. Empty: every production package declares one today.
|
||||
*/
|
||||
export const CHECKED_BY_HAND = new Map()
|
||||
|
||||
/** Split an SPDX expression into identifiers, operators and parentheses. */
|
||||
export function tokenize(expression) {
|
||||
return expression
|
||||
.replace(/\(/g, ' ( ')
|
||||
.replace(/\)/g, ' ) ')
|
||||
.split(/\s+/)
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether an SPDX expression can be satisfied with allowed licences: `OR` needs one side, `AND`
|
||||
* both, `AND` binds tighter than `OR`, and parentheses group. A `WITH` exception is accepted only
|
||||
* when the whole `id WITH exception` pair is allowed — none is today, so one fails and is looked
|
||||
* at. Anything malformed throws, and the caller reports it as a violation.
|
||||
*/
|
||||
export function satisfiable(expression, allowed = ALLOWED) {
|
||||
const tokens = tokenize(expression)
|
||||
let at = 0
|
||||
const peek = () => tokens[at]
|
||||
const take = () => tokens[at++]
|
||||
|
||||
const primary = () => {
|
||||
const token = take()
|
||||
if (token === undefined) throw new Error(`unexpected end of "${expression}"`)
|
||||
if (token === '(') {
|
||||
const value = disjunction()
|
||||
if (take() !== ')') throw new Error(`unbalanced parenthesis in "${expression}"`)
|
||||
return value
|
||||
}
|
||||
if (token === ')' || token === 'AND' || token === 'OR' || token === 'WITH') {
|
||||
throw new Error(`unexpected "${token}" in "${expression}"`)
|
||||
}
|
||||
if (peek() === 'WITH') {
|
||||
take()
|
||||
const exception = take()
|
||||
if (exception === undefined) throw new Error(`"WITH" without an exception in "${expression}"`)
|
||||
return allowed.has(`${token} WITH ${exception}`)
|
||||
}
|
||||
return allowed.has(token)
|
||||
}
|
||||
const conjunction = () => {
|
||||
let value = primary()
|
||||
while (peek() === 'AND') {
|
||||
take()
|
||||
value = primary() && value
|
||||
}
|
||||
return value
|
||||
}
|
||||
const disjunction = () => {
|
||||
let value = conjunction()
|
||||
while (peek() === 'OR') {
|
||||
take()
|
||||
value = conjunction() || value
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
const result = disjunction()
|
||||
if (at !== tokens.length) throw new Error(`trailing "${tokens[at]}" in "${expression}"`)
|
||||
return result
|
||||
}
|
||||
|
||||
/** `node_modules/a/node_modules/@scope/b` → `@scope/b`. */
|
||||
export function packageName(path) {
|
||||
return path.slice(path.lastIndexOf('node_modules/') + 'node_modules/'.length)
|
||||
}
|
||||
|
||||
/** Every non-dev package in a lockfile-v3 `packages` map, as `{ name, version, license }`. */
|
||||
export function productionPackages(lock) {
|
||||
return Object.entries(lock.packages ?? {})
|
||||
.filter(([path, entry]) => path !== '' && !entry.dev && !entry.link)
|
||||
.map(([path, entry]) => ({ name: packageName(path), version: entry.version, license: entry.license }))
|
||||
}
|
||||
|
||||
/** The packages that fail the allowlist, each with the reason. */
|
||||
export function violations(packages, allowed = ALLOWED, checkedByHand = CHECKED_BY_HAND) {
|
||||
const found = []
|
||||
for (const pkg of packages) {
|
||||
if (checkedByHand.has(pkg.name)) continue
|
||||
if (typeof pkg.license !== 'string' || pkg.license.trim() === '') {
|
||||
found.push({ ...pkg, reason: 'declares no SPDX licence expression' })
|
||||
continue
|
||||
}
|
||||
try {
|
||||
if (!satisfiable(pkg.license, allowed)) found.push({ ...pkg, reason: `${pkg.license} is not allowed` })
|
||||
} catch (error) {
|
||||
found.push({ ...pkg, reason: error.message })
|
||||
}
|
||||
}
|
||||
return found
|
||||
}
|
||||
|
||||
function main() {
|
||||
const lock = JSON.parse(readFileSync('package-lock.json', 'utf8'))
|
||||
if (lock.lockfileVersion !== 3) {
|
||||
console.error(`package-lock.json is lockfile v${lock.lockfileVersion}; this check reads v3`)
|
||||
return 1
|
||||
}
|
||||
const packages = productionPackages(lock)
|
||||
const found = violations(packages)
|
||||
for (const v of found) console.error(`${v.name}@${v.version}: ${v.reason}`)
|
||||
if (found.length > 0) {
|
||||
console.error(
|
||||
`${found.length} of ${packages.length} production packages fail the licence allowlist. ` +
|
||||
'Widening it is a licensing decision (deny.toml says why); CHECKED_BY_HAND is for a ' +
|
||||
'package whose metadata is missing or wrong, with the licence a person verified.',
|
||||
)
|
||||
return 1
|
||||
}
|
||||
console.log(`${packages.length} production packages, every one under a GPL-3.0-compatible licence.`)
|
||||
return 0
|
||||
}
|
||||
|
||||
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
||||
process.exitCode = main()
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// Run with `node --test scripts/*.test.mjs` — Node's built-in runner, so the check needs no
|
||||
// dependency of its own (ci-node.yml's `npm licences` job).
|
||||
|
||||
import assert from 'node:assert/strict'
|
||||
import { test } from 'node:test'
|
||||
|
||||
import { packageName, productionPackages, satisfiable, violations } from './check-licenses.mjs'
|
||||
|
||||
test('a single allowed identifier passes, an unknown one does not', () => {
|
||||
assert.equal(satisfiable('MIT'), true)
|
||||
assert.equal(satisfiable('CC-BY-4.0'), false)
|
||||
assert.equal(satisfiable('GPL-2.0-only'), false)
|
||||
})
|
||||
|
||||
test('OR needs one allowed side, AND needs both', () => {
|
||||
assert.equal(satisfiable('MIT OR Apache-2.0'), true)
|
||||
assert.equal(satisfiable('(GPL-2.0-only OR MIT)'), true)
|
||||
assert.equal(satisfiable('MIT AND ISC'), true)
|
||||
assert.equal(satisfiable('MIT AND CC-BY-4.0'), false)
|
||||
})
|
||||
|
||||
test('AND binds tighter than OR, and parentheses override it', () => {
|
||||
// MIT OR (CC-BY-4.0 AND ISC) — the MIT branch carries it.
|
||||
assert.equal(satisfiable('MIT OR CC-BY-4.0 AND ISC'), true)
|
||||
// (MIT OR CC-BY-4.0) AND WTFPL — WTFPL is not on the list, so nothing can satisfy it.
|
||||
assert.equal(satisfiable('(MIT OR CC-BY-4.0) AND WTFPL'), false)
|
||||
// An operand read left of OR must not be dropped when the right side is false.
|
||||
assert.equal(satisfiable('Apache-2.0 OR CC-BY-4.0'), true)
|
||||
})
|
||||
|
||||
test('an exception is accepted only as a whole pair someone allowed', () => {
|
||||
assert.equal(satisfiable('Apache-2.0 WITH LLVM-exception'), false)
|
||||
const allowed = new Set(['Apache-2.0 WITH LLVM-exception'])
|
||||
assert.equal(satisfiable('Apache-2.0 WITH LLVM-exception', allowed), true)
|
||||
})
|
||||
|
||||
test('a malformed expression throws rather than passing', () => {
|
||||
assert.throws(() => satisfiable('(MIT'), /unbalanced|end/)
|
||||
assert.throws(() => satisfiable('MIT OR'), /end/)
|
||||
assert.throws(() => satisfiable('MIT ISC'), /trailing/)
|
||||
assert.throws(() => satisfiable('AND MIT'), /unexpected/)
|
||||
})
|
||||
|
||||
test('package names come from the last node_modules segment, scopes included', () => {
|
||||
assert.equal(packageName('node_modules/react'), 'react')
|
||||
assert.equal(packageName('node_modules/@tauri-apps/api'), '@tauri-apps/api')
|
||||
assert.equal(packageName('node_modules/a/node_modules/@scope/b'), '@scope/b')
|
||||
})
|
||||
|
||||
test('production means everything not marked dev, optional and devOptional included', () => {
|
||||
const lock = {
|
||||
packages: {
|
||||
'': { name: 'pipdock', version: '1.0.0' },
|
||||
'node_modules/react': { version: '19.0.0', license: 'MIT' },
|
||||
'node_modules/vitest': { version: '5.0.0', license: 'MIT', dev: true },
|
||||
'node_modules/fsevents': { version: '2.3.3', license: 'MIT', optional: true },
|
||||
'node_modules/lightningcss': { version: '1.0.0', license: 'MPL-2.0', devOptional: true },
|
||||
'node_modules/linked': { link: true, resolved: 'ui' },
|
||||
},
|
||||
}
|
||||
assert.deepEqual(
|
||||
productionPackages(lock).map((p) => p.name),
|
||||
['react', 'fsevents', 'lightningcss'],
|
||||
)
|
||||
})
|
||||
|
||||
test('violations name the package and the reason, and a hand-checked one is skipped', () => {
|
||||
const packages = [
|
||||
{ name: 'ok', version: '1.0.0', license: 'MIT' },
|
||||
{ name: 'data', version: '1.0.0', license: 'CC-BY-4.0' },
|
||||
{ name: 'silent', version: '1.0.0', license: undefined },
|
||||
{ name: 'broken', version: '1.0.0', license: '(MIT' },
|
||||
]
|
||||
const found = violations(packages)
|
||||
assert.deepEqual(
|
||||
found.map((v) => v.name),
|
||||
['data', 'silent', 'broken'],
|
||||
)
|
||||
assert.match(found[1].reason, /no SPDX/)
|
||||
const handChecked = new Map([['silent', 'MIT — LICENSE file read by hand']])
|
||||
assert.deepEqual(
|
||||
violations(packages, undefined, handChecked).map((v) => v.name),
|
||||
['data', 'broken'],
|
||||
)
|
||||
})
|
||||
@@ -9,8 +9,11 @@
|
||||
# first analysis with a new version is still measured against the old period, and the next one
|
||||
# from the last analysis of the version before.
|
||||
|
||||
sonar.organization=poli0981
|
||||
sonar.projectKey=poli0981_pipdock
|
||||
# The project moved with the repository to the poli0981org organization on 2026-11-21. Its history
|
||||
# up to 1.5.0 stays in the old project, `poli0981_pipdock` in the `poli0981` organization; this one
|
||||
# started empty, so its first analysis of `main` is the baseline everything after it is new against.
|
||||
sonar.organization=poli0981org
|
||||
sonar.projectKey=poli0981org_pipdock
|
||||
sonar.projectName=pipdock
|
||||
sonar.sourceEncoding=UTF-8
|
||||
|
||||
@@ -25,7 +28,9 @@ sonar.test.inclusions=\
|
||||
ui/src/**/*.test.ts,\
|
||||
ui/src/**/*.test.tsx,\
|
||||
ui/src/test/**,\
|
||||
crates/*/tests/**
|
||||
crates/*/tests/**,\
|
||||
scripts/**/*.test.mjs,\
|
||||
.github/scripts/**/*.test.*
|
||||
# Images and fonts are tracked too, and the secrets sensor read every one as UTF-8 text and warned
|
||||
# about each of them; nothing in them is code.
|
||||
sonar.exclusions=\
|
||||
@@ -33,6 +38,8 @@ sonar.exclusions=\
|
||||
ui/src/**/*.test.tsx,\
|
||||
ui/src/test/**,\
|
||||
crates/*/tests/**,\
|
||||
scripts/**/*.test.mjs,\
|
||||
.github/scripts/**/*.test.*,\
|
||||
**/*.png,\
|
||||
**/*.ico,\
|
||||
**/*.icns,\
|
||||
@@ -57,10 +64,13 @@ sonar.javascript.lcov.reportPaths=coverage/lcov.info
|
||||
# * probe.py runs inside the user's interpreter - the Rust suite parses canned output, and only
|
||||
# ci-integration.yml runs it for real;
|
||||
# * generated.ts is `cargo run -p xtask -- bindings` output, and the two entry points mount what
|
||||
# the tests render directly.
|
||||
# the tests render directly;
|
||||
# * .github/ holds the workflows and the helpers they run on a runner (the Discord notifier since
|
||||
# 2026-11-21) - they talk to GitHub's and Discord's APIs, which no test here reaches.
|
||||
sonar.coverage.exclusions=\
|
||||
xtask/**,\
|
||||
scripts/**,\
|
||||
.github/**,\
|
||||
spikes/**,\
|
||||
*.config.ts,\
|
||||
*.config.js,\
|
||||
|
||||
+112
-10
@@ -116,14 +116,17 @@ pub struct EnvRow {
|
||||
pub error: Option<WireError>,
|
||||
}
|
||||
|
||||
/// One listed candidate as a row. Through [`envs::probe_listed`], so an added interpreter is checked
|
||||
/// again before it runs, exactly as `pipdock env list` checks it.
|
||||
async fn probe_row(
|
||||
path: std::path::PathBuf,
|
||||
source: EnvSource,
|
||||
candidate: envs::Candidate,
|
||||
health_project: Option<String>,
|
||||
app_data: &std::path::Path,
|
||||
) -> EnvRow {
|
||||
let env_hash = envs::env_hash(&path);
|
||||
let interpreter = path.display().to_string();
|
||||
match envs::probe(&path, source).await {
|
||||
let env_hash = envs::env_hash(&candidate.path);
|
||||
let interpreter = candidate.path.display().to_string();
|
||||
let source = candidate.source;
|
||||
match envs::probe_listed(&candidate, app_data).await {
|
||||
Ok(probed) => EnvRow {
|
||||
interpreter,
|
||||
source,
|
||||
@@ -169,8 +172,19 @@ pub async fn env_scan(
|
||||
app: tauri::AppHandle,
|
||||
state: tauri::State<'_, AppState>,
|
||||
) -> Wire<Vec<EnvRow>> {
|
||||
// The interpreters added through *Browse…*, read and the guard dropped before discovery
|
||||
// spawns anything. A failed read costs those rows this once, not the screen.
|
||||
let manual: Vec<std::path::PathBuf> = {
|
||||
let store = state.store.lock().await;
|
||||
store
|
||||
.manual_envs()
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(|m| std::path::PathBuf::from(m.interpreter))
|
||||
.collect()
|
||||
};
|
||||
let emitter = app.clone();
|
||||
let candidates = envs::scan_reporting(&move |progress: ScanProgress| {
|
||||
let candidates = envs::scan_reporting(&manual, &move |progress: ScanProgress| {
|
||||
// A UI that stopped listening is not a reason to abandon the scan.
|
||||
let _ = emitter.emit("scan-progress", &progress);
|
||||
})
|
||||
@@ -205,12 +219,10 @@ pub async fn env_scan(
|
||||
for (index, candidate) in candidates.into_iter().enumerate() {
|
||||
let folder = folders.remove(&envs::env_hash(&candidate.path));
|
||||
let gate = std::sync::Arc::clone(&gate);
|
||||
let app_data = state.app_data.clone();
|
||||
probes.spawn(async move {
|
||||
let _permit = gate.acquire_owned().await.ok();
|
||||
(
|
||||
index,
|
||||
probe_row(candidate.path, candidate.source, folder).await,
|
||||
)
|
||||
(index, probe_row(candidate, folder, &app_data).await)
|
||||
});
|
||||
}
|
||||
let mut rows = Vec::new();
|
||||
@@ -240,6 +252,13 @@ pub async fn env_scan(
|
||||
/// now a parameter: `None` is the *Browse…* path, which really is manual; a refresh passes the
|
||||
/// source the row already had.
|
||||
///
|
||||
/// A path the webview names as `manual` is checked by [`envs::validate_interpreter`] before the
|
||||
/// probe runs it, as `env_add_manual` checks one. That is a check on what the **webview says**, not
|
||||
/// an enforcement point: a webview that names another source skips it, and every command taking a
|
||||
/// `PyEnv` runs `env.interpreter` unchecked — the trust in the webview's paths that backlog X36
|
||||
/// records, which predates *Add interpreter…*. An independent review of 1.6.0 found this sentence
|
||||
/// claiming more than that, as SECURITY §2 did.
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-ENV-001` when there is no usable interpreter there, `PD-ENV-003` when the probe output
|
||||
/// cannot be read.
|
||||
@@ -252,6 +271,9 @@ pub async fn env_probe(
|
||||
let path = std::path::PathBuf::from(&interpreter);
|
||||
let env_hash = envs::env_hash(&path);
|
||||
let source = source.unwrap_or(EnvSource::Manual);
|
||||
if source == EnvSource::Manual {
|
||||
validated(&state.app_data, path.clone()).await?;
|
||||
}
|
||||
let folder = {
|
||||
let store = state.store.lock().await;
|
||||
store.health_project(&env_hash).ok().flatten()
|
||||
@@ -272,6 +294,86 @@ pub async fn env_probe(
|
||||
})
|
||||
}
|
||||
|
||||
/// Add an interpreter the person picked with *Browse…* to the list, and return its row (PRD P0-1).
|
||||
///
|
||||
/// Validated, probed, then stored — in that order, so the list never gains an entry that was
|
||||
/// refused or broken on arrival. The row carries the path made absolute with its links left alone
|
||||
/// (a `--symlinks` venv's `python.exe` is the venv; its target is the base), which is what is stored
|
||||
/// and what the next `env_scan` returns, so the screen does not change under the user's eyes.
|
||||
/// Adding one already listed — by discovery or by an earlier *Browse…* — is not an error: the row
|
||||
/// comes back, and the frontend merges it by that path, not by `envHash`: a row is what a person
|
||||
/// sees, and two names for one Python — a link to it — share a hash.
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-ENV-001` when the file is missing, is not named like a Python interpreter, or is one of
|
||||
/// PipDock's own environments; `PD-ENV-003` when the probe fails; `PD-INT-001` when the store
|
||||
/// cannot be written.
|
||||
#[tauri::command]
|
||||
pub async fn env_add_manual(
|
||||
state: tauri::State<'_, AppState>,
|
||||
interpreter: String,
|
||||
) -> Wire<EnvRow> {
|
||||
let path = validated(&state.app_data, std::path::PathBuf::from(interpreter)).await?;
|
||||
let env_hash = envs::env_hash(&path);
|
||||
let folder = {
|
||||
let store = state.store.lock().await;
|
||||
store.health_project(&env_hash).ok().flatten()
|
||||
};
|
||||
let probed = envs::probe(&path, EnvSource::Manual).await?;
|
||||
let shown = path.display().to_string();
|
||||
{
|
||||
let store = state.store.lock().await;
|
||||
store.add_manual_env(&env_hash, &shown, &jiff::Timestamp::now().to_string())?;
|
||||
}
|
||||
Ok(EnvRow {
|
||||
interpreter: shown,
|
||||
source: EnvSource::Manual,
|
||||
env_hash,
|
||||
packages: Some(probed.dists.len()),
|
||||
pip_version: pip_version_of(&probed.dists),
|
||||
health_project: folder,
|
||||
env: Some(probed.env),
|
||||
error: None,
|
||||
})
|
||||
}
|
||||
|
||||
/// Take an interpreter off the list *Add interpreter…* put it on, by the path its row shows.
|
||||
/// Nothing on disk is touched, and its pins, snapshots and Health folder stay keyed to it for the
|
||||
/// day it is added again.
|
||||
///
|
||||
/// The path rather than the row's `envHash`: for an interpreter whose file is gone — the row that
|
||||
/// most needs removing — the identity is recomputed from the stored text and can differ from the
|
||||
/// one it was added under, and removing by hash then reported success while the entry stayed.
|
||||
///
|
||||
/// # Errors
|
||||
/// `PD-INT-001` when the store cannot be written. `false` when it was not on the list.
|
||||
#[tauri::command]
|
||||
pub async fn env_remove_manual(
|
||||
state: tauri::State<'_, AppState>,
|
||||
interpreter: String,
|
||||
) -> Wire<bool> {
|
||||
let hash = envs::env_hash(std::path::Path::new(&interpreter));
|
||||
let store = state.store.lock().await;
|
||||
Ok(store.remove_manual_env(&hash, &interpreter)?)
|
||||
}
|
||||
|
||||
/// [`envs::validate_interpreter`], off the async workers: it reads the file system, which
|
||||
/// `rust:S7493` keeps out of an `async fn`.
|
||||
async fn validated(
|
||||
app_data: &std::path::Path,
|
||||
path: std::path::PathBuf,
|
||||
) -> pipdock_core::Result<std::path::PathBuf> {
|
||||
let app_data = app_data.to_path_buf();
|
||||
tokio::task::spawn_blocking(move || envs::validate_interpreter(&path, &app_data))
|
||||
.await
|
||||
.map_err(|e| {
|
||||
PdError::new(
|
||||
pipdock_core::errors::Code::IntUnexpected,
|
||||
format!("interpreter check stopped: {e}"),
|
||||
)
|
||||
})?
|
||||
}
|
||||
|
||||
/// Everything installed in one environment — the Installed table (UI-SPEC §4).
|
||||
///
|
||||
/// Goes through `envs::probe`, **not** `Engine::list_installed`. The probe carries
|
||||
|
||||
@@ -18,7 +18,7 @@ pub mod window;
|
||||
/// runtime, and typechecked the whole time. This list is what makes the gap explicit instead of
|
||||
/// invisible: a name here is a promise with a date on it, and the test below fails the moment
|
||||
/// `COMMANDS` and reality disagree in either direction.
|
||||
pub const NOT_YET: &[(&str, &str)] = &[("env_add_manual", "M3 — Browse… has no surface yet")];
|
||||
pub const NOT_YET: &[(&str, &str)] = &[];
|
||||
|
||||
/// Start the app's own log: `data\logs\pipdock.<date>.log`, at `PIPDOCK_LOG` or INFO.
|
||||
///
|
||||
@@ -140,6 +140,8 @@ pub fn run() {
|
||||
commands::app_info,
|
||||
commands::env_scan,
|
||||
commands::env_probe,
|
||||
commands::env_add_manual,
|
||||
commands::env_remove_manual,
|
||||
commands::pkg_list,
|
||||
commands::pkg_outdated,
|
||||
commands::pin_list,
|
||||
@@ -233,7 +235,7 @@ mod tests {
|
||||
"core:event:allow-unlisten",
|
||||
// Decline on the legal gate.
|
||||
"core:window:allow-close",
|
||||
// Code Health's folder, Import requirements; Save report, Export.
|
||||
// Code Health's folder, Import requirements, Add interpreter…; Save report, Export.
|
||||
"dialog:allow-open",
|
||||
"dialog:allow-save",
|
||||
// Scoped; see the next test.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "PipDock",
|
||||
"version": "1.5.0",
|
||||
"version": "1.6.0",
|
||||
"identifier": "com.skullmute.pipdock",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
@@ -8,7 +8,7 @@ certifi==2026.10.23
|
||||
# via requests
|
||||
charset-normalizer==3.5.2
|
||||
# via requests
|
||||
click==8.5.0
|
||||
click==8.5.1
|
||||
# via deptry
|
||||
colorama==0.4.6 ; sys_platform == 'win32'
|
||||
# via deptry
|
||||
@@ -20,13 +20,13 @@ deptry==0.25.1
|
||||
# via -r tools/tools-requirements.txt
|
||||
filelock==4.1.0 ; python_full_version < '3.11'
|
||||
# via cachecontrol
|
||||
filelock==4.2.7 ; python_full_version >= '3.11'
|
||||
filelock==4.2.10 ; python_full_version >= '3.11'
|
||||
# via cachecontrol
|
||||
idna==3.20
|
||||
# via requests
|
||||
license-expression==30.4.4
|
||||
# via cyclonedx-python-lib
|
||||
markdown-it-py==4.2.0
|
||||
markdown-it-py==4.3.0
|
||||
# via rich
|
||||
mdurl==0.1.2
|
||||
# via markdown-it-py
|
||||
@@ -48,9 +48,9 @@ pip-requirements-parser==32.0.1
|
||||
# via pip-audit
|
||||
platformdirs==4.12.4 ; python_full_version < '3.11'
|
||||
# via pip-audit
|
||||
platformdirs==4.14.3 ; python_full_version >= '3.11'
|
||||
platformdirs==4.14.5 ; python_full_version >= '3.11'
|
||||
# via pip-audit
|
||||
py-serializable==2.1.0
|
||||
py-serializable==2.2.0
|
||||
# via cyclonedx-python-lib
|
||||
pygments==2.21.0
|
||||
# via rich
|
||||
@@ -64,7 +64,7 @@ requirements-parser==0.13.1
|
||||
# via deptry
|
||||
rich==15.0.0
|
||||
# via pip-audit
|
||||
ruff==0.17.3
|
||||
ruff==0.17.5
|
||||
# via -r tools/tools-requirements.txt
|
||||
sortedcontainers==2.4.0
|
||||
# via cyclonedx-python-lib
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
deptry==0.25.1
|
||||
vulture==2.16
|
||||
ruff==0.17.3
|
||||
ruff==0.17.5
|
||||
|
||||
# The Security tab (PRD P1-1, shipped in 1.2.0). Installed into its own venv, not Code Health's
|
||||
# (health::AUDIT_TOOLS), so a bump here never re-syncs the other one.
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useEffect, useRef, useState, type ReactNode } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { isBrowserShortcut } from '@/components/browserKeys'
|
||||
@@ -34,7 +34,7 @@ import {
|
||||
* hand-maintained negation of every key above it, so adding a screen meant editing two places and
|
||||
* forgetting the second showed both at once. Tabs with no entry fall through to the placeholder.
|
||||
*/
|
||||
const SCREENS: Partial<Record<NavKey, React.ReactNode>> = {
|
||||
const SCREENS: Partial<Record<NavKey, ReactNode>> = {
|
||||
environments: <PdEnvironments />,
|
||||
installed: <PdPackages mode="installed" />,
|
||||
updates: <PdPackages mode="updates" />,
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* double-submitted and the user keeps reading what they were reading.
|
||||
*/
|
||||
|
||||
import { useEffect, useId, useRef } from 'react'
|
||||
import { useEffect, useId, useRef, type ReactNode } from 'react'
|
||||
|
||||
interface PdDialogProps {
|
||||
/**
|
||||
@@ -41,12 +41,12 @@ interface PdDialogProps {
|
||||
/** Heading text, already localized. */
|
||||
title: string
|
||||
/** Body: the explanation, the list, whatever the caller needs. */
|
||||
children: React.ReactNode
|
||||
children: ReactNode
|
||||
/** Cancel's label. Rendered first, focused on open. */
|
||||
cancelLabel: string
|
||||
onCancel: () => void
|
||||
/** Everything other than Cancel, in the order UI-SPEC §5 lists them. */
|
||||
actions: React.ReactNode
|
||||
actions: ReactNode
|
||||
/** While true every control is disabled: work is in flight and the answer would be stale. */
|
||||
busy?: boolean
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* also why it passes the JSX-literal rule as a template expression rather than bare text.
|
||||
*/
|
||||
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
interface PdEmptyStateProps {
|
||||
/** Defaults to the terminal caret the rest of the app uses for a quiet statement of fact. */
|
||||
glyph?: string
|
||||
@@ -14,7 +16,7 @@ interface PdEmptyStateProps {
|
||||
/** Optional second line, one shade quieter. */
|
||||
hint?: string
|
||||
/** Optional single action, per §7. */
|
||||
action?: React.ReactNode
|
||||
action?: ReactNode
|
||||
}
|
||||
|
||||
export function PdEmptyState({ glyph = '▸', message, hint, action }: PdEmptyStateProps) {
|
||||
|
||||
@@ -45,7 +45,7 @@ describe('Report bug', () => {
|
||||
resetStore(useEnvStore)
|
||||
useEnvStore.setState({ rows: [ROW], selected: ENV.interpreter })
|
||||
vi.mocked(ipc.reportBugUrl).mockResolvedValue({
|
||||
url: 'https://github.com/poli0981/pipdock/issues/new',
|
||||
url: 'https://github.com/poli0981org/pipdock/issues/new',
|
||||
log: '[log excerpt]',
|
||||
})
|
||||
})
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* test while a change to the dimming *rule* still does.
|
||||
*/
|
||||
|
||||
import { memo } from 'react'
|
||||
import { memo, type CSSProperties } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { PdBadge } from '@/components/PdBadge'
|
||||
@@ -33,7 +33,7 @@ interface PdPackageRowProps {
|
||||
/** Open the dependency view focused on this package — UI-SPEC §4's "details" (PRD P1-6). */
|
||||
onDetails: (name: string) => void
|
||||
/** The virtualizer's absolute positioning. */
|
||||
style: React.CSSProperties
|
||||
style: CSSProperties
|
||||
}
|
||||
|
||||
function Row({
|
||||
|
||||
@@ -49,6 +49,7 @@ export function PdPalette({ onClose }: { onClose: () => void }) {
|
||||
|
||||
const setNav = useUiStore((s) => s.setNav)
|
||||
const scan = useEnvStore((s) => s.scan)
|
||||
const addManual = useEnvStore((s) => s.addManual)
|
||||
const loadPackages = useEnvStore((s) => s.loadPackages)
|
||||
const loadOutdated = useEnvStore((s) => s.loadOutdated)
|
||||
const takeSnapshot = useEnvStore((s) => s.takeSnapshot)
|
||||
@@ -79,6 +80,16 @@ export function PdPalette({ onClose }: { onClose: () => void }) {
|
||||
void scan()
|
||||
},
|
||||
},
|
||||
{
|
||||
// The picker opens over whichever screen is showing; Environments is where the row lands.
|
||||
id: 'env:add-manual',
|
||||
label: t('palette.addInterpreter'),
|
||||
group: t('nav.environments'),
|
||||
run: () => {
|
||||
setNav('environments')
|
||||
void addManual(t('env.addTitle'))
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'pkg:refresh',
|
||||
label: t('palette.refreshPackages'),
|
||||
@@ -137,6 +148,7 @@ export function PdPalette({ onClose }: { onClose: () => void }) {
|
||||
t,
|
||||
setNav,
|
||||
scan,
|
||||
addManual,
|
||||
loadPackages,
|
||||
loadOutdated,
|
||||
clearSelection,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
/** The repository itself. Inside `https://github.com/*`, which the opener capability allows. */
|
||||
export const REPO = 'https://github.com/poli0981/pipdock'
|
||||
export const REPO = 'https://github.com/poli0981org/pipdock'
|
||||
|
||||
const BLOB = `${REPO}/blob/main`
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ export const COMMANDS = [
|
||||
'app_info',
|
||||
'env_scan',
|
||||
'env_add_manual',
|
||||
'env_remove_manual',
|
||||
'env_probe',
|
||||
'pkg_list',
|
||||
'pkg_outdated',
|
||||
@@ -210,6 +211,22 @@ export const envScan = (): Promise<EnvRow[]> => invoke('env_scan')
|
||||
export const envProbe = (interpreter: string, source?: EnvSource): Promise<EnvRow> =>
|
||||
invoke('env_probe', source === undefined ? { interpreter } : { interpreter, source })
|
||||
|
||||
/**
|
||||
* Add an interpreter the person picked to the list discovery is shown beside, and return its row —
|
||||
* *Add interpreter…* (PRD P0-1). Rust validates the path before anything runs it, probes it, and
|
||||
* stores it only when both succeed; the row carries the canonical path it stored.
|
||||
*/
|
||||
export const envAddManual = (interpreter: string): Promise<EnvRow> =>
|
||||
invoke('env_add_manual', { interpreter })
|
||||
|
||||
/**
|
||||
* Take an added interpreter off that list, by the path its row shows. Nothing on disk is touched;
|
||||
* `false` if it was not on it. The path, not the `envHash`: an interpreter whose file is gone gets
|
||||
* its identity recomputed from the stored text, which can differ from the one it was added under.
|
||||
*/
|
||||
export const envRemoveManual = (interpreter: string): Promise<boolean> =>
|
||||
invoke('env_remove_manual', { interpreter })
|
||||
|
||||
/**
|
||||
* Everything installed in `env` — the Installed table.
|
||||
*
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"pipUpgradeNoSnapshot": "No snapshot is taken: restoring one would need the pip being replaced.",
|
||||
"title": "Environments",
|
||||
"empty": "no Python environments found",
|
||||
"emptyHint": "Install Python, or create a virtual environment named .venv, venv, env or .env in this folder.",
|
||||
"emptyHint": "Install Python, or add one you already have — the python.exe inside a virtual environment’s Scripts folder, for example.",
|
||||
"scanning": "Discovering environments…",
|
||||
"scanPhase": {
|
||||
"registry": "Reading the Windows registry",
|
||||
@@ -66,7 +66,13 @@
|
||||
},
|
||||
"managed": "MANAGED",
|
||||
"managedDetail": "Externally managed (PEP 668). Create a virtual environment instead; the override lives in Settings and is discouraged.",
|
||||
"selected": "Selected"
|
||||
"selected": "Selected",
|
||||
"add": "Add interpreter…",
|
||||
"addTitle": "Choose a Python interpreter (python.exe)",
|
||||
"added": "Added {{path}} to the list.",
|
||||
"remove": "Remove from list",
|
||||
"removeLabel": "Remove from list: {{path}}",
|
||||
"removed": "Removed {{path}} from the list. Nothing on disk was changed."
|
||||
},
|
||||
"packages": {
|
||||
"installedTitle": "Installed",
|
||||
@@ -198,7 +204,8 @@
|
||||
"clearQueue": "Empty the install queue",
|
||||
"groups": {
|
||||
"go": "Go to"
|
||||
}
|
||||
},
|
||||
"addInterpreter": "Add a Python interpreter…"
|
||||
},
|
||||
"pins": {
|
||||
"empty": "no pins in this environment",
|
||||
@@ -448,7 +455,7 @@
|
||||
},
|
||||
"summary": "PipDock is provided without warranty. It runs pip or uv against environments you choose, and every change is previewed and snapshotted first — but you remain responsible for what you install.",
|
||||
"accept": "I have read and accept these documents.",
|
||||
"openFailed": "Could not open the link. The documents are on GitHub under poli0981/pipdock.",
|
||||
"openFailed": "Could not open the link. The documents are on GitHub under poli0981org/pipdock.",
|
||||
"close": "Close"
|
||||
},
|
||||
"about": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"errors": {
|
||||
"PD-ENV-001": "That interpreter is missing or cannot be run.",
|
||||
"PD-ENV-001": "That interpreter is missing, or PipDock cannot run it.",
|
||||
"PD-ENV-002": "This Python is managed by the operating system.",
|
||||
"PD-ENV-003": "PipDock could not read this environment.",
|
||||
"PD-ENG-001": "The selected engine is not installed or not on PATH.",
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"pipUpgradeNoSnapshot": "Không tạo bản chụp: khôi phục nó sẽ cần chính pip đang được thay thế.",
|
||||
"title": "Môi trường",
|
||||
"empty": "không tìm thấy môi trường Python nào",
|
||||
"emptyHint": "Hãy cài Python, hoặc tạo một môi trường ảo tên .venv, venv, env hoặc .env trong thư mục này.",
|
||||
"emptyHint": "Hãy cài Python, hoặc thêm một trình thông dịch bạn đã có — ví dụ python.exe trong thư mục Scripts của một môi trường ảo.",
|
||||
"scanning": "Đang tìm môi trường…",
|
||||
"scanPhase": {
|
||||
"registry": "Đang đọc registry của Windows",
|
||||
@@ -65,7 +65,13 @@
|
||||
},
|
||||
"managed": "HỆ THỐNG",
|
||||
"managedDetail": "Môi trường do hệ điều hành quản lý (PEP 668). Hãy tạo một môi trường ảo; tuỳ chọn ghi đè nằm trong Cài đặt và không được khuyến khích.",
|
||||
"selected": "Đang chọn"
|
||||
"selected": "Đang chọn",
|
||||
"add": "Thêm trình thông dịch…",
|
||||
"addTitle": "Chọn trình thông dịch Python (python.exe)",
|
||||
"added": "Đã thêm {{path}} vào danh sách.",
|
||||
"remove": "Bỏ khỏi danh sách",
|
||||
"removeLabel": "Bỏ khỏi danh sách: {{path}}",
|
||||
"removed": "Đã bỏ {{path}} khỏi danh sách. Không có gì trên đĩa bị thay đổi."
|
||||
},
|
||||
"packages": {
|
||||
"installedTitle": "Đã cài",
|
||||
@@ -185,7 +191,8 @@
|
||||
"clearQueue": "Xoá hàng đợi cài đặt",
|
||||
"groups": {
|
||||
"go": "Đi tới"
|
||||
}
|
||||
},
|
||||
"addInterpreter": "Thêm trình thông dịch Python…"
|
||||
},
|
||||
"pins": {
|
||||
"empty": "môi trường này chưa có gói nào được ghim",
|
||||
@@ -406,7 +413,7 @@
|
||||
},
|
||||
"summary": "PipDock được cung cấp không kèm bảo hành. Nó chạy pip hoặc uv trên những môi trường bạn chọn, và mọi thay đổi đều được xem trước và chụp ảnh trước — nhưng bạn vẫn chịu trách nhiệm về những gì mình cài.",
|
||||
"accept": "Tôi đã đọc và chấp nhận các tài liệu này.",
|
||||
"openFailed": "Không mở được liên kết. Các tài liệu nằm trên GitHub tại poli0981/pipdock.",
|
||||
"openFailed": "Không mở được liên kết. Các tài liệu nằm trên GitHub tại poli0981org/pipdock.",
|
||||
"close": "Đóng"
|
||||
},
|
||||
"about": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"errors": {
|
||||
"PD-ENV-001": "Không tìm thấy hoặc không chạy được trình thông dịch đó.",
|
||||
"PD-ENV-001": "Không tìm thấy trình thông dịch đó, hoặc PipDock không thể chạy nó.",
|
||||
"PD-ENV-002": "Bản Python này do hệ điều hành quản lý.",
|
||||
"PD-ENV-003": "PipDock không đọc được môi trường này.",
|
||||
"PD-ENG-001": "Bộ máy đã chọn chưa được cài, hoặc không có trong PATH.",
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
/**
|
||||
* *Add interpreter…* and *Remove from list* — PRD P0-1's manual browse (1.6.0).
|
||||
*
|
||||
* The store half and the screen half, because the seam between them is where this app's bugs have
|
||||
* lived (CLAUDE.md, `PdPlanPanel`). Both key on the interpreter **path**: the first version merged
|
||||
* and removed by `envHash`, which then followed a venv's link — so a venv made with `--symlinks`
|
||||
* merged into the base Python it points at, and *Remove from list* took every row sharing the hash
|
||||
* with it. An independent review of 1.6.0 found both, and the cases below are the ones it named.
|
||||
* Identity no longer follows a venv's link, but two names for one Python still share a hash, so
|
||||
* the rows stay keyed on what they show.
|
||||
*/
|
||||
|
||||
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import * as ipc from '@/ipc'
|
||||
import type { EnvRow, PdError } from '@/ipc'
|
||||
import { PdEnvironments } from '@/screens/PdEnvironments'
|
||||
import { useEnvStore } from '@/stores'
|
||||
import { resetStore } from '@/test/stores'
|
||||
|
||||
vi.mock('@/ipc', async () => {
|
||||
const actual = await vi.importActual<typeof import('@/ipc')>('@/ipc')
|
||||
const { ipcMock } = await import('@/test/ipc')
|
||||
return {
|
||||
...actual,
|
||||
...ipcMock(),
|
||||
onScanProgress: vi.fn().mockResolvedValue(() => undefined),
|
||||
}
|
||||
})
|
||||
|
||||
const row = (name: string, source: EnvRow['source'] = 'venv-scan'): EnvRow => {
|
||||
const interpreter = `D:\\work\\${name}\\Scripts\\python.exe`
|
||||
return {
|
||||
interpreter,
|
||||
source,
|
||||
envHash: `hash-${name}`,
|
||||
env: {
|
||||
interpreter,
|
||||
prefix: `D:\\work\\${name}`,
|
||||
pythonVersion: '3.13.9',
|
||||
externallyManaged: false,
|
||||
hiddenUserSite: null,
|
||||
source,
|
||||
},
|
||||
}
|
||||
}
|
||||
const DISCOVERED = row('discovered', 'registry')
|
||||
const ADDED = row('myenv', 'manual')
|
||||
|
||||
const missing: PdError = { code: 'PD-ENV-001', message: 'no interpreter at E:\\gone\\python.exe' }
|
||||
const GONE: EnvRow = {
|
||||
interpreter: 'E:\\gone\\python.exe',
|
||||
source: 'manual',
|
||||
envHash: 'hash-gone',
|
||||
error: missing,
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
resetStore(useEnvStore)
|
||||
})
|
||||
|
||||
describe('the store', () => {
|
||||
it('asks for a python.exe with the title it was given, and a cancelled picker changes nothing', async () => {
|
||||
vi.mocked(ipc.pickOpenFile).mockResolvedValueOnce(null)
|
||||
useEnvStore.setState({ rows: [DISCOVERED], selected: DISCOVERED.interpreter })
|
||||
|
||||
await useEnvStore.getState().addManual('Choose one')
|
||||
|
||||
expect(ipc.pickOpenFile).toHaveBeenCalledWith('Choose one', ['exe'])
|
||||
expect(ipc.envAddManual).not.toHaveBeenCalled()
|
||||
const state = useEnvStore.getState()
|
||||
expect(state.addingManual).toBe(false)
|
||||
expect(state.rows).toEqual([DISCOVERED])
|
||||
expect(state.selected).toBe(DISCOVERED.interpreter)
|
||||
})
|
||||
|
||||
it('appends the new row, selects it and says so', async () => {
|
||||
vi.mocked(ipc.pickOpenFile).mockResolvedValueOnce('d:\\work\\myenv\\scripts\\python.exe')
|
||||
vi.mocked(ipc.envAddManual).mockResolvedValueOnce(ADDED)
|
||||
useEnvStore.setState({ rows: [DISCOVERED], selected: DISCOVERED.interpreter })
|
||||
|
||||
await useEnvStore.getState().addManual('Choose one')
|
||||
|
||||
expect(ipc.envAddManual).toHaveBeenCalledWith('d:\\work\\myenv\\scripts\\python.exe')
|
||||
const state = useEnvStore.getState()
|
||||
// The row Rust returned, with the canonical path it stored — not the spelling picked.
|
||||
expect(state.rows).toEqual([DISCOVERED, ADDED])
|
||||
expect(state.selected).toBe(ADDED.interpreter)
|
||||
expect(state.manualNotice).toEqual({ kind: 'added', path: ADDED.interpreter })
|
||||
expect(state.addingManual).toBe(false)
|
||||
})
|
||||
|
||||
it('does not list an interpreter twice when discovery already has it', async () => {
|
||||
// The same file in another case — Windows paths are case-insensitive: one row, the
|
||||
// discovered one, under the spelling the next scan will list, selected.
|
||||
vi.mocked(ipc.pickOpenFile).mockResolvedValueOnce(DISCOVERED.interpreter)
|
||||
vi.mocked(ipc.envAddManual).mockResolvedValueOnce({
|
||||
...ADDED,
|
||||
envHash: DISCOVERED.envHash,
|
||||
interpreter: DISCOVERED.interpreter.toUpperCase(),
|
||||
})
|
||||
useEnvStore.setState({ rows: [DISCOVERED], selected: null })
|
||||
|
||||
await useEnvStore.getState().addManual('Choose one')
|
||||
|
||||
const state = useEnvStore.getState()
|
||||
expect(state.rows).toEqual([DISCOVERED])
|
||||
expect(state.selected).toBe(DISCOVERED.interpreter)
|
||||
})
|
||||
|
||||
it('lists a venv made with --symlinks beside the base Python it links to, and selects the venv', async () => {
|
||||
// Its `python.exe` is a link to the base, and the two shared an `envHash` until 1.6.0's review.
|
||||
// Merging on the hash selected the base: the next update would have changed the system's
|
||||
// Python, not the venv's. Any two rows that share a hash must still be told apart by path.
|
||||
const linked: EnvRow = { ...ADDED, envHash: DISCOVERED.envHash }
|
||||
vi.mocked(ipc.pickOpenFile).mockResolvedValueOnce(linked.interpreter)
|
||||
vi.mocked(ipc.envAddManual).mockResolvedValueOnce(linked)
|
||||
useEnvStore.setState({ rows: [DISCOVERED], selected: DISCOVERED.interpreter })
|
||||
|
||||
await useEnvStore.getState().addManual('Choose one')
|
||||
|
||||
const state = useEnvStore.getState()
|
||||
expect(state.rows).toEqual([DISCOVERED, linked])
|
||||
expect(state.selected).toBe(linked.interpreter)
|
||||
})
|
||||
|
||||
it('replaces a broken row when its venv is made again, and selects the working one', async () => {
|
||||
const fresh: EnvRow = {
|
||||
interpreter: GONE.interpreter,
|
||||
source: 'manual',
|
||||
envHash: GONE.envHash,
|
||||
env: {
|
||||
interpreter: GONE.interpreter,
|
||||
prefix: 'E:\\gone',
|
||||
pythonVersion: '3.13.9',
|
||||
externallyManaged: false,
|
||||
hiddenUserSite: null,
|
||||
source: 'manual',
|
||||
},
|
||||
}
|
||||
vi.mocked(ipc.pickOpenFile).mockResolvedValueOnce(GONE.interpreter)
|
||||
vi.mocked(ipc.envAddManual).mockResolvedValueOnce(fresh)
|
||||
useEnvStore.setState({ rows: [DISCOVERED, GONE], selected: DISCOVERED.interpreter })
|
||||
|
||||
await useEnvStore.getState().addManual('Choose one')
|
||||
|
||||
const state = useEnvStore.getState()
|
||||
expect(state.rows).toEqual([DISCOVERED, fresh])
|
||||
expect(state.rows[1]?.error).toBeUndefined()
|
||||
expect(state.selected).toBe(GONE.interpreter)
|
||||
})
|
||||
|
||||
it('takes the spelling Rust stored when an added interpreter is added again', async () => {
|
||||
// `add_manual_env` rewrites the stored text, so the next scan lists the new spelling; a row
|
||||
// kept under the old one would leave the selection naming a row that is about to be renamed.
|
||||
const respelled: EnvRow = { ...ADDED, interpreter: ADDED.interpreter.toLowerCase() }
|
||||
vi.mocked(ipc.pickOpenFile).mockResolvedValueOnce(respelled.interpreter)
|
||||
vi.mocked(ipc.envAddManual).mockResolvedValueOnce(respelled)
|
||||
useEnvStore.setState({ rows: [DISCOVERED, ADDED], selected: ADDED.interpreter })
|
||||
|
||||
await useEnvStore.getState().addManual('Choose one')
|
||||
|
||||
const state = useEnvStore.getState()
|
||||
expect(state.rows).toEqual([DISCOVERED, respelled])
|
||||
expect(state.selected).toBe(respelled.interpreter)
|
||||
})
|
||||
|
||||
it('keeps a refused path off the list and shows why', async () => {
|
||||
const refused: PdError = {
|
||||
code: 'PD-ENV-001',
|
||||
message: 'D:\\notepad.exe is not a Python interpreter PipDock will run',
|
||||
}
|
||||
vi.mocked(ipc.pickOpenFile).mockResolvedValueOnce('D:\\notepad.exe')
|
||||
vi.mocked(ipc.envAddManual).mockRejectedValueOnce(refused)
|
||||
useEnvStore.setState({ rows: [DISCOVERED] })
|
||||
|
||||
await useEnvStore.getState().addManual('Choose one')
|
||||
|
||||
const state = useEnvStore.getState()
|
||||
expect(state.rows).toEqual([DISCOVERED])
|
||||
expect(state.error?.code).toBe('PD-ENV-001')
|
||||
expect(state.addingManual).toBe(false)
|
||||
})
|
||||
|
||||
it('refuses to add while a scan runs, and to scan while an add runs', async () => {
|
||||
// A scan that read the list before the add wrote it would replace `rows` without the new row.
|
||||
useEnvStore.setState({ scanning: true })
|
||||
await useEnvStore.getState().addManual('Choose one')
|
||||
expect(ipc.pickOpenFile).not.toHaveBeenCalled()
|
||||
|
||||
useEnvStore.setState({ scanning: false, addingManual: true })
|
||||
await useEnvStore.getState().scan()
|
||||
expect(ipc.envScan).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('removes a row, falls back from a selection it held and closes its detail', async () => {
|
||||
useEnvStore.setState({
|
||||
rows: [DISCOVERED, ADDED],
|
||||
selected: ADDED.interpreter,
|
||||
openFor: ADDED.interpreter,
|
||||
})
|
||||
|
||||
await useEnvStore.getState().removeManual(ADDED.interpreter)
|
||||
|
||||
// By the path the row shows: for a file that is gone, the hash Rust would recompute from the
|
||||
// stored text can differ from the one it was added under, and removing by it never matched.
|
||||
expect(ipc.envRemoveManual).toHaveBeenCalledWith(ADDED.interpreter)
|
||||
const state = useEnvStore.getState()
|
||||
expect(state.rows).toEqual([DISCOVERED])
|
||||
expect(state.selected).toBe(DISCOVERED.interpreter)
|
||||
expect(state.openFor).toBeNull()
|
||||
expect(state.manualNotice).toEqual({ kind: 'removed', path: ADDED.interpreter })
|
||||
expect(state.removingManual).toBeNull()
|
||||
})
|
||||
|
||||
it('leaves the selection alone when another row is removed', async () => {
|
||||
useEnvStore.setState({ rows: [DISCOVERED, GONE], selected: DISCOVERED.interpreter })
|
||||
await useEnvStore.getState().removeManual(GONE.interpreter)
|
||||
expect(useEnvStore.getState().selected).toBe(DISCOVERED.interpreter)
|
||||
expect(useEnvStore.getState().rows).toEqual([DISCOVERED])
|
||||
})
|
||||
|
||||
it('removes only the row it was asked about when another shares its envHash', async () => {
|
||||
const linked: EnvRow = { ...ADDED, envHash: DISCOVERED.envHash }
|
||||
useEnvStore.setState({ rows: [DISCOVERED, linked], selected: DISCOVERED.interpreter })
|
||||
await useEnvStore.getState().removeManual(linked.interpreter)
|
||||
expect(useEnvStore.getState().rows).toEqual([DISCOVERED])
|
||||
})
|
||||
|
||||
it('refuses to remove while a scan runs, and to scan while a removal runs', async () => {
|
||||
// A scan that read the list before the removal was written would bring the row back.
|
||||
useEnvStore.setState({ rows: [DISCOVERED, ADDED], scanning: true })
|
||||
await useEnvStore.getState().removeManual(ADDED.interpreter)
|
||||
expect(ipc.envRemoveManual).not.toHaveBeenCalled()
|
||||
expect(useEnvStore.getState().rows).toEqual([DISCOVERED, ADDED])
|
||||
|
||||
useEnvStore.setState({ scanning: false, removingManual: ADDED.interpreter })
|
||||
await useEnvStore.getState().scan()
|
||||
expect(ipc.envScan).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
describe('the screen', () => {
|
||||
it('offers Add interpreter… beside Rescan, busy while a scan runs', () => {
|
||||
const addManual = vi.fn()
|
||||
useEnvStore.setState({ rows: [DISCOVERED], scanning: true, scan: vi.fn(), addManual })
|
||||
render(<PdEnvironments />)
|
||||
|
||||
const add = screen.getByRole('button', { name: 'Add interpreter…' })
|
||||
expect(add).toHaveAttribute('aria-disabled', 'true')
|
||||
expect(add).not.toBeDisabled()
|
||||
fireEvent.click(add)
|
||||
expect(addManual).not.toHaveBeenCalled()
|
||||
|
||||
act(() => {
|
||||
useEnvStore.setState({ scanning: false })
|
||||
})
|
||||
fireEvent.click(add)
|
||||
expect(addManual).toHaveBeenCalledWith('Choose a Python interpreter (python.exe)')
|
||||
})
|
||||
|
||||
it('makes Add interpreter… the empty state’s one action', () => {
|
||||
useEnvStore.setState({ rows: [], scanning: false, scan: vi.fn() })
|
||||
render(<PdEnvironments />)
|
||||
expect(screen.getAllByRole('button', { name: 'Add interpreter…' })).toHaveLength(2)
|
||||
})
|
||||
|
||||
it('offers Remove from list on added rows only, broken ones included', () => {
|
||||
useEnvStore.setState({ rows: [DISCOVERED, ADDED, GONE], scan: vi.fn() })
|
||||
render(<PdEnvironments />)
|
||||
|
||||
const removes = screen.getAllByRole('button', { name: /^Remove from list: / })
|
||||
expect(removes.map((b) => b.getAttribute('aria-label'))).toEqual([
|
||||
`Remove from list: ${ADDED.interpreter}`,
|
||||
`Remove from list: ${GONE.interpreter}`,
|
||||
])
|
||||
// Forgetting an entry deletes nothing, so it is not drawn as destructive (UI-SPEC §7).
|
||||
for (const button of removes) expect(button).not.toHaveAttribute('data-destructive')
|
||||
})
|
||||
|
||||
it('makes Remove from list busy while a scan runs, without taking focus from it', () => {
|
||||
const removeManual = vi.fn()
|
||||
useEnvStore.setState({ rows: [ADDED], scanning: true, scan: vi.fn(), removeManual })
|
||||
render(<PdEnvironments />)
|
||||
|
||||
const remove = screen.getByRole('button', { name: `Remove from list: ${ADDED.interpreter}` })
|
||||
expect(remove).toHaveAttribute('aria-disabled', 'true')
|
||||
expect(remove).not.toBeDisabled()
|
||||
fireEvent.click(remove)
|
||||
expect(removeManual).not.toHaveBeenCalled()
|
||||
|
||||
act(() => {
|
||||
useEnvStore.setState({ scanning: false })
|
||||
})
|
||||
fireEvent.click(remove)
|
||||
expect(removeManual).toHaveBeenCalledWith(ADDED.interpreter)
|
||||
})
|
||||
|
||||
it('says what was added in a status region that was there before the words', () => {
|
||||
useEnvStore.setState({ rows: [DISCOVERED], scan: vi.fn() })
|
||||
render(<PdEnvironments />)
|
||||
const status = screen.getByRole('status')
|
||||
expect(status).toHaveTextContent('')
|
||||
|
||||
act(() => {
|
||||
useEnvStore.setState({
|
||||
rows: [DISCOVERED, ADDED],
|
||||
manualNotice: { kind: 'added', path: ADDED.interpreter },
|
||||
})
|
||||
})
|
||||
expect(screen.getByRole('status')).toBe(status)
|
||||
expect(status).toHaveTextContent(`Added ${ADDED.interpreter} to the list.`)
|
||||
})
|
||||
|
||||
it('moves focus to the heading when the row whose button had it goes', async () => {
|
||||
useEnvStore.setState({ rows: [DISCOVERED, ADDED], selected: DISCOVERED.interpreter, scan: vi.fn() })
|
||||
render(<PdEnvironments />)
|
||||
const remove = screen.getByRole('button', { name: `Remove from list: ${ADDED.interpreter}` })
|
||||
remove.focus()
|
||||
expect(remove).toHaveFocus()
|
||||
|
||||
fireEvent.click(remove)
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole('button', { name: /^Remove from list: / })).toBeNull()
|
||||
})
|
||||
expect(screen.getByRole('heading', { level: 1, name: 'Environments' })).toHaveFocus()
|
||||
})
|
||||
})
|
||||
@@ -7,9 +7,14 @@
|
||||
*
|
||||
* A row whose probe failed renders **in place** with its code rather than disappearing: one broken
|
||||
* interpreter must not hide the rest, which is the rule `pipdock env list` already follows.
|
||||
*
|
||||
* *Add interpreter…* (PRD P0-1's manual browse, 1.6.0) puts any `python.exe` on the list — the GUI
|
||||
* has no working directory worth scanning, so before it a venv anywhere but the four folder names
|
||||
* beside the program was out of reach. An added row carries *Remove from list*, broken or not: a
|
||||
* venv deleted from disk stays listed with `PD-ENV-001` precisely so it can be removed.
|
||||
*/
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { PdDialog } from '@/components/PdDialog'
|
||||
@@ -34,6 +39,49 @@ function SourceChip({ row }: { row: EnvRow }) {
|
||||
)
|
||||
}
|
||||
|
||||
/** *Remove from list*, on a row *Add interpreter…* put there. Never `data-destructive`: it forgets
|
||||
* an entry, deletes nothing, and the same picker adds it back. */
|
||||
function RemoveButton({ row }: { row: EnvRow }) {
|
||||
const { t } = useTranslation()
|
||||
const removeManual = useEnvStore((s) => s.removeManual)
|
||||
const busy = useEnvStore((s) => s.removingManual !== null || s.scanning)
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
if (!busy) void removeManual(row.interpreter)
|
||||
}}
|
||||
aria-disabled={busy}
|
||||
// The visible words first, then the path: the name contains what is on the button.
|
||||
aria-label={t('env.removeLabel', { path: row.interpreter })}
|
||||
data-action="remove-manual"
|
||||
className="rounded-pd border border-border px-3 py-1 text-data aria-disabled:opacity-40"
|
||||
>
|
||||
{t('env.remove')}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
/** *Add interpreter…*, in the header and as the empty state's one action (UI-SPEC §7). */
|
||||
function AddButton() {
|
||||
const { t } = useTranslation()
|
||||
const addManual = useEnvStore((s) => s.addManual)
|
||||
const busy = useEnvStore((s) => s.addingManual || s.scanning)
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
if (!busy) void addManual(t('env.addTitle'))
|
||||
}}
|
||||
aria-disabled={busy}
|
||||
data-action="add-manual"
|
||||
className="rounded-pd border border-border px-3 py-1 text-data aria-disabled:opacity-40"
|
||||
>
|
||||
{t('env.add')}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
function Row({ row }: { row: EnvRow }) {
|
||||
const { t } = useTranslation()
|
||||
const selected = useEnvStore((s) => s.selected)
|
||||
@@ -87,8 +135,9 @@ function Row({ row }: { row: EnvRow }) {
|
||||
) : null}
|
||||
|
||||
{row.error !== undefined ? (
|
||||
<div className="mt-2">
|
||||
<div className="mt-2 space-y-2">
|
||||
<PdErrorRow error={row.error} />
|
||||
{row.source === 'manual' ? <RemoveButton row={row} /> : null}
|
||||
</div>
|
||||
) : (
|
||||
<div className="mt-2 flex items-center gap-2">
|
||||
@@ -134,6 +183,7 @@ function Row({ row }: { row: EnvRow }) {
|
||||
{upgrading ? t('env.pipUpgrading') : t('env.pipUpgrade')}
|
||||
</button>
|
||||
) : null}
|
||||
{row.source === 'manual' ? <RemoveButton row={row} /> : null}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -181,12 +231,28 @@ export function PdEnvironments() {
|
||||
// a detail view or selecting a snapshot would re-render the whole environment list.
|
||||
const rows = useEnvStore((s) => s.rows)
|
||||
const scanning = useEnvStore((s) => s.scanning)
|
||||
const adding = useEnvStore((s) => s.addingManual)
|
||||
const progress = useEnvStore((s) => s.progress)
|
||||
const error = useEnvStore((s) => s.error)
|
||||
const scan = useEnvStore((s) => s.scan)
|
||||
const setProgress = useEnvStore((s) => s.setProgress)
|
||||
const openFor = useEnvStore((s) => s.openFor)
|
||||
const manualNotice = useEnvStore((s) => s.manualNotice)
|
||||
const { open, failed: openFailed } = useOpenExternal()
|
||||
const headingRef = useRef<HTMLHeadingElement>(null)
|
||||
|
||||
// *Remove from list* unmounts the button that was pressed, so focus fell to <body> and the next
|
||||
// Tab started from the top of the window. App's lost-focus rule covers screens being replaced;
|
||||
// a row leaving the list is this screen's own business. Same condition: only when focus was
|
||||
// actually lost, so a rescan never pulls anyone off the control they are on.
|
||||
useEffect(() => {
|
||||
const active = document.activeElement
|
||||
if (active !== null && active !== document.body && active.isConnected) return
|
||||
const heading = headingRef.current
|
||||
if (heading === null) return
|
||||
heading.setAttribute('tabindex', '-1')
|
||||
heading.focus()
|
||||
}, [rows])
|
||||
|
||||
useEffect(() => {
|
||||
// Subscribe before scanning, or the first phases are emitted into nothing.
|
||||
@@ -209,21 +275,34 @@ export function PdEnvironments() {
|
||||
return (
|
||||
<section aria-labelledby="env-title" className="h-full overflow-auto p-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 id="env-title" className="text-accent">
|
||||
<h1 id="env-title" ref={headingRef} className="text-accent">
|
||||
{t('env.title')}
|
||||
</h1>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
if (!scanning) void scan()
|
||||
}}
|
||||
aria-disabled={scanning}
|
||||
className="rounded-pd border border-border px-3 py-1 text-data aria-disabled:opacity-40"
|
||||
>
|
||||
{t('actions.rescan')}
|
||||
</button>
|
||||
<div className="flex items-center gap-2">
|
||||
<AddButton />
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
if (!scanning && !adding) void scan()
|
||||
}}
|
||||
aria-disabled={scanning || adding}
|
||||
className="rounded-pd border border-border px-3 py-1 text-data aria-disabled:opacity-40"
|
||||
>
|
||||
{t('actions.rescan')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mounted from the start and only its text changes: a live region that arrives together
|
||||
with its words may never be announced (ACCESSIBILITY.md, backlog A2). */}
|
||||
<p role="status" className="mt-2 text-data text-text-dim">
|
||||
{manualNotice === null
|
||||
? ''
|
||||
: t(manualNotice.kind === 'added' ? 'env.added' : 'env.removed', {
|
||||
path: manualNotice.path,
|
||||
})}
|
||||
</p>
|
||||
|
||||
{scanning ? (
|
||||
<p aria-live="polite" className="mt-4 text-text-dim">
|
||||
{progress === null
|
||||
@@ -239,7 +318,7 @@ export function PdEnvironments() {
|
||||
) : null}
|
||||
|
||||
{!scanning && rows.length === 0 && error === null ? (
|
||||
<PdEmptyState message={t('env.empty')} hint={t('env.emptyHint')} />
|
||||
<PdEmptyState message={t('env.empty')} hint={t('env.emptyHint')} action={<AddButton />} />
|
||||
) : null}
|
||||
|
||||
<ul className="mt-4 space-y-2">
|
||||
|
||||
@@ -153,6 +153,11 @@ export function PdPlanPanel({ onFinished }: PdPlanPanelProps) {
|
||||
forced.flatMap((f) => (f.blockers ?? []).map((b) => b.by ?? b.constraint)),
|
||||
).size
|
||||
const needsDecisions = step?.step === 'needsDecisions'
|
||||
// Narrowed by an explicit null check, where it is read. TypeScript follows both an aliased
|
||||
// condition (`needsDecisions`) and an optional chain back to `step`; Qodana's WebStorm engine
|
||||
// follows neither, and reported `step.roundsRemaining` as a possible null twice (2026-11-21).
|
||||
const roundsRemaining =
|
||||
step !== null && step.step === 'needsDecisions' ? step.roundsRemaining : null
|
||||
const exhausted = step?.step === 'roundsExhausted'
|
||||
const nothingToDo = isRollback ? preview !== null && rollbackOps === 0 : step?.step === 'nothing'
|
||||
const confirmable = isRollback ? preview !== null && rollbackOps > 0 : step !== null && step.step !== 'nothing'
|
||||
@@ -193,11 +198,11 @@ export function PdPlanPanel({ onFinished }: PdPlanPanelProps) {
|
||||
|
||||
{/* The round counter UI-SPEC §4 now requires. `MAX_CONFLICT_ROUNDS` existed in core with
|
||||
nothing surfacing it, so a user could hit the cap unwarned. */}
|
||||
{needsDecisions ? (
|
||||
{roundsRemaining === null ? null : (
|
||||
<p className="mt-2 text-data text-text-dim">
|
||||
{t('plan.roundsLeft', { count: step.roundsRemaining })}
|
||||
{t('plan.roundsLeft', { count: roundsRemaining })}
|
||||
</p>
|
||||
) : null}
|
||||
)}
|
||||
{exhausted ? <p className="mt-2 text-data text-warn">{t('plan.roundsExhausted')}</p> : null}
|
||||
|
||||
{preview !== null ? (
|
||||
|
||||
+108
-1
@@ -23,7 +23,9 @@ import i18n, {
|
||||
type Locale,
|
||||
} from '@/i18n'
|
||||
import {
|
||||
envAddManual,
|
||||
envProbe,
|
||||
envRemoveManual,
|
||||
envScan,
|
||||
legalConsentGet,
|
||||
legalConsentSet,
|
||||
@@ -32,6 +34,7 @@ import {
|
||||
pinRemove,
|
||||
pinSuggestions,
|
||||
pipUpgrade,
|
||||
pickOpenFile,
|
||||
pkgList,
|
||||
pkgOutdated,
|
||||
snapshotCreate,
|
||||
@@ -176,6 +179,33 @@ interface EnvState {
|
||||
*/
|
||||
upgradePip: (interpreter: string) => Promise<void>
|
||||
|
||||
/** An *Add interpreter…* in flight, from the picker opening to the row arriving. */
|
||||
addingManual: boolean
|
||||
/**
|
||||
* *Add interpreter…* (PRD P0-1): ask for a `python.exe`, put it on the list, select it.
|
||||
*
|
||||
* `title` arrives localized — `@/ipc` has no `t`. Cancelling the picker changes nothing. The new
|
||||
* row is merged **by its path, case-insensitively**, not by `envHash`: two names for one Python
|
||||
* share a hash, and until 1.6.0's review so did a venv made with `--symlinks` and its base, so
|
||||
* merging on the hash selected the base Python in place of the venv a person had just added. A listed row with the same path is
|
||||
* kept only when discovery found it and it works; one this list put there, or one that is
|
||||
* *broken* — a venv deleted and made again — is replaced by the row Rust returned and selected.
|
||||
* Refused while a scan runs: the scan read the list before this add wrote to it, and its result
|
||||
* would replace `rows` without the new one.
|
||||
*/
|
||||
addManual: (title: string) => Promise<void>
|
||||
/** Which added interpreter is being taken off the list, by its path. */
|
||||
removingManual: string | null
|
||||
/**
|
||||
* Take an added interpreter off the list, by its path. Nothing on disk is touched. A selected or
|
||||
* opened row that goes is deselected or closed; selection falls back as a rescan's would.
|
||||
* Refused while a scan runs, for the add's reason the other way round: a scan that read the list
|
||||
* before the removal would bring the row back.
|
||||
*/
|
||||
removeManual: (interpreter: string) => Promise<void>
|
||||
/** What the last add or removal did, for the screen's status region — a path, or null. */
|
||||
manualNotice: { kind: 'added' | 'removed'; path: string } | null
|
||||
|
||||
// -- the package slice, for Installed and Updates ------------------------------------------
|
||||
|
||||
/** Raw responses, one field per command, kept so any one can be refreshed on its own. */
|
||||
@@ -312,6 +342,12 @@ const NO_SNAPSHOTS = {
|
||||
diffLoading: 'idle' as LoadState,
|
||||
}
|
||||
|
||||
/** Whether two interpreter paths name the same file as a listing compares them — Windows paths are
|
||||
* case-insensitive (CLAUDE.md, invariant 9), and the app ships for Windows only. */
|
||||
function samePath(a: string, b: string): boolean {
|
||||
return a.toLowerCase() === b.toLowerCase()
|
||||
}
|
||||
|
||||
/** Recompute the joined view from the three raw responses. */
|
||||
function joined(dists: Dist[], outdated: OutdatedDist[], pins: Pin[]) {
|
||||
const { rows, orphanOutdated } = joinRows(dists, outdated, pins)
|
||||
@@ -337,7 +373,10 @@ export const useEnvStore = create<EnvState>((set, get) => ({
|
||||
// expensive thing the app can do twice. `PdEnvironments` has started two on every mount since
|
||||
// Stage 1 — StrictMode runs effects twice in development — which was invisible because both
|
||||
// produce the same rows.
|
||||
if (get().scanning) return
|
||||
// Nor while an *Add interpreter…* or a *Remove from list* is in flight: a scan that read the
|
||||
// list before the change was written would replace `rows` without the added row, or with the
|
||||
// removed one.
|
||||
if (get().scanning || get().addingManual || get().removingManual !== null) return
|
||||
set({ scanning: true, error: null })
|
||||
try {
|
||||
const rows = await envScan()
|
||||
@@ -391,6 +430,74 @@ export const useEnvStore = create<EnvState>((set, get) => ({
|
||||
}
|
||||
},
|
||||
|
||||
addingManual: false,
|
||||
removingManual: null,
|
||||
manualNotice: null,
|
||||
|
||||
addManual: async (title) => {
|
||||
const { addingManual, scanning } = get()
|
||||
if (addingManual || scanning) return
|
||||
set({ addingManual: true, error: null })
|
||||
try {
|
||||
const picked = await pickOpenFile(title, ['exe'])
|
||||
if (picked === null) {
|
||||
set({ addingManual: false })
|
||||
return
|
||||
}
|
||||
const row = await envAddManual(picked)
|
||||
set((state) => {
|
||||
const listed = state.rows.find((r) => samePath(r.interpreter, row.interpreter))
|
||||
// A healthy discovered row keeps its place and its spelling, which is what the next scan
|
||||
// lists. Anything else under this path — an earlier *Add interpreter…*, whose stored text
|
||||
// Rust has just rewritten, or a row broken because its venv was deleted and made again —
|
||||
// gives way to the row Rust returned, or the selection names a row the next scan renames.
|
||||
const keep = listed !== undefined && listed.error === undefined && listed.source !== 'manual'
|
||||
const interpreter = keep ? listed.interpreter : row.interpreter
|
||||
let rows: EnvRow[]
|
||||
if (listed === undefined) rows = [...state.rows, row]
|
||||
else if (keep) rows = state.rows
|
||||
else rows = state.rows.map((r) => (r === listed ? row : r))
|
||||
return {
|
||||
rows,
|
||||
addingManual: false,
|
||||
manualNotice: { kind: 'added', path: interpreter },
|
||||
...(keep && state.selected === interpreter ? {} : { selected: interpreter, ...NO_PACKAGES }),
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
set({ addingManual: false, error: asPdError(e) })
|
||||
}
|
||||
},
|
||||
|
||||
removeManual: async (interpreter) => {
|
||||
const { removingManual, scanning } = get()
|
||||
if (removingManual !== null || scanning) return
|
||||
set({ removingManual: interpreter, error: null })
|
||||
try {
|
||||
await envRemoveManual(interpreter)
|
||||
set((state) => {
|
||||
const gone = state.rows.find((r) => r.interpreter === interpreter)
|
||||
if (gone === undefined) return { removingManual: null }
|
||||
const rows = state.rows.filter((r) => r !== gone)
|
||||
const deselect = state.selected === gone.interpreter
|
||||
return {
|
||||
rows,
|
||||
removingManual: null,
|
||||
manualNotice: { kind: 'removed', path: gone.interpreter },
|
||||
...(deselect
|
||||
? {
|
||||
selected: rows.find((r) => r.env !== undefined)?.interpreter ?? null,
|
||||
...NO_PACKAGES,
|
||||
}
|
||||
: {}),
|
||||
...(state.openFor === gone.interpreter ? { openFor: null, ...NO_SNAPSHOTS } : {}),
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
set({ removingManual: null, error: asPdError(e) })
|
||||
}
|
||||
},
|
||||
|
||||
// Clearing the package slice here is load-bearing: without it, switching environments shows the
|
||||
// previous one's packages under the new one's name. Invisible to any test that loads one env.
|
||||
select: (interpreter) =>
|
||||
|
||||
+5
-1
@@ -48,6 +48,8 @@ export interface IpcMock {
|
||||
onPlanProgress: ReturnType<typeof vi.fn>
|
||||
envScan: ReturnType<typeof vi.fn>
|
||||
envProbe: ReturnType<typeof vi.fn>
|
||||
envAddManual: ReturnType<typeof vi.fn>
|
||||
envRemoveManual: ReturnType<typeof vi.fn>
|
||||
pipUpgrade: ReturnType<typeof vi.fn>
|
||||
healthRun: ReturnType<typeof vi.fn>
|
||||
auditRun: ReturnType<typeof vi.fn>
|
||||
@@ -114,6 +116,8 @@ export function ipcMock(): IpcMock {
|
||||
onPlanProgress: vi.fn().mockResolvedValue(() => undefined),
|
||||
envScan: vi.fn().mockResolvedValue([]),
|
||||
envProbe: vi.fn(),
|
||||
envAddManual: vi.fn(),
|
||||
envRemoveManual: vi.fn().mockResolvedValue(true),
|
||||
pipUpgrade: vi.fn().mockResolvedValue(undefined),
|
||||
healthRun: vi.fn(),
|
||||
auditRun: vi.fn(),
|
||||
@@ -147,7 +151,7 @@ export function ipcMock(): IpcMock {
|
||||
// with itself. A mock of the wrong *shape* is worse than no mock: it makes the seam it covers
|
||||
// look tested.
|
||||
reportBugUrl: vi.fn().mockResolvedValue({
|
||||
url: 'https://github.com/poli0981/pipdock/issues/new',
|
||||
url: 'https://github.com/poli0981org/pipdock/issues/new',
|
||||
log: '[log excerpt]',
|
||||
}),
|
||||
// The one command in the surface that cannot fail — `app_info` is a `const fn` in Rust
|
||||
|
||||
+6
-5
@@ -35,10 +35,11 @@ function devCsp(): Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
// The frontend lives in ui/ per ARCHITECTURE §2, but package.json sits at the repo root so the
|
||||
// ops-repo `reusable-web-react.yml` — which has no working-directory input — can run `npm ci` and
|
||||
// `npm run build` unmodified. Hence root: './ui' with the bundle emitted to the repo-root dist/,
|
||||
// which is that workflow's default dist-dir.
|
||||
// The frontend lives in ui/ per ARCHITECTURE §2, but package.json sits at the repo root — first
|
||||
// because the ops repo's reusable CI workflow had no working-directory input, and since CI went
|
||||
// project-local (2026-11-21) because SonarCloud, Qodana, the scripts and Tauri's configuration all
|
||||
// assume it. Hence root: './ui' with the bundle emitted to the repo-root dist/, which is where
|
||||
// tauri.conf.json's frontendDist looks.
|
||||
export default defineConfig({
|
||||
root: './ui',
|
||||
plugins: [react(), tailwindcss(), devCsp()],
|
||||
@@ -68,7 +69,7 @@ export default defineConfig({
|
||||
include: ['ui/src/**/*.test.{ts,tsx}'],
|
||||
root: fileURLToPath(new URL('.', import.meta.url)),
|
||||
// Off unless asked for (`npm run test:coverage`): sonar.yml imports the LCOV, and nothing
|
||||
// else reads it, so the plain `npm test` the ops-repo reusable runs stays as fast as it was.
|
||||
// else reads it, so the plain `npm test` ci-node.yml runs stays as fast as it was.
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
// `lcovonly`: `lcov` adds an HTML report beside the file Sonar reads.
|
||||
|
||||
Reference in new issue
Block a user