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 a 'status' field to feature flags denoting their use case #6945

Merged

Conversation

emw-apple
Copy link
Contributor

@emw-apple emw-apple commented Nov 29, 2022

429cc4c

Add a 'status' field to feature flags denoting their use case
https://bugs.webkit.org/show_bug.cgi?id=247926
rdar://92112770

Reviewed by Brent Fulgham.

Add enum types representing different semantic labels for feature flags.
Add status fields to our various feature flag types:

- Cross-platform WebKit: API::ExperimentalFeature.status() and API::InternalDebugFeature.status()
- Cocoa WebKit SPI: -[_WKExperimentalFeature status] and -[_WKInternalDebugFeature status]
- WebKitLegacy: -[WebFeature status]

Update GeneratePreferences.rb to read a "status" field from
WebPreferences yamls, and update its templates to pass this through to
the feature instantiation site.

Currently, individual preferences do not declare their own status;
instead, the generator picks an appropriate status based on which file
the preference is declared in. Eventually, we will merge these files into a
single preferences manifest, and use the status field to determine where
a feature gets exposed.

* Source/WTF/Scripts/GeneratePreferences.rb:
* Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
* Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp:
(API::ExperimentalFeature::create):
(API::ExperimentalFeature::ExperimentalFeature):
* Source/WebKit/UIProcess/API/APIExperimentalFeature.h:
* Source/WebKit/UIProcess/API/APIFeatureStatus.h: Copied from Source/WebKitLegacy/mac/WebView/WebFeatureInternal.h.
* Source/WebKit/UIProcess/API/APIInternalDebugFeature.cpp:
(API::InternalDebugFeature::create):
(API::InternalDebugFeature::InternalDebugFeature):
* Source/WebKit/UIProcess/API/APIInternalDebugFeature.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeature.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
(-[_WKExperimentalFeature status]):
* Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm:
(-[_WKInternalDebugFeature status]):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb:
* Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb:
* Source/WebKitLegacy/mac/WebView/WebFeature.h:
* Source/WebKitLegacy/mac/WebView/WebFeature.m:
(-[WebFeature initWithKey:preferenceKey:name:status:details:defaultValue:hidden:]):
(-[WebFeature initWithKey:preferenceKey:name:details:defaultValue:hidden:]): Deleted.
* Source/WebKitLegacy/mac/WebView/WebFeatureInternal.h:

Canonical link: https://commits.webkit.org/257166@main

5dbe895

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  πŸ§ͺ win
βœ… πŸ›  ios-sim βœ… πŸ›  mac-debug   πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug ❌ πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ webkitpy βœ… πŸ§ͺ api-ios   πŸ§ͺ api-mac   πŸ§ͺ api-gtk
βœ… πŸ›  πŸ§ͺ jsc βœ… πŸ›  tv   πŸ§ͺ mac-wk1 βœ… πŸ›  jsc-armv7
βœ… πŸ›  tv-sim   πŸ§ͺ mac-wk2 βœ… πŸ§ͺ jsc-armv7-tests
❌ πŸ›  πŸ§ͺ merge βœ… πŸ›  watch   πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ›  jsc-mips
βœ… πŸ›  watch-sim βœ… πŸ§ͺ mac-wk2-stress βœ… πŸ§ͺ jsc-mips-tests

Copy link
Contributor

@brentfulgham brentfulgham left a comment

Choose a reason for hiding this comment

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

It looks like there is no new input file yet, so I imagine the new ruby code doesn't run as part of the build. So this seems safe to land without affecting other work.

statuses = ["embedder", "unstable", "internal", "developer", "testable", "preview", "stable"]
options["status"] ||= defaultStatus
if !statuses.include? options["status"]
raise "ERROR: #{options["status"]} not one of the known statuses: #{statuses}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for this logging -- I was worried about typos!

@emw-apple emw-apple added the merge-queue Applied to send a pull request to merge-queue label Nov 30, 2022
https://bugs.webkit.org/show_bug.cgi?id=247926
rdar://92112770

Reviewed by Brent Fulgham.

Add enum types representing different semantic labels for feature flags.
Add status fields to our various feature flag types:

- Cross-platform WebKit: API::ExperimentalFeature.status() and API::InternalDebugFeature.status()
- Cocoa WebKit SPI: -[_WKExperimentalFeature status] and -[_WKInternalDebugFeature status]
- WebKitLegacy: -[WebFeature status]

Update GeneratePreferences.rb to read a "status" field from
WebPreferences yamls, and update its templates to pass this through to
the feature instantiation site.

Currently, individual preferences do not declare their own status;
instead, the generator picks an appropriate status based on which file
the preference is declared in. Eventually, we will merge these files into a
single preferences manifest, and use the status field to determine where
a feature gets exposed.

* Source/WTF/Scripts/GeneratePreferences.rb:
* Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
* Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp:
(API::ExperimentalFeature::create):
(API::ExperimentalFeature::ExperimentalFeature):
* Source/WebKit/UIProcess/API/APIExperimentalFeature.h:
* Source/WebKit/UIProcess/API/APIFeatureStatus.h: Copied from Source/WebKitLegacy/mac/WebView/WebFeatureInternal.h.
* Source/WebKit/UIProcess/API/APIInternalDebugFeature.cpp:
(API::InternalDebugFeature::create):
(API::InternalDebugFeature::InternalDebugFeature):
* Source/WebKit/UIProcess/API/APIInternalDebugFeature.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeature.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
(-[_WKExperimentalFeature status]):
* Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm:
(-[_WKInternalDebugFeature status]):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb:
* Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb:
* Source/WebKitLegacy/mac/WebView/WebFeature.h:
* Source/WebKitLegacy/mac/WebView/WebFeature.m:
(-[WebFeature initWithKey:preferenceKey:name:status:details:defaultValue:hidden:]):
(-[WebFeature initWithKey:preferenceKey:name:details:defaultValue:hidden:]): Deleted.
* Source/WebKitLegacy/mac/WebView/WebFeatureInternal.h:

Canonical link: https://commits.webkit.org/257166@main
@webkit-commit-queue
Copy link
Collaborator

Committed 257166@main (429cc4c): https://commits.webkit.org/257166@main

Reviewed commits have been landed. Closing PR #6945 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit 429cc4c into WebKit:main Nov 30, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants