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

feat: Imported Firefox 134 and Firefox 135 schema data #5551

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

rpl
Copy link
Member

@rpl rpl commented Jan 20, 2025

The updated schema data includes the following changes

Firefox 134:

Firefox 135:

In addition to that this PR also includes:

  • a temporary workaround on the addons-linter src/schema/updates/manifest.json side to prevent the empty enum currently part of the OptionalOnlyPermission schema data as imported from Firefox from triggering errors originated from ajv (which consider an empty array associated to an enum as invalid schema data) - see b417050
  • new tests to explicitly cover the behaviors expected on optional only permissions (when invalid due to being requested as non-optional and when valid due to being requested as optional)
    • File followup to consider adding a new error code to be associated specifically to the error to be reported when an optional only permission is being requested as non-optional and a better error message providing a link to docs describing how developers are expected to use optional only permissions in their extensions (tracked by Consider introducing a new error code for optional-only permissions #5554)

Fixes #5550

src/schema/updates/manifest.json Show resolved Hide resolved
Comment on lines +1395 to +1405
expect(manifestJSONParser.collector.warnings).toEqual(
expect.arrayContaining([
expect.objectContaining({
code: 'MANIFEST_PERMISSIONS',
instancePath: '/permissions/1',
message: expect.stringMatching(
new RegExp(`Invalid permissions "${permName}"`)
),
}),
])
);
Copy link
Member Author

Choose a reason for hiding this comment

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

note: @willdurand this is currently covering the behavior expected at the moment without a more specific error code, I'd be leaning towards filing a separate followup to consider introducing a separate error code and a better error message linking a doc page with more precise guidance about how optional only permissions should be used by extensions developers.

@rpl rpl requested a review from willdurand January 20, 2025 18:16
@Rob--W
Copy link
Member

Rob--W commented Jan 20, 2025

File bugzilla issue to remove the empty enum array from the API schema data imported from Firefox

The type is defined there because we need to define the type at the manifest schema level, for it to be extensible by others. We cannot just remove it. That means that if an empty enum is really disallowed, that we need to think of alternatives.

@rpl rpl merged commit 991a349 into master Jan 21, 2025
4 checks passed
@rpl rpl deleted the feat/api-schema-import-fx134-fx135 branch January 21, 2025 14:20
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.

Import Firefox 134 and Firefox 135 schema
3 participants