Skip to content

Commit a702e9f

Browse files
committed
Add CI log-level control; drop fine_python_aksem and static IHttpClient service from dev preset
- ci-cd.yml: derive FINECODE_LOG_LEVEL from GitHub's "Enable debug logging" re-run flag (RUNNER_DEBUG=1 -> DEBUG, else INFO) and pass it via --log-level to every `finecode run` step, so CI verbosity follows the job's own debug toggle instead of always defaulting. - finecode_dev_common_preset: remove the fine_python_aksem dependency/preset entry and the preset-level IHttpClient service registration for finecode_httpclient. - Pin explicit fine_wal_explorer~=0.1.0a0 dependencies on the discover_sources/ingest_wal_to_store/discover_wal_sources handlers instead of relying on preset-level resolution.
1 parent 3de4a3a commit a702e9f

3 files changed

Lines changed: 24 additions & 18 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ jobs:
5858
fetch-depth: 0
5959
fetch-tags: 'true'
6060

61+
- name: Determine FineCode log level
62+
run: |
63+
# WM/ER diagnostic logs are streamed to the job log (verbose is auto-enabled
64+
# in CI). Keep them at INFO normally; raise to DEBUG only when the job is
65+
# re-run with "Enable debug logging" (GitHub sets RUNNER_DEBUG=1). This keeps
66+
# the debug-vs-info decision in CI config — FineCode just honors --log-level.
67+
if [ "${RUNNER_DEBUG:-0}" = "1" ]; then
68+
echo "FINECODE_LOG_LEVEL=DEBUG" >> "$GITHUB_ENV"
69+
else
70+
echo "FINECODE_LOG_LEVEL=INFO" >> "$GITHUB_ENV"
71+
fi
72+
6173
- name: Set up Python ${{ env.DEV_WORKSPACE_PYTHON_VERSION }}
6274
uses: actions/setup-python@v5
6375
with:
@@ -90,37 +102,37 @@ jobs:
90102
if: ${{ !cancelled() }}
91103
run: |
92104
source .venvs/dev_workspace/${{ matrix.venv_bin }}/activate
93-
python -m finecode run inspect_code
105+
python -m finecode run --log-level="$FINECODE_LOG_LEVEL" inspect_code
94106
shell: bash
95107

96108
- name: Audit code
97109
if: ${{ !cancelled() }}
98110
run: |
99111
source .venvs/dev_workspace/${{ matrix.venv_bin }}/activate
100-
python -m finecode run audit_code
112+
python -m finecode run --log-level="$FINECODE_LOG_LEVEL" audit_code
101113
shell: bash
102114

103115
- name: Check formatting
104116
if: ${{ !cancelled() }}
105117
run: |
106118
source .venvs/dev_workspace/${{ matrix.venv_bin }}/activate
107-
python -m finecode run check_formatting
119+
python -m finecode run --log-level="$FINECODE_LOG_LEVEL" check_formatting
108120
shell: bash
109121

110122
- name: Build artifacts
111123
id: build
112124
if: runner.os == 'Linux' && !cancelled()
113125
run: |
114126
source .venvs/dev_workspace/${{ matrix.venv_bin }}/activate
115-
python -m finecode run build_artifact
127+
python -m finecode run --log-level="$FINECODE_LOG_LEVEL" build_artifact
116128
shell: bash
117129

118130
- name: Run unit tests
119131
if: ${{ !cancelled() }}
120132
run: |
121133
source .venvs/dev_workspace/${{ matrix.venv_bin }}/activate
122134
# TODO: test with all supported python versions
123-
python -m finecode run run_tests
135+
python -m finecode run --log-level="$FINECODE_LOG_LEVEL" run_tests
124136
shell: bash
125137

