Skip to content

fix(export): restore console log level after export completes - #7947

Merged
FarhanAliRaza merged 3 commits into
reflex-dev:mainfrom
DevChiniwala:fix/deploy-restore-loglevel
Dec 1, 2026
Merged

FarhanAliRaza merged 3 commits into
reflex-dev:mainfrom
DevChiniwala:fix/deploy-restore-loglevel

Conversation

@DevChiniwala

@DevChiniwala DevChiniwala commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7850

Summary

  • export() sets the console to the subprocess log level (WARNING by default) but never restores it
  • This hides all INFO messages from callers like reflex deploy after the export step — deployment progress, scaling-conflict retries, and the success line are all silenced
  • Fix: save the current log level before export() changes it and restore it in the existing finally block

Changes

  • reflex/utils/export.py: save prev_log_level via _log.get_log_level() before set_log_level(loglevel), restore it in the finally block

Test plan

  • reflex deploy in a non-TTY shell should now show progress and success messages after the export step
  • The fix is in the existing finally block, so the level is restored even if export fails

🤖 Generated with Claude Code

View guided diff

@DevChiniwala
DevChiniwala requested a review from a team as a code owner November 20, 2026 20:13
Copilot AI balanced review requested due to automatic review settings November 20, 2026 20:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

View guided diff | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no blocking issues remain.

Summary

export() now restores the caller’s log level before returning or raising.

  • Export returns to the caller’s log level when it finishes.

Reviews (7) · Last reviewed commit: "Fix the log level tests and reword the n..." · Reviewed by Greptile

Comment thread reflex/utils/export.py Resolved
Comment thread reflex/utils/export.py Resolved
@codspeed

codspeed Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 4.93%

1 warning

⚠️ 18 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 1 regressed benchmark
✅ 145 untouched benchmarks
⏩ 8 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ test_state_update_wire_serialization[model_1000] 25 ms 26.3 ms -4.93%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing DevChiniwala:fix/deploy-restore-loglevel (8eaff6a) with main (8e0e881)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@DevChiniwala
DevChiniwala force-pushed the fix/deploy-restore-loglevel branch from 0951824 to fe2e381 Compare November 20, 2026 23:09
Comment thread tests/units/utils/test_export.py Resolved
Comment thread tests/units/utils/test_export.py Resolved
Comment thread tests/units/utils/test_export.py Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread tests/units/utils/test_export.py Resolved
Comment thread tests/units/utils/test_export.py Resolved
Comment thread tests/units/utils/test_export.py Resolved
Comment thread news/7947.bugfix.md Resolved
@DevChiniwala
DevChiniwala force-pushed the fix/deploy-restore-loglevel branch from fe2e381 to e60e077 Compare November 20, 2026 23:26
Comment thread tests/units/utils/test_export.py Resolved
@DevChiniwala
DevChiniwala force-pushed the fix/deploy-restore-loglevel branch from e60e077 to 709d7f4 Compare November 20, 2026 23:42

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

View guided diff | Re-trigger cubic

Comment thread tests/units/utils/test_export.py Resolved
Comment thread tests/units/utils/test_export.py Resolved
Comment thread tests/units/utils/test_export.py Resolved
@DevChiniwala
DevChiniwala force-pushed the fix/deploy-restore-loglevel branch 2 times, most recently from bb0ccaa to b41e1fb Compare November 21, 2026 12:02
The export() function sets the console to the subprocess log level
(WARNING by default) but never restores it, hiding all INFO messages
from callers like `reflex deploy` after the export step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DevChiniwala
DevChiniwala force-pushed the fix/deploy-restore-loglevel branch from b41e1fb to 9797836 Compare November 21, 2026 12:03
Comment thread tests/units/utils/test_export.py Resolved
@FarhanAliRaza FarhanAliRaza added the bug Something isn't working label Nov 23, 2026 — with ChatGPT Codex Connector
@FarhanAliRaza FarhanAliRaza added the on deck PRs lined up to review / merge next label Nov 30, 2026
@FarhanAliRaza FarhanAliRaza added the priority: P2 Medium: valid edge-case bug, reasonable feature, or docs fix label Nov 30, 2026 — with Claude
The failure test passed frontend=False, so the patched get_compiled_app
never ran and the test could not pass. The tests also left the process
log level and REFLEX_LOGLEVEL changed for every later test.

Replace the three tests with one parametrized test that checks the
level during and after a successful and a failed export. A fixture
starts it at a known level and undoes both the level and the variable.

The fragment now describes what a deploy user sees.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

View guided diff | Re-trigger cubic

Comment thread tests/units/utils/test_export.py Resolved
@FarhanAliRaza
FarhanAliRaza merged commit 2f986bd into reflex-dev:main Dec 1, 2026
169 of 170 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working on deck PRs lined up to review / merge next priority: P2 Medium: valid edge-case bug, reasonable feature, or docs fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reflex deploy hides its progress and success messages: the export step leaves the console at WARNING

3 participants