rdk: Replace hardcoded blocked_flags with generic flag deduplication in deploy_rdk#11531
Open
niranjanyardi wants to merge 1 commit into
Open
rdk: Replace hardcoded blocked_flags with generic flag deduplication in deploy_rdk#11531niranjanyardi wants to merge 1 commit into
niranjanyardi wants to merge 1 commit into
Conversation
Contributor
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
niranjanyardi
force-pushed
the
generic_flag_dedup_deploy_rdk
branch
2 times, most recently
from
July 24, 2026 02:38
c4c2666 to
c5ebd0e
Compare
niranjanyardi
marked this pull request as ready for review
July 24, 2026 02:55
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the command-line argument handling in deploy_rdk.py to dynamically filter out existing arguments in sb_args that are overridden by new_args, replacing a hardcoded list of blocked flags. The review feedback points out two potential issues with the standard double-dash ("--") separator: first, "--" should be excluded from the override keys to prevent it from being filtered out, and second, new arguments should be inserted before the "--" separator rather than appended to the end, ensuring they are not incorrectly treated as positional arguments.
niranjanyardi
force-pushed
the
generic_flag_dedup_deploy_rdk
branch
from
July 24, 2026 03:02
c5ebd0e to
51d5bcf
Compare
…in deploy_rdk
Instead of maintaining a hardcoded blacklisted set (blocked_flags) of CLI
switches for every new parameter passed to --param or --devtools,
dynamically extract option keys from new parameters (arg.split("=", 1)[0])
and remove any pre-existing matching flags from sbmainargs.
This avoids having to expand a hardcoded flag whitelist whenever new
runtime arguments (such as heap profiling, tracing, or debugging options)
are introduced.
Bug: 502702565
TAG=agy
CONV=073fedec-c1e0-47a6-bc41-c69a0d7df7ab
niranjanyardi
force-pushed
the
generic_flag_dedup_deploy_rdk
branch
from
July 24, 2026 03:09
51d5bcf to
fe7b57d
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces the hardcoded
blocked_flagsset indeploy_rdk.pywith generic key-based CLI switch deduplication.When launching Cobalt on device as a WPEFramework plugin, existing
sbmainargsare retrieved via JSON-RPC. If--devtoolsor new arguments via--param(e.g.--enable-heap-profiling,--memlog=all,--trace-startup=...) are passed, appending them directly tosbmainargscan result in duplicate switches and startup parsing failures.Rather than maintaining a hardcoded blacklisted set of switch names (
blocked_flags) that must be expanded manually whenever new flags are used, this change dynamically extracts all flag keys (arg.split("=", 1)[0]) from the parameters being added and strips any pre-existing matching flags fromsb_argsprior to extending.Motivation & Architecture
deploy_rdk.pywhenever someone wants to pass--v=1,--fps,--user-agent, or future profiling/tracing parameters.--): Usesarg.startswith("--")to safely match Chromium/Cobalt double-dash switches without risking collision with negative positional arguments or non-flag parameters.Verification
--remote-debugging-portand--paramflags.origin/main.Bug: 502702565
TAG=agy
CONV=073fedec-c1e0-47a6-bc41-c69a0d7df7ab