126138
- name: Publish to TestPyPI and verify
@@ -131,6 +143,7 @@ jobs:
131143
run: |
132144
source .venvs/dev_workspace/${{ matrix.venv_bin }}/activate
133145
python -m finecode run \
146+
--log-level="$FINECODE_LOG_LEVEL" \
134147
--map-payload-fields="src-artifact-def-path,dist-artifact-paths" \
135148
publish_and_verify_artifact \
136149
--src-artifact-def-path="build_artifact.src_artifact_def_path" \
@@ -146,6 +159,7 @@ jobs:
146159
# TODO: make sure git tag exists (for manual trigger)
147160
source .venvs/dev_workspace/${{ matrix.venv_bin }}/activate
148161
python -m finecode run \
162+
--log-level="$FINECODE_LOG_LEVEL" \
149163
--map-payload-fields="src-artifact-def-path,dist-artifact-paths" \
150164
publish_and_verify_artifact \
151165
--src-artifact-def-path="build_artifact.src_artifact_def_path" \

finecode_dev_common_preset/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ authors = [{ name = "Vladyslav Hnatiuk", email = "aders1234@gmail.com" }]
66
readme = "README.md"
77
requires-python = ">=3.11, < 3.15"
88
dependencies = [
9-
"fine_python_aksem~=0.3.0a3",
109
"fine_python_recommended~=0.5.0a0",
1110
"fine_git_hooks~=0.1.0a0",
12-
"fine_logs~=0.1.0a0",
11+
"fine_logs~=0.1.0a0"
1312
]
1413

1514
[tool.setuptools.package-data]

finecode_dev_common_preset/src/finecode_dev_common_preset/preset.toml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
presets = [
33
{ source = "fine_python_recommended" },
44
{ source = "fine_git_hooks" },
5-
{ source = "fine_logs" },
6-
{ source = "fine_python_aksem" },
5+
{ source = "fine_logs" }
76
]
87

98
# currently, all packages in finecode repository are pure python packages, reuse
@@ -12,12 +11,6 @@ presets = [
1211
requires = ["setuptools>=64", "setuptools-scm>=8"]
1312
build-backend = "setuptools.build_meta"
1413

15-
[[tool.finecode.service]]
16-
interface = "finecode_extension_api.interfaces.ihttpclient.IHttpClient"
17-
source = "finecode_httpclient.HttpClient"
18-
env = "dev_no_runtime"
19-
dependencies = ["finecode_httpclient~=0.1.0a1"]
20-
2114
# TODO: recognize minimal python version automatically
2215
[[tool.finecode.action_handler]]
2316
source = "fine_python_ruff.RuffLintFilesHandler"
@@ -94,14 +87,14 @@ handlers = [
9487
[tool.finecode.action.ingest_wal_to_store]
9588
source = "fine_wal_events.IngestWalToStoreAction"
9689
handlers = [
97-
{ name = "discover_sources", source = "fine_wal_explorer.IngestWalSourceDiscoveryHandler", env = "wal_explorer" },
98-
{ name = "ingest_wal_to_store", source = "fine_wal_explorer.IngestWalToStoreHandler", env = "wal_explorer" },
90+
{ name = "discover_sources", source = "fine_wal_explorer.IngestWalSourceDiscoveryHandler", env = "wal_explorer", dependencies = ["fine_wal_explorer~=0.1.0a0"] },
91+
{ name = "ingest_wal_to_store", source = "fine_wal_explorer.IngestWalToStoreHandler", env = "wal_explorer", dependencies = ["fine_wal_explorer~=0.1.0a0"] },
9992
]
10093

10194
[tool.finecode.action.discover_wal_sources]
10295
source = "fine_wal_events.DiscoverWalSourcesAction"
10396
handlers = [
104-
{ name = "discover_wal_sources", source = "fine_wal_explorer.DiscoverWalSourcesHandler", env = "wal_explorer" },
97+
{ name = "discover_wal_sources", source = "fine_wal_explorer.DiscoverWalSourcesHandler", env = "wal_explorer", dependencies = ["fine_wal_explorer~=0.1.0a0"] },
10598
]
10699

107100
[tool.finecode.action.verify_artifact_published_to_registry]

0 commit comments

Comments
 (0)