Skip to content
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

Add platform version field to manifest #2803

Merged
merged 11 commits into from
Oct 22, 2024
Merged

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Oct 7, 2024

This adds a new field to the manifest, platformVersion. It is intended to be set to the current version of the Snaps SDK, and if set, is checked by the Snap controller to make sure the current supported version by the Snaps Platform is equal or newer than the specified platformVersion.

I've added a feature flag rejectInvalidPlatformVersion which, when enabled, will throw an error upon installation if specified platform version is too new. Otherwise it simply logs a warning in the console.

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.46%. Comparing base (dd08ed6) to head (3296c2b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2803      +/-   ##
==========================================
+ Coverage   94.45%   94.46%   +0.01%     
==========================================
  Files         484      486       +2     
  Lines       10329    10358      +29     
  Branches     1574     1579       +5     
==========================================
+ Hits         9756     9785      +29     
  Misses        573      573              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Mrtenz Mrtenz marked this pull request as ready for review October 7, 2024 16:10
@Mrtenz Mrtenz requested a review from a team as a code owner October 7, 2024 16:10
@Mrtenz Mrtenz force-pushed the mrtenz/platform-version-field branch from 76650bb to 8fa16bb Compare October 7, 2024 16:10
return;
}

if (semver.gt(manifest.platformVersion, getPlatformVersion())) {
Copy link
Member

Choose a reason for hiding this comment

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

Patch versions are probably fine and may not need to reject, WDYT? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Technically we can't guarantee that it'll work on a newer patch version, I think, so to be safe, I decided to reject any newer versions.

@Mrtenz Mrtenz force-pushed the mrtenz/platform-version-field branch from b5a6500 to fe59029 Compare October 22, 2024 10:50
@Mrtenz Mrtenz merged commit bbc33e9 into main Oct 22, 2024
166 checks passed
@Mrtenz Mrtenz deleted the mrtenz/platform-version-field branch October 22, 2024 14:04
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.

2 participants