Repository navigation
fix: skip pre-releases so latest works; allow git push and gh pr create/comment in OpenCode - #43
Merged
Merged
Conversation
Add a project-level opencode.json that allows three shell commands for OpenCode sessions in this repository, even where a contributor's global OpenCode config denies them: - git push * - gh pr create * - gh pr comment * OpenCode appends a project's permission rules after the global ones and the last matching rule wins, so these rules override a global deny while every other global rule stays, including a deny on `gh pr merge *`. Project configuration outranks global configuration, so this applies to everyone who uses OpenCode here, including those whose global config denies these commands on purpose.
Rename opencode.json to opencode.jsonc and explain in comments why the file exists, how it combines with a contributor's global config and why `gh pr merge *` is left out. The rules themselves do not change. license-eye exempts `**/*.json` but not `.jsonc`, and fails on a .jsonc file without a header (checked with apache/skywalking-eyes:0.9.0, the image CI and docs/e2e.md use). The file therefore carries the same Apache header as the other source files.
…0.0.0 nodejs.org's index.json has listed the pre-release v27.0.0-alpha.0.0.0 as its newest entry since 2026-10-29. Available listed every entry and sorted by number, so the alpha came first and `vfox install nodejs@latest` resolved to it. PreInstall only takes x.y.z, so the install ended in `version not found for provided version 27.0.0-alpha.0.0.0`. That turned the Linux e2e jobs red, for the latest and the main vfox alike. Available now lists only what util.is_semver_simple accepts, the form PreInstall takes as it is. Of the 878 entries in the index today the alpha is the only one dropped. `nodejs@26` and the other shorthands were not affected. The new hook test feeds Available the first three entries of today's index. docs/changes.md gets an "Unreleased" entry, and versions.md, which said the index holds releases of three numbers and nothing else, and troubleshooting.md carry a remark about release 0.5.3, as do their translations.
…t its checksums npmmirror's v26.13.0 directory has SHASUMS256.txt.asc and .sig but no SHASUMS256.txt, six days after the release, while its index.json lists 26.13.0 and nodejs.org serves all three files. `vfox install nodejs@latest` through that mirror picks 26.13.0, and the plugin ends in `get checksum failed: HTTP 404 from https://npmmirror.com/mirrors/node/v26.13.0/SHASUMS256.txt`. The npmmirror combination only runs on amd64, so it failed the two Linux jobs on ubuntu-latest and the Windows job on windows-latest. The alpha that broke `latest` had hidden it until then. Like the missing ARM64 musl build, this is a gap upstream and no failure of the plugin, so the @latest probe is skipped when the install failed on exactly that 404, the mirror is not nodejs.org, and nodejs.org does serve the same file. Any other failure, and an unclear answer from nodejs.org, still fails. The pinned and LTS releases still install through the mirror. The Windows suite gets the same (version, ok) shape as the Linux one. The WSL job runs with MIRROR=default and is left alone.
This was referenced Nov 3, 2026
Merged
linghengqian
added a commit
that referenced
this pull request
Nov 4, 2026
… LTS line (#47) * docs: list the 0.5.4 changes under the release and drop the "Unreleased" remarks Release 0.5.4 is published, so the pages stop marking its behavior as newer than the last release. This is the procedure of "Releasing" in docs/development.md, in English and Chinese: - changes.md: "Unreleased" becomes "0.5.4 (2026-11-04)", every entry gets its pull request (#43, #45, #44), the sentence about the newest release "at the time of writing" goes, and the User-Agent is `vfox/1.0.13 vfox-nodejs/0.5.4`. - README, README_CN: the paragraph that explains "Unreleased" goes, and the `.nvmrc` paragraph describes one behavior. - lts, nvmrc, scenarios, versions, mirror: the "Unreleased: release 0.5.3 ..." remarks go. The tables that set 0.5.3 against "Unreleased" (nvmrc.md, and two in scenarios.md) keep the one column that is 0.5.4. - troubleshooting, mirror, nvmrc: where a reader of an older plugin looks up a message or a symptom, a short "Before 0.5.4" / "Since 0.5.4" sentence stays (`version not found ... 27.0.0-alpha.0.0.0`, `checksum error` through Huawei Cloud, TUNA, USTC and BFSU, `.nvmrc` not applied after a `cd`). mirror.md no longer names the mirrors that worked before 0.5.4, only the four that failed, which is what was checked. - scenarios.md: the outputs are from "the code that became release 0.5.4" (hooks/ and lib/ of the PR branch equal the release), and the sentence that gave the fresh shell per directory of the Windows e2e suite as a result of the `cd` limit now says only what the suite covers. - source-build.md: the example URL of a released zip is 0.5.4. Checked with vfox 1.0.13 in an isolated HOME, using the published zip (sha256 0e2cbadc...): `vfox info` says 0.5.4. Against the live nodejs.org, `vfox search` lists 877 releases and no pre-release although the index starts with 27.0.0-alpha.0.0.0, and `.lts-cache` holds the 12 lines up to lithium. Against a local mirror whose index starts with a pre-release, `install nodejs@latest` takes the newest release, and the index, SHASUMS256.txt and the download all carry `User-Agent: vfox/1.0.13 vfox-nodejs/0.5.4`; with small stand-in tarballs, the 8-row table of nvmrc.md and the 7-row table of scenarios.md come out as written, and the three .nvmrc encodings select 22.23.4. The links and anchors of all pages resolve. * docs(versions): Node.js 26 is an LTS line since 2026-10-28 "A line that is not in long-term support yet, such as 26 today" stopped being true when 26.13.0 (Lithium) came out on 2026-10-28; the index of nodejs.org shows it with `lts: Lithium`, and it is the newest release, so `latest` is an LTS release now. The sentence is about why `latest` is not "the LTS", and the table above it is from 2026-10-21, when 26 was still the line that was not in long-term support. It says so now, in English and Chinese. This is not caused by release 0.5.4. It is a separate commit so that it can be dropped alone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three changes, in separate commits so that they can be read apart. The pull request began as the OpenCode config. Its E2E jobs then failed for two reasons that come from outside it, and that
mainwould hit as well, so the fixes are here:fix(available):Availableskips pre-releases, so thatlatestis not27.0.0-alpha.0.0.0.test(e2e): the@latestprobe is skipped when a mirror lists the newest release but has noSHASUMS256.txtfor it.chore(opencode), two commits: a project-levelopencode.jsoncthat allowsgit push *,gh pr create *andgh pr comment *for OpenCode sessions in this repository.All 12 checks pass on the last commit, see "Checks" at the end.
The fix:
latestand the pre-releaseSince 2026-10-29 the index of nodejs.org has a pre-release as its newest entry,
v27.0.0-alpha.0.0.0.Availablelisted every entry and sorted them by number, so the alpha came first andvfox install nodejs@latestresolved to it.PreInstallonly takes releases of three numbers:Release 0.5.3 is affected for
latest;nodejs@26and the other shorthands are not.Availablenow lists only whatutil.is_semver_simpleaccepts, the formPreInstalltakes as it is. Of the 878 entries in the index on 2026-11-03 the alpha is the only one dropped, and 0.1.14 to 26.13.0 stay.The docs follow
docs/development.mdfor a change that onlymainhas: an "Unreleased" entry indocs/changes.md, remarks about release 0.5.3 indocs/versions.md(which said that the index holds releases of three numbers and nothing else) and indocs/troubleshooting.md, and the README paragraph that explains the mark, each with its translation.The E2E mirror gap
With the alpha out of the way, three jobs were still red: Linux and Linux musl on
ubuntu-latest, and Windows onwindows-latest. All three failed the same case,TestE2E/latest-https___npmmirror_com_mirrors_node. The mirror combination only runs on amd64, which is why the arm jobs were green, and so was WSL, which runs withMIRROR=default.The
index.jsonof npmmirror is the same as that of nodejs.org and lists 26.13.0, solatestpicks it. But itsv26.13.0directory hasSHASUMS256.txt.ascandSHASUMS256.txt.sigand noSHASUMS256.txt. On 2026-11-03, six days after the release, it was still missing, whilev26.12.1on the mirror andv26.13.0on nodejs.org have all three files. So the plugin is right to say 404: it is a gap of the mirror.The
@latestprobe is skipped, as it already is for a missing ARM64 musl build, when the install failed on exactly that 404, the mirror is not nodejs.org, and nodejs.org serves the same file (common.MirrorLagsBehind). Any other failure, and an unclear answer from nodejs.org, still fails, and the pinned and LTS releases still install through the mirror. The Windows suite gets the same(version, ok)shape as the Linux one.docs/e2e.mdand its translation say so. Once the mirror has the file, the probe runs again.The OpenCode config
Adds a project-level
opencode.jsoncthat allows three shell commands for OpenCode sessions in this repository:git push *gh pr create *gh pr comment *The author's global OpenCode config denies them, which blocks them here too. Nothing else changes:
gh pr merge *and every other global rule still apply. The file is.jsoncso that the rules can be explained in comments.license-eyeexempts**/*.jsonbut not.jsonc, and fails on a.jsoncfile without a header, so the file carries the same Apache header as the other source files.OpenCode appends a project's
permissionsafter the global ones, and the last matching rule wins (permissions). So these three rules override a globaldenyand leave the rest of the global rules in place.Before merging
Project configuration outranks global configuration. Once this is merged, anyone who uses OpenCode in this repository has these three commands allowed here, even if their own global config denies them. If that is unwelcome,
"effect": "ask"keeps a prompt for each use instead; the three rules are all the file contains.How it was checked
With OpenCode 2.2.5,
opencode debug agentsshows the resolved rules of thebuildagent: 17 before and 20 after in the author's setup. The three newallowrules come last, after the globaldenyrules for the same commands, and the other global rules are unchanged. In a session whose global config denies all four commands below:gh pr create --helppermission.rejectedgh pr comment --helppermission.rejectedgit push --dry-run file:///nonexistent-repo HEADpermission.rejectedgh pr merge --helppermission.rejectedpermission.rejectedChecks
CI on the last commit (
bec2e87, E2E run): all 12 checks pass,releaseis skipped.Windows container (windows-11-arm)failed once intests/e2e/windows/run.ps1, whereRemove-ItemofPortableGit.7z.exewas denied during the tool fetch, before any test ran. It passed on a rerun, and this pull request does not touch that script. The log ofwindows-latesthasPASS node v26.13.0 (windows/x64)for@latestand, for the npmmirror combination,SKIP @latest install: mirror https://npmmirror.com/mirrors/node lists 26.13.0 but has no SHASUMS256.txt for it, nodejs.org does.Locally:
Availablethe first three entries of the index, fails onmain(the list starts with27.0.0-alpha.0.0.0) and passes with the fix. StyLua 2.5.2 and LuaLS 3.19.1 (Warning) are clean.v27.0.0-alpha.0.0.0. The hook ofmainlists all 878 and starts with the alpha.VFOX_VERSION=latest MIRROR=default: passes, and@latestinstalls 26.13.0. WithMIRROR=https://npmmirror.com/mirrors/node: passes, with theSKIPline above, and the pinned release still installs through the mirror.gofmt,go vet ./...andgo test -short ./...intests/e2e: clean. Two new unit tests cover each branch ofMirrorLagsBehind.license-eye(apache/skywalking-eyes:0.9.0 header check, the command fromdocs/e2e.md): passes with the header inopencode.jsonc, fails without it.