Skip to content

fix(proxy): proxy env setup#213

Open
yanksyoon wants to merge 21 commits intomainfrom
fix/setup-proxy-env
Open

fix(proxy): proxy env setup#213
yanksyoon wants to merge 21 commits intomainfrom
fix/setup-proxy-env

Conversation

@yanksyoon
Copy link
Copy Markdown
Member

Applicable spec:

Overview

Fix image-relation-joined event hook by setting up proxy

Rationale

Proxy is required to connect to OpenStack

Juju Events Changes

Module Changes

Library Changes

Checklist

Comment thread app/pyproject.toml Outdated
yanksyoon and others added 19 commits April 13, 2026 05:34
… error

The typeshed stubs for logging.basicConfig don't include the encoding
parameter in the handlers overload. The encoding is already set on the
WatchedFileHandler itself (line 22), so passing it again to basicConfig
is redundant and causes a mypy call-overload error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The PR added _setup_proxy_environment() in _on_image_relation_joined.
The test was using a plain MagicMock() for BuilderConfig.from_charm,
causing build_config.proxy to be a MagicMock. When passed to
_setup_proxy_environment, assigning it to os.environ raises TypeError.

Fix: return a mock config with proxy=None so the proxy setup is skipped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Observer stored self.charm typed as ops.CharmBase, but called
_setup_proxy_environment which is defined on GithubRunnerImageBuilderCharm.
Use TYPE_CHECKING to import the concrete type and annotate the constructor
parameter correctly, resolving the attr-defined mypy error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…onment

The method is called from image.Observer (outside the charm class), so
it should be public. Renamed from _setup_proxy_environment to
setup_proxy_environment to avoid the pylint protected-access warning.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants