-
Notifications
You must be signed in to change notification settings - Fork 37
Flatten views structure: reduce space complexity by 2 dimensions #8258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
40db66d
Flatten views structure
seanbudd 4c81e60
addonstore-views repo creation
seanbudd fb3268d
fix up translations
seanbudd 2295633
Pre-commit auto-fix
pre-commit-ci[bot] 4ba3231
fix up folder cleanup
seanbudd 77ed6ea
suppress noisy logging
seanbudd 6281155
use token with perms
seanbudd 3991e50
rename token
seanbudd f7dc08e
fix encoding
seanbudd 3caec9c
fix expected addons
seanbudd 8f5b4b4
Apply suggestions from code review
seanbudd f3e4e6a
build with ubuntu
seanbudd 2bcb8ca
rename testCode
seanbudd 945b4ef
update python version
seanbudd f55b2ed
update python version
seanbudd dd40b1b
broaden envs
seanbudd cdfe024
convert to batch
seanbudd 83849d1
broaden envs
seanbudd aae3b24
install lxml
seanbudd 1d74bff
Update transform/docs/output.md
seanbudd 5166326
smaller logs
seanbudd 9d8a912
smaller logs
seanbudd cc3441a
fix docs
seanbudd 8013bf4
other fixups
seanbudd 5a35b09
Pre-commit auto-fix
pre-commit-ci[bot] a174e8c
Pre-commit auto-fix
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| cpython-3.13-windows-x86_64-none | ||
| cpython-3.13 |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,55 @@ | ||
| # Output | ||
|
|
||
| The output for running the transformation is described as follows. | ||
| This is written to a given directory, and removes existing json data from the directory in the process. | ||
| This is written to a given directory that must be new/empty; the transformation creates this directory and fails if it already exists. | ||
| Callers are responsible for deleting any previous output directory before running the transformation. | ||
|
|
||
| ## Output file structure | ||
|
|
||
| The following subdirectories and files are created: | ||
| - `/NVDA API Version/addon-1-ID/stable.json` | ||
| - `/NVDA API Version/addon-1-ID/beta.json` | ||
| - `/NVDA API Version/addon-2-ID/stable.json` | ||
| eg: `/2020.3.0/nvdaOCR/stable.json` | ||
|
|
||
| Translated add-on files: | ||
|
|
||
| - `/addons/addon-1-ID/<addonVersion>/en.json` | ||
| - `/addons/addon-1-ID/<addonVersion>/ar.json` (when a translation exists) | ||
| - `/addons/addon-2-ID/<addonVersion>/en.json` | ||
|
|
||
| Symlink end views which point to translated files: | ||
|
|
||
| - `/views/en/<NvdaAPIVersion>/addon-1-ID/stable.json` | ||
| - `/views/en/<NvdaAPIVersion>/addon-1-ID/beta.json` | ||
| - `/views/en/<NvdaAPIVersion>/addon-2-ID/stable.json` | ||
| - `/views/ar/<NvdaAPIVersion>addon-1-ID/stable.json` | ||
|
SaschaCowley marked this conversation as resolved.
|
||
|
|
||
| Examples: | ||
|
|
||
| - `/addons/nvdaOCR/1.3.5/en.json` | ||
| - `/views/en/2020.3.0/nvdaOCR/stable.json` | ||
|
|
||
| Where `NVDA API Version` may be: | ||
|
|
||
| - `2022.1.0`: A major release. | ||
| - `2022.1.3`: A patch release. | ||
|
|
||
| The system differentiates patch releases from major releases to cater to the (very unlikely) event of requireing a breaking change or introduction to the NVDA add-on API. | ||
| The system differentiates patch releases from major releases to cater to the (very unlikely) event of requiring a breaking change or introduction to the NVDA add-on API. | ||
|
|
||
| ## Output file data | ||
| Each addon file is the addon data taken from input that is the latest compatible version, with the given requirements `(NVDA API Version, addon-ID, stable|beta|dev)`. | ||
| The transformed data file content will be the same as the input. | ||
| The contents for each addon file includes all the technical details required for NVDA to download, verify file integrity, and install. | ||
|
|
||
| Add-on files in `/addons` contain transformed add-on metadata by add-on version and language. | ||
| Views in `/views` are relative symlinks to files in `/addons`. | ||
|
|
||
| For each required view `(language, NVDA API Version, addon-ID, channel)`, the view symlink points at a single file: | ||
|
|
||
| - Prefer exact language translation | ||
| - Otherwise prefer language without locale (`pt_BR` -> `pt`) | ||
| - Otherwise fallback to `en` | ||
|
|
||
| Each transformed add-on file includes all technical details required for NVDA to download, verify file integrity, and install. | ||
| It also contains the information necessary for a store entry. | ||
| Later, translated versions will become available. | ||
|
|
||
| ## Output notes | ||
|
|
||
| This structure simplifies the processing on the hosting (e.g. NV Access) server. | ||
| To fetch the latest add-ons for `<NVDA API Version X>`, the server can concatenate the appropriate JSON files that match a glob: `/<NVDA API Version X>/*/stable.json`. | ||
| Similarly, to fetch the latest version of an add-on with `<Addon-ID>` for `<NVDA API Version X>`. The server can return the data at `/<NVDA API Version X>/<addon-ID>/stable.json`. | ||
| To fetch the latest add-ons for `<NVDA API Version X>`, the server can concatenate the appropriate JSON files that match a glob: `/views/<lang>/<NVDA API Version X>/*/stable.json`. | ||
| Similarly, to fetch the latest version of an add-on with `<Addon-ID>` for `<NVDA API Version X>`, the server can return the data at `/views/<lang>/<NVDA API Version X>/<addon-ID>/stable.json`. | ||
| Using the NV Access server as the endpoint for this is important in case the implementation has to change or be migrated away from GitHub for some reason. | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.