Skip to content

Remove committed Python bytecode cache from perf pipeline scripts - #4550

Merged
cheenamalhotra merged 1 commit into
mainfrom
dev/cheena/cuddly-parakeet
Aug 18, 2026
Merged

Remove committed Python bytecode cache from perf pipeline scripts#4550
cheenamalhotra merged 1 commit into
mainfrom
dev/cheena/cuddly-parakeet

Conversation

@cheenamalhotra

Copy link
Copy Markdown
Member

Description

eng/pipelines/perf/scripts/ had a checked-in Python bytecode artifact,
__pycache__/perf_to_kusto.cpython-314.pyc, that was accidentally committed
alongside the perf tooling. Nothing consumes it: the pipeline and
translate_results_to_kusto.sh both invoke perf_to_kusto.py directly via
python3, and CPython regenerates its own cache on import. It is also
version-pinned to CPython 3.14, so it is dead weight on every other agent.

Changes:

  • Delete eng/pipelines/perf/scripts/__pycache__/perf_to_kusto.cpython-314.pyc.
  • Add __pycache__/ and *.py[cod] to .gitignore so bytecode is never
    staged again.
  • Export PYTHONDONTWRITEBYTECODE=1 from the four perf entry points that shell
    out to Python (run-perf-tests.sh, run-perf-tests.ps1,
    translate_results_to_kusto.sh, and the Kusto ingest step in
    sqlclient-perf-pipeline.yml) so pipeline runs leave the checkout clean.

This is engineering hygiene only. No product code, public API, or pipeline
behaviour changes; the perf scripts run exactly as before, just without
writing .pyc files back into eng/.

Issues

N/A

Testing

No automated tests exist for the perf shell/pipeline tooling, so validation was
done by direct execution:

  • bash -n on run-perf-tests.sh and translate_results_to_kusto.sh (syntax OK).
  • sqlclient-perf-pipeline.yml parses as valid YAML.
  • python3 eng/pipelines/perf/scripts/perf_to_kusto.py --help runs standalone
    with the .pyc removed, confirming nothing depended on it.
  • All four perf Python scripts compile cleanly via py_compile.
  • Confirmed no __pycache__ directory reappears in the scripts folder after
    running them.

The perf pipeline scripts directory contained a checked-in
__pycache__/perf_to_kusto.cpython-314.pyc artifact that nothing referenced;
the pipeline invokes perf_to_kusto.py directly via python3.

Delete the artifact, add __pycache__/ and *.py[cod] to .gitignore, and export
PYTHONDONTWRITEBYTECODE=1 from the perf entry points so bytecode caches are
never written back into the checkout.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2fd9c200-e580-4516-bbd8-09ede1f8d789
Copilot AI lite review requested due to automatic review settings August 18, 2026 17:46
@cheenamalhotra
cheenamalhotra requested a review from a team as a code owner August 18, 2026 17:46
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Aug 18, 2026

Copilot AI 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.

Pull request overview

Removes an accidentally committed Python bytecode cache artifact from the perf pipeline tooling and adds safeguards to prevent .pyc regeneration from dirtying the eng/ checkout during perf runs.

Changes:

  • Deleted the checked-in perf_to_kusto.cpython-314.pyc artifact under eng/pipelines/perf/scripts/__pycache__/.
  • Updated .gitignore to ignore __pycache__/ and *.py[cod] across the repo.
  • Set PYTHONDONTWRITEBYTECODE=1 in perf entry-point scripts and the Kusto ingest pipeline step to keep pipeline checkouts clean.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
eng/pipelines/perf/sqlclient-perf-pipeline.yml Exports PYTHONDONTWRITEBYTECODE=1 in the Kusto ingest bash inline script to avoid writing .pyc under eng/ during ingestion.
eng/pipelines/perf/scripts/translate_results_to_kusto.sh Exports PYTHONDONTWRITEBYTECODE=1 near script start so helper Python invocations don’t emit __pycache__.
eng/pipelines/perf/scripts/run-perf-tests.sh Exports PYTHONDONTWRITEBYTECODE=1 near script start to prevent .pyc creation during the Linux perf run.
eng/pipelines/perf/scripts/run-perf-tests.ps1 Sets $env:PYTHONDONTWRITEBYTECODE early so Windows perf runs don’t write __pycache__ content into the repo tree.
.gitignore Ignores Python bytecode caches (__pycache__/, *.py[cod]) to prevent accidental staging.
eng/pipelines/perf/scripts/pycache/perf_to_kusto.cpython-314.pyc Removed committed CPython bytecode artifact.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cheenamalhotra cheenamalhotra moved this from To triage to In review in SqlClient Board Aug 18, 2026
@cheenamalhotra
cheenamalhotra merged commit 8483db6 into main Aug 18, 2026
297 of 305 checks passed
@cheenamalhotra
cheenamalhotra deleted the dev/cheena/cuddly-parakeet branch August 18, 2026 19:37
@github-project-automation github-project-automation Bot moved this from In review to Done in SqlClient Board Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants