Skip to content

Flatten views structure: reduce space complexity by 2 dimensions#8258

Merged
seanbudd merged 26 commits intomasterfrom
flattenViews
Apr 19, 2026
Merged

Flatten views structure: reduce space complexity by 2 dimensions#8258
seanbudd merged 26 commits intomasterfrom
flattenViews

Conversation

@seanbudd
Copy link
Copy Markdown
Member

@seanbudd seanbudd commented Apr 2, 2026

Part of #7585
Closes #5903

Structure change

The current add-on views structure is too wide. It has storage complexity of O(numAddonFiles * numLanguages * numNVDAAPIVersions * numChannels). This should just be O(numAddonFiles).

This PR reduces the structure to O(numAddonFiles * numLanguages).

The current file structure for add-on views is:

views/en/2019.1.0/UIANotificationSwitch/stable.json

Generated from files committed to this branch as:

addons/AbsoluteYoutube/2026.2.0.json

File paths in the current views structure now serve as symlinks which point to files like addons/UIANotificationSwitch/2026.1/en.json which is generated from the translations in addons/AbsoluteYoutube/2026.2.0.json

Improvements

Size

The new views size is 264 MB, the old views size was 13GB.

Checked with: (Get-ChildItem . -Recurse -Force -File | Measure-Object Length -Sum).Sum).

Transform step speed

The old transform step took about 1.5-2h.
The new transform step takes about 10-15min.

Testing

nvaccess/addonstore-views#1

Planned future changes

With further work to addonstore-api we could reduce the complexity to O(numAddonFiles).
This would require the server to create translated versions of each add-on file when reading the add-on files.
This might not be worthwhile, as it would require the server to buffer add-on files into python memory.

CoPilot detailed summary

This pull request makes significant improvements to how add-on metadata is transformed and output for the NVDA Add-on Store. The main change is a redesign of the output structure: add-on data is now separated into versioned, language-specific files in an addons directory, while the views directory contains symlinks (not copies) to these files, organized by language and NVDA API version. This reduces data duplication and improves clarity. The GitHub workflow is also updated to push changes to a separate repository and automate pull request creation and merging. Documentation and tests are updated to match the new structure.

Output structure and transformation logic:

  • The transformation process now writes add-on metadata files to addons/{addonId}/{addonVersion}/{language}.json and creates symlinks in views/{language}/{nvdaAPIVersion}/{addonId}/{channel}.json pointing to the correct add-on file, preferring exact language match, then base language, then English as fallback.
  • The transformation logic ensures that all translations are written, and symlinks are created for all supported languages, reducing data duplication and improving language support.
  • The transform action now must run in ubuntu for symlinks to be consistent with the server

Workflow automation and repository integration:

  • The GitHub Actions workflow now checks out the addonstore-views repository, generates the new output structure, copies the generated data, and creates a pull request with auto-merge enabled, instead of pushing directly. This improves automation and separation of data and view hosting.

Documentation updates:

  • All documentation (README.md, transform/README.md, docs/design/designOverview.md, transform/docs/output.md) is updated to describe the new output structure, clarify the role of the repository, and explain how views and add-on files are organized and accessed.

Testing improvements:

  • Tests are updated to check for the new output structure, including the presence and correctness of symlinks for views, and the correct handling of translations and language fallbacks.

Code quality and logging:

  • Logging in the transformation process is improved by reducing log level from error to debug for routine operations.

@seanbudd seanbudd changed the title Flatten views structure Flatten views structure: remove NVDA API versions as a dimension Apr 2, 2026
@seanbudd seanbudd changed the title Flatten views structure: remove NVDA API versions as a dimension Flatten views structure: reduce space complexity by 2 dimensions Apr 2, 2026
@seanbudd seanbudd marked this pull request as ready for review April 2, 2026 05:21
Copilot AI review requested due to automatic review settings April 2, 2026 05:21
@seanbudd seanbudd marked this pull request as draft April 2, 2026 05:22
@seanbudd seanbudd self-assigned this Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Redesigns the transformed add-on metadata output to reduce storage duplication by writing versioned/language-specific add-on files once and projecting “views” via symlinks.

Changes:

  • Transform now writes /addons/{addonId}/{addonVersion}/{lang}.json and creates versioned + latest view symlinks under /views/{lang}/....
  • GitHub Actions workflow now checks out nvaccess/addonstore-views, generates output, and opens an auto-merge PR instead of pushing directly.
  • Tests and documentation updated to validate/describe the new output layout (including symlink expectations).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
transform/src/transform/transform.py Generates per-language add-on files and creates relative symlinked view projections.
transform/src/tests/test_viewsGenerationSystem.py Updates expected output paths and asserts view files are symlinks to the correct translated add-on files.
transform/src/tests/test_datastructures.py Updates docstring example path to match new views layout.
transform/README.md Updates high-level description to reflect new “add-ons + views” output model.
transform/docs/output.md Documents the new output structure and how language fallback for symlink targets works.
README.md Updates repository purpose statement to reflect new hosting/publishing approach.
docs/design/designOverview.md Updates design overview to describe the new generated data layout and repo flow.
.github/workflows/transformDataToViews.yml Switches from pushing a branch to generating data into addonstore-views and creating an auto-merged PR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread transform/src/transform/transform.py
Comment thread .github/workflows/transformDataToViews.yml
Comment thread transform/docs/output.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sean Budd <seanbudd123@gmail.com>
@seanbudd seanbudd requested a review from SaschaCowley April 2, 2026 05:30
Comment thread transform/docs/output.md Outdated
Signed-off-by: Sean Budd <seanbudd123@gmail.com>
@seanbudd seanbudd marked this pull request as ready for review April 2, 2026 06:53
Comment thread docs/design/designOverview.md Outdated
Comment thread docs/design/designOverview.md Outdated
Comment thread docs/design/designOverview.md Outdated
Comment thread docs/design/designOverview.md Outdated
Comment thread docs/design/designOverview.md Outdated
Comment thread transform/docs/output.md Outdated
Comment thread transform/docs/output.md Outdated
Comment thread transform/src/tests/test_viewsGenerationSystem.py
Comment thread transform/src/transform/transform.py Outdated
Comment thread transform/src/transform/transform.py Outdated
@seanbudd seanbudd marked this pull request as draft April 8, 2026 05:18
@seanbudd seanbudd requested a review from SaschaCowley April 8, 2026 05:30
@seanbudd
Copy link
Copy Markdown
Member Author

seanbudd commented Apr 8, 2026

pre-commit.ci run

@seanbudd seanbudd marked this pull request as ready for review April 8, 2026 05:31
Comment thread transform/docs/output.md
Comment thread transform/docs/output.md
@seanbudd seanbudd merged commit eb836c0 into master Apr 19, 2026
4 checks passed
@seanbudd seanbudd deleted the flattenViews branch April 19, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change views branch to a more compressed structure

3 participants