Skip to content

fix(ci): sync uv.lock in release PR + use logging.exception#92

Merged
anchildress1 merged 3 commits into
mainfrom
fix/sonar-logging-exception
Jun 24, 2026
Merged

fix(ci): sync uv.lock in release PR + use logging.exception#92
anchildress1 merged 3 commits into
mainfrom
fix/sonar-logging-exception

Conversation

@anchildress1

Copy link
Copy Markdown
Owner

What 🔧

Two independent fixes:

1. release-please leaves uv.lock stale

  • release-please bumps pyproject.toml but never runs uv lock
  • Result: locked project version drifted (1.0.1 vs released 1.1.0)
  • Fix: guarded follow-up in release-please.yml checks out the release PR branch, runs uv lock, pushes the synced lock back into the same PR
  • Gated on prs_created == 'true'; no-op when the lock already matches
  • Local commits already stay synced via the update-lockfiles pre-commit hook — this just closes the CI gap

2. SonarQube S8572 (9 findings)

  • logger.error(f"...: {e}")logger.exception("...") inside except blocks
  • Captures stack traces; drops the redundant as e
  • Files: ai_optimization/cross_reference.py, ai_optimization/sitemap_generator.py

Verification ✅

  • make ai-checks — format, lint, security, complexity, tests (88.63% > 85%) all pass
  • actionlint clean on the workflow
  • ref: in the new checkout comes from release-please's own output (deterministic branch name), not attacker-controlled event input; run: block has no ${{ }} interpolation — no injection surface

Notes 📝

  • CI lock-sync commit is authored as ci-bot (matches publish.yaml convention) and is not GPG-signed — it's a generated bot commit
  • Suggestion (not applied): file-level permissions could move to job level per repo GHA conventions, but kept the diff minimal

🤖 Generated with Claude Code

anchildress1 and others added 2 commits June 24, 2026 08:09
Replaces logger.error(f"...: {e}") with logger.exception("...") inside
except blocks so stack traces are captured. Resolves SonarQube S8572 (9
findings across cross_reference.py and sitemap_generator.py).

Generated-by: Claude Opus 4.8
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
release-please bumps pyproject.toml but never runs uv lock, leaving the
locked project version stale (1.0.1 vs released 1.1.0). Add a guarded
follow-up that checks out the release PR branch, runs uv lock, and pushes
the synced lock back into the same PR.

Generated-by: Claude Opus 4.8
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 24, 2026 12:10

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

This PR addresses two CI/quality gaps in the devto-mirror codebase: keeping uv.lock synchronized in release-please generated release PRs, and improving exception logging in AI optimization modules to include stack traces.

Changes:

  • Updates exception handling in AI optimization modules to use logger.exception(...) for stack traces.
  • Extends the release-please workflow to check out the release PR branch, run uv lock, and push an uv.lock sync commit back into the same PR when needed.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/devto_mirror/ai_optimization/sitemap_generator.py Switches error logging in except blocks to logger.exception to include stack traces.
src/devto_mirror/ai_optimization/cross_reference.py Switches error logging in except blocks to logger.exception to include stack traces.
.github/workflows/release-please.yml Adds a guarded post-release-please step sequence to regenerate and push a synced uv.lock into the release PR branch.

Comment thread .github/workflows/release-please.yml
Pins the interpreter setup-uv installs and enables caching so the
release-please lock-sync step is deterministic and consistent with the
rest of CI. (uv.lock itself is a universal lockfile, so contents do not
depend on the runner Python; this stops uv from auto-downloading an
arbitrary managed interpreter.)

Generated-by: Claude Opus 4.8
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@anchildress1 anchildress1 merged commit 3c2928f into main Jun 24, 2026
4 checks passed
@anchildress1 anchildress1 deleted the fix/sonar-logging-exception branch June 24, 2026 12:38
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