Skip to content

fix: release pipeline + correctness hotfixes (#77)#80

Merged
yeongseon merged 2 commits intomainfrom
fix/release-and-correctness-hotfix-77
Apr 26, 2026
Merged

fix: release pipeline + correctness hotfixes (#77)#80
yeongseon merged 2 commits intomainfrom
fix/release-and-correctness-hotfix-77

Conversation

@yeongseon
Copy link
Copy Markdown
Owner

Summary

Resolves #77 (P0). Bundles four hotfixes that unblock the release pipeline and remove two correctness footguns in the runtime.

  1. Repository URL alignment — All GitHub / Pages / codecov / mkdocs / docs URLs now use the actual repo slug azure-functions-logging-python. The PyPI distribution name (azure-functions-logging) is intentionally unchanged.
  2. Version drift fix__version__ bumped 0.5.0 → 0.5.2 and tests/test_public_api.py updated to match. The phantom v0.5.1 GitHub release/tag (which failed publish-pypi due to the existing tag-vs-__version__ guard) has been deleted.
  3. JsonFormatter unserializable extrasjson.dumps now uses a default= fallback (str(value), then <unserializable:Type> sentinel). Previously, a single non-JSON-serializable field in extra= would raise TypeError and drop the entire log record.
  4. FunctionLogger reserved-key collision — Added _RESERVED_LOG_RECORD_KEYS + _sanitize_extra() which prefixes any colliding key with extra_. Previously, passing kwargs like message=, args=, levelname=, etc. would raise KeyError deep inside stdlib logging.Logger._log.

Note on AGENTS.md "Do NOT manually edit version strings"

This PR intentionally bumps __version__ by hand because the PR itself fixes the release pipeline. Running make release-patch was not viable — the previous release attempt (v0.5.1) is exactly what this PR repairs. Subsequent releases should resume the standard Makefile flow.

Verification

  • ruff format + ruff legacy: clean
  • mypy --strict (24 source files): clean
  • pytest: 133 passed, 3 skipped (e2e env unset), coverage 97.32% (fail_under=90)
  • python -m build: azure_functions_logging-0.5.2-py3-none-any.whl built successfully
  • pre-commit (ruff/mypy/bandit/Korean filter): all Passed

New regression tests (7)

  • test_json_formatter.py: datetime/Decimal/UUID coercion, dataclass coercion, hostile __str__ → sentinel
  • test_logger.py: kwargs reserved-key sanitization, explicit extra= reserved-key sanitization, non-reserved keys unchanged, real stdlib end-to-end

Closes #77

yeongseon added 2 commits April 26, 2026 17:55
Four P0 issues from external review, shipped together.

URLs (#77 §1)
- pyproject.toml [project.urls]: align Homepage/Documentation/Repository/Issues
  with the actual GitHub repo (azure-functions-logging-python). The PyPI
  project name itself stays 'azure-functions-logging' as published.
- README.md, README.ko.md, README.ja.md, README.zh-CN.md badge URLs updated
  for CI, Release, Security Scans, codecov, Docs links.
- mkdocs.yml site_url, llms.txt and llms-full.txt doc URLs, docs/ git clone
  examples, .github/workflows/stale.yml repository guard updated to the
  real repo path.

Version drift (#77 §2)
- Bump __version__ from 0.5.0 to 0.5.2.
- Update tests/test_public_api.py to assert the new version.
- The phantom v0.5.1 GitHub release and tag (Publish to PyPI failed due to
  __version__/tag mismatch; PyPI was never updated) is being removed
  out-of-band so v0.5.0 is once again the latest published release until
  v0.5.2 ships.

JsonFormatter loses logs on unserializable extra (#77 §3)
- Add _json_default fallback that coerces unknown values to str(value),
  with a sentinel string when str() itself raises.
- json.dumps now passes default=_json_default so datetime, Decimal, UUID,
  dataclasses, exceptions, and request objects no longer crash the
  formatter or drop the log line.
- Regression tests for datetime/Decimal/UUID, dataclass, and a hostile
  __str__ class.

FunctionLogger crashes on reserved LogRecord keys (#77 §4)
- Add _sanitize_extra() that prefixes any key colliding with a reserved
  LogRecord attribute (name, msg, levelname, message, etc.) with
  'extra_' before forwarding to logging.Logger.log.
- Applies to both **kwargs forwarded into extra and the explicit
  extra= argument.
- Regression tests against MagicMock and a real stdlib logger.
Six docs files still instructed users to 'cd azure-functions-logging'
after cloning the renamed 'azure-functions-logging-python' repo, leaving
the working directory at the parent path and breaking every subsequent
command in the install/dev/contribute walkthroughs.

Refs #77
@yeongseon yeongseon merged commit 504e05d into main Apr 26, 2026
12 checks passed
@yeongseon yeongseon deleted the fix/release-and-correctness-hotfix-77 branch April 26, 2026 09:14
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.

P0: release pipeline + correctness hotfixes (URLs, version drift, JSON formatter, extra reserved keys)

1 participant