Derive the env-var scrub lists from clap's bindings; SOCKET_NO_SOCKET_YML is missing from LOCAL_ARG_ENV_VARS
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
Start with the env-var lists and clap argument definitions in crates/socket-patch-cli/src/args.rs, then trace their consumers in tests/common/hermetic.rs and the cli_parse_* test helpers. Build the binding walk from crate::cli_command() and check how subcommand args expose env and global settings. Done means every env binding is scrubbed, parse tests pass, and the socket.yml policy test passes with SOCKET_NO_SOCKET_YML=1 set.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor. Register ID: T03.
Problem
GLOBAL_ARG_ENV_VARS and LOCAL_ARG_ENV_VARS (args.rs L711-L761) are hand-kept copies of the env = "..." attributes on the clap structs. Three things read them:
scrub_empty_env_vars;- the hermetic test child builder (tests/common/hermetic.rs L95-L99);
with_clean_socket_env.
They have drifted. scan --no-socket-yml binds SOCKET_NO_SOCKET_YML (scan/socket_yml_args.rs L17),`` but neither list names it. So a developer's ambient SOCKET_NO_SOCKET_YML=1 reaches every "hermetic" test child and silently disables socket.yml policy in `e2e_socket_yml_policy`.
The doc above the list (L739-L744) claims that "the invariant tests below parse every entry against its owning subcommand to keep this honest". But those tests iterate their own hand lists, BOOL_BINDINGS and VALUE_BINDINGS (args.rs L1697 and L1786), and global_arg_env_vars_includes_vendor_knobs (L1207) only checks that the const contains strings typed into it. More hand copies exist in tests/cli_parse_scan.rs (SCAN_ENV_VARS, L40-L55) and the other cli_parse_* files.
Proposed change
- Replace both consts with one function that walks
crate::cli_command()and every subcommand's args, collectingArg::get_env(). The global/local split, if still needed, comes fromArg::is_global_set(). - Point the hermetic builder,
with_clean_socket_envandscrub_empty_env_varsat it. - Delete the tautological
global_arg_env_vars_includes_vendor_knobs. - Generate
BOOL_BINDINGSfrom the same walk, filtered on theparse_bool_flagvalue parser or kept as an explicit list asserted equal to the walk.
Size
args.rs, tests/common/hermetic.rs and the cli_parse_* helpers. About −80 / +30 lines.
Acceptance criteria
- A new test asserts that every
envbinding incli_command()is scrubbed. It fails on today'smainbecauseSOCKET_NO_SOCKET_YMLis missing. - The existing parse tests stay green.
- With
SOCKET_NO_SOCKET_YML=1set in the outer environment,cargo test -p socket-patch-cli --test e2e_socket_yml_policystays green.
- Linguagem predominante
- Rust
- Estrelas
- 9
- Forks
- 2
- Merge médio
- 1d 8h
- PRs com merge (30d)
- 309
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de SocketDev/socket-patch
-
Windows unit tests fail on main: pnpm-registry-overrides fixtures are checked out as CRLF (mixes CRLF and LF line endings)Talvez já em andamento @mikolalysenko assumiu hoje. Abertaagent:claimed agent:triaged ci-janitor priority:p1
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
SocketDev/socket-patch#2238 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
agent:triaged arch-audit priority:p3 refactor
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
SocketDev/socket-patch#1860 ·
Mantenedores costumam responder em até 1 dia
-
agent:triaged arch-audit priority:p3 refactor
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
SocketDev/socket-patch#1838 ·
Mantenedores costumam responder em até 1 dia
-
Nightly: pnpm11_registry_route_is_cleaned_up_when_a_patch_is_not_needed fails on Windows (pnpm records the RUNNER~1 short path as a second importer)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaagent:triaged ci-janitor priority:p1
Dificuldade 3/5 Meio dia Facilidade para iniciantes 42/100
SocketDev/socket-patch#2235 ·
Mantenedores costumam responder em até 1 dia
-
Agent mode reports a gem whose installed file was edited as "not installed on this host" / "not found on disk", `apply --check` says to run `apply`, and `rollback` exits 1 with "modified after patching" on every runTalvez já em andamento @mikolalysenko assumiu hoje. Abertaagent:claimed agent:triaged bug bughunt pm:bundler priority:p1 ux
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 18/100
SocketDev/socket-patch#2231 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de SocketDev/socket-patch
Issues semelhantes
-
area: cli good first issue type: feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
renaming a provider to a taken name fails with a raw sql errorTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaarea:storage kind:bug priority:p3 ready
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
bug bugfix
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
storytold/photocraft#16975 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
expo/exact#1716 · 1 comentário ·
Mantenedores costumam responder em até 1 dia