← Back to issue list

providers: match build provider flag keys to envvar

View original Github issue

Metadata

Project
snapcraft
Number
#2970
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged in #2970 via commit d1e8dd264, aligning build-provider flag keys with environment-variable names and removing kwarg translation.

Resolution: closed resolved

Reason: PR #2970 was merged in commit d1e8dd264. It updated provider handling to use http_proxy, https_proxy, and SNAPCRAFT_BIND_SSH directly, resolving the consistency issue described.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Currently the approach translates them to a formatted version of the kwarg used to pass around to functions. Instead of performing that translation, just match the envvar used. cmd arg -> kwarg parameter -> environment variable -------------------------------------- --http-proxy -> http_proxy -> http_proxy --https-proxy -> https_proxy -> https_proxy --bind-ssh -> bind_ssh -> SNAPCRAFT_BIND_SSH Since apply_host_provider_flags() sets the flags in the environment for all build provider options, internal functions can lookup settings using os.getenv() without the kwarg translation. They can simply used the defined interface name (e.g. http_proxy, SNAPCRAFT_BIND_SSH). This will improve consistency as their use is expanded for future options. The kwarg version should remain an internal detail of click usage. This wasn't really an issue with the original implementation because "http(s)_proxy" matched the environment variable and bind_ssh (SNAPCRAFT_BIND_SSH) was not passed through to the target environment. Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged in #2970 via commit d1e8dd264, aligning build-provider flag keys with environment-variable names and removing kwarg translation.
stealth/space-bunny-alpha — closed resolved Merged PR #2970 (commit d1e8dd264, approved) renamed build provider flag keys to match their environment variables, dropping kwarg translation so code uses http_proxy, https_proxy and SNAPCRAFT_BIND_SSH directly.
stealth/space-bunny-alpha — closed resolved Merged PR #2970 (commit d1e8dd264) aligned build-provider flag keys with environment-variable names, removing kwarg translation and using http_proxy, https_proxy, and SNAPCRAFT_BIND_SHI directly.
qwen/qwen3.6-35b-a3b — — Merged PR aligns build provider flag keys with environment variable names, removing kwarg translation. Internal functions now use os.getenv() for consistency. Approved, passed CI, and merged with minor changes across three files.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Build provider CLI flag keys now directly match environment variable names instead of being translated to kwargs. This simplifies internal os.getenv() lookups and improves consistency for future options.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.