Skip to content

Repo health: modernize deps, security, tests, docs - #1

Merged
hippi345 merged 1 commit into
masterfrom
cursor/repo-health-modernize-b12d
Sep 26, 2026
Merged

hippi345 merged 1 commit into
masterfrom
cursor/repo-health-modernize-b12d

Conversation

@hippi345

Copy link
Copy Markdown
Owner

Summary

Modernization pass for this Azure Blob Storage CLI utility (Python 3.12+).

Security

  • No committed secrets were found in the repository history in this review.
  • Behavior change (security): the legacy script printed the storage account key to stdout; output now shows [redacted].
  • Credentials can be supplied via AZURE_STORAGE_ACCOUNT_NAME, AZURE_STORAGE_ACCOUNT_KEY, or AZURE_STORAGE_CONNECTION_STRING (documented in README and .env.example).
  • Added SECURITY.md, .gitignore (including .env), and Dependabot for pip and GitHub Actions.

Dependencies and runtime

  • Requires Python 3.12+.
  • Replaced deprecated azure.storage.blob.BlockBlobService with current azure-storage-blob (BlobServiceClient).
  • Added pyproject.toml, requirements.txt, and requirements-lock.txt.

Working code / bug fixes

  • -c containers are now honored (legacy code listed every container in the account).
  • Fixed blob list accumulation across containers (incorrect totals).
  • Removed incorrect get_blob_properties usage; sizes come from list results.
  • Structured CLI with argparse while keeping python main.py entry point.

Tests and lint

  • 7 offline unit tests (mocked storage; no Azure credentials).
  • Ruff lint + format configuration in pyproject.toml.

CI

  • GitHub Actions workflow: install, Ruff, build, pytest on push/PR (Python 3.12 and 3.13).

License

  • Added MIT License, Copyright (c) 2026 Joel Shearon.

README

  • Rewrote README with badges, setup, env vars, usage, tests, and project layout.

Polish

  • .editorconfig, package layout under get_blobs_of_file_type/.

Owner actions

  • If you ever ran the old version in a shared terminal or logs, rotate the storage account key as a precaution (old builds echoed the key).
  • For local runs, set env vars or flags as documented; do not commit .env.

Verification (local)

ruff check .
ruff format --check .
pytest -v
python -m build
Open in Web Open in Cursor 

- Replace deprecated azure-storage BlockBlobService with azure-storage-blob
- Fix container scoping, blob accumulation, and credential logging bugs
- Add Python 3.12+ packaging, Ruff, pytest suite, GitHub Actions, Dependabot
- Add MIT license, SECURITY.md, README, .gitignore, and .editorconfig

Co-authored-by: Joel Town Road <vision2020joel@gmail.com>
@hippi345
hippi345 marked this pull request as ready for review September 26, 2026 16:25
@hippi345
hippi345 merged commit 52c1f3f into master Sep 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants