Skip to content

Describe plugins with profile files that need no release - #82

Closed
linghengqian wants to merge 2 commits into
refactor/usage-experiencefrom
refactor/plugin-profiles
Closed

linghengqian wants to merge 2 commits into
refactor/usage-experiencefrom
refactor/plugin-profiles

Conversation

@linghengqian

Copy link
Copy Markdown
Member

The second step of the rework, stacked on #79. What vfox+ knows about particular plugins is now data instead of Go code, so adapting a plugin, or a new release of one, needs no release of the application.

What changes

  • Profile files. The profiles of the 20 plugins are JSON files in shared/profile/plugins, with a JSON Schema. Format 2 adds parts for some platforms (when), version names read by regular expressions instead of two hard-coded namings, filters that match a pattern, and toggle and text variables. docs/en/dev/profiles.md describes it.
  • Sources. Each section of a profile comes from the first of: the user's profiles/<plugin>.json; the plugin's own lib/vfox-plus.json (vfox packs lib, so it arrives with the plugin and works offline); the online directory (shared/profile on this repository's main: fetched at most once a day, through the update mirror, only the files that differ, each checked by SHA-256); the files the application ships; and inference. The unused FetchProfile and the root vfox-plus.json, which no packaged plugin could carry, are gone.
  • Safety. A profile is only data. It may not offer variables that change what runs (PATH, HOME, LD_*, NODE_OPTIONS, compilers, proxies, tokens, …); documentation links and preset addresses are https://; and a value that the application did not ship is shown and confirmed before it is set, on the desktop, the web interface and the phone app.
  • Interfaces. Switches for toggle variables, a text field for text ones; "Detect and link" is hidden for a plugin whose files show it has no Detect hook.
  • Tooling. vfxtool profile lint (with --plugin for the profile of a plugin, and a reusable workflow, profile-lint.yml, for plugin repositories) and vfxtool profile index.
  • Fixed on the way. A setting inferred from a plugin that is not an address could not be set at all; the filters inferred for a plugin whose profile declares none did not filter.

Compatibility

  • The web API drops profile.naming, which no client used, and adds capabilities, unvetted, on and off. Older phone apps keep working; a newer one takes a missing capabilities as able to detect.
  • Files of the user in the first shape still load. A section that format 2 does not read (a naming string, a search without a default) comes from the next source instead.
  • The application now requests shared/profile/index.json from main at most once a day, as it already asks GitHub for its latest release at startup. Until this lands, main has no such file, and the request fails without effect. The end-to-end build does not use the network for it.

Verification

  • Before the Go profiles were deleted, a temporary test compared all 20 on nine platforms with their JSON files, and the reading of thousands of version names: identical.
  • All 20 pass vfxtool profile lint against the main branch of their plugin, and validate against the schema.
  • go vet, go test -race with the coverage gate (core and state 87 %, ui 86 %), the census of the screens, golangci-lint 2.15.0 (default and e2e tags), the tests and Windows vet of shared/tooling, and the type check, tests and build of the web interface.
  • End to end under Xvfb: fake, real (vfox 1.1.0), python, plugins and tray.
  • vfxtool docs-check, markdownlint and actionlint.

Not verified yet

  • Windows was only cross-compiled here, and macOS not at all: CI covers their tests and census.
  • The online directory against GitHub itself, and the reusable workflow from a plugin repository: both need this on main.
  • The phone app was seen in the screen tests only, not on a device.

What the application knows about particular plugins was Go code, so adapting a
plugin, or a new release of one, needed a release of the application. The
profiles of the 20 plugins are now JSON files (shared/profile/plugins, with a
schema), whose format 2 adds parts for some platforms, version names read by
regular expressions, filters that match a pattern, and switch and text
variables.

For an installed plugin, each section of a profile comes from the first of the
user's files, the profile that the plugin ships as lib/vfox-plus.json, the online
directory (this repository's main, at most once a day, checked by SHA-256), the
files of the application, and inference. A profile may not set variables that
change what runs, its links and preset addresses are https only, and the
interfaces ask before they set a value that the application did not ship. Detect
and link is offered only for plugins that can detect.

vfxtool profile lints profiles, for plugin repositories through a reusable
workflow too, and indexes the online directory. A setting inferred from a plugin
that takes text can be set now, and the filters inferred for a profile that
declares none filter the list.
The format of the profile files, where they come from and what they may not do,
in English and Simplified Chinese, with the changes of the web API, the
interface specification and the user guide.
@github-actions

Copy link
Copy Markdown

Memory use at edfe0e6

  • No change from main beyond the noise of CI in mygo.
Implementation Technology Processes Home PSS Home RSS Versions PSS Versions RSS The list adds (PSS)
mygo mygo 0.9.0, Go 1.27.4, GTK 3 (purego), CPU renderer 1 50 (+2) 63 54 (+2) 69 +4

In MB, for the application and all of its child processes, sorted by the PSS of the Home page; "Versions" is the SDKs page with the available versions of Node.js listed. A number in parentheses is the difference from main, in bold when it is more than the noise of CI. "(main)" marks an implementation that this pull request did not rebuild: its numbers are those of main.

Lightweight mode

What the application uses with the web interface on and its window closed, with the fake vfox, in MB for the application and all of its child processes: lightweight-idle is settled with no browser, lightweight-loaded with a paired browser past its first inventory over server-sent events (vfxtool measure-lightweight). A change is judged by the private memory, the heap and the stacks, and only by a difference of more than the larger of 2 MB and 5 % of main. The resident and the proportional memory include the pages of files that the system takes back, so they are shown without a judgement.

Measure This pull request Main
Idle RSS 49 MB (+1) 48 MB
Idle PSS 36 MB (+1) 35 MB
Idle private memory 14.4 MB (+0.4) 14.0 MB
Loaded RSS 51 MB (+1) 50 MB
Loaded PSS 38 MB (+1) 37 MB
Loaded private memory 14.6 MB (+0.4) 14.2 MB

Phone app

What the release APK uses cold-started on an emulator, in MB from dumpsys meminfo after settling: apk-cold. Emulator boots vary, so only differences of more than 5 MB and 10% count as changes.

Measure This pull request Main
Cold RSS 169 MB (+27) 142 MB
Cold PSS 46 MB (-2) 48 MB
Details
  • Measured by vfxtool measure in the workflow of the implementation, on a GitHub-hosted runner with Xvfb and no GPU. These are not the numbers of docs/en/dev/memory.md, which come from another machine: compare the rows of one comment.
  • The same code does not use the same memory in every CI run, so a difference counts as a change only when it is more than 5 MB and more than 5% of the number on main.
  • Runs of this pull request: mygo.
  • Latest runs on main: mygo (29ebaf0).

@linghengqian linghengqian added the invalid This doesn't seem right label Nov 28, 2026
@linghengqian

Copy link
Copy Markdown
Member Author

Folded into #79: the whole rework goes into that pull request, not into a stack of them. Its branch gets the two commits of this one, 3ea03f4 and edfe0e6, unchanged.

@linghengqian
linghengqian deleted the refactor/plugin-profiles branch November 28, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant