Skip to content

Allow generated prompt snapshot updates#3134

Merged
koxudaxi merged 1 commit into
mainfrom
fix/generated-docs-sync-snapshot-exit
May 7, 2026
Merged

Allow generated prompt snapshot updates#3134
koxudaxi merged 1 commit into
mainfrom
fix/generated-docs-sync-snapshot-exit

Conversation

@koxudaxi
Copy link
Copy Markdown
Owner

@koxudaxi koxudaxi commented May 7, 2026

Summary by CodeRabbit

  • Chores
    • Improved the continuous integration workflow for generated documentation synchronization with enhanced snapshot testing validation. The workflow now implements more selective test failure handling that captures execution status and conditionally manages workflow behavior. This refinement allows documentation differences to be properly detected, processed, and addressed appropriately without causing unnecessary workflow disruptions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ef007d55-e7be-4e41-9b51-51aaff4db945

📥 Commits

Reviewing files that changed from the base of the PR and between 9210c19 and a0b9a84.

📒 Files selected for processing (1)
  • .github/workflows/generated-docs-sync.yaml

📝 Walkthrough

Walkthrough

The PR modifies the CI workflow to improve handling of inline-snapshot test failures. The generate job now captures pytest exit codes and conditionally re-enables shell error mode only when snapshots fail without producing changes in the generated-prompt directory, allowing diffs to be handled later.

Changes

Snapshot Test Conditional Gating

Layer / File(s) Summary
Conditional Pytest Execution
.github/workflows/generated-docs-sync.yaml
Pytest invocation for tests/test_main_kr.py prompt generation is wrapped with logic that temporarily disables set -e, captures the exit code, and conditionally re-enables error mode only when snapshot tests fail without producing staged/local diffs under the expected directory.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • koxudaxi/datamodel-code-generator#3129: Both PRs modify the generated-docs-sync workflow to change how pytest inline-snapshot prompt tests are run and how generated prompt diffs are handled.

Poem

🐰 A rabbit hops through CI scripts with care,
Capturing exit codes here and there,
When snapshots fail but changes abound,
The workflow lets diffs patch the ground,
No false alarms in the generated-prompt square! 🌿

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/generated-docs-sync-snapshot-exit

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Microsoft Presidio Analyzer (2.2.362)
.github/workflows/generated-docs-sync.yaml

Microsoft Presidio Analyzer failed to scan this file


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@koxudaxi koxudaxi enabled auto-merge (squash) May 7, 2026 15:00
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

📚 Docs Preview: https://pr-3134.datamodel-code-generator.pages.dev

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 7, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 11 untouched benchmarks
⏩ 98 skipped benchmarks1


Comparing fix/generated-docs-sync-snapshot-exit (a0b9a84) with main (9210c19)

Open in CodSpeed

Footnotes

  1. 98 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.

@koxudaxi koxudaxi merged commit a7d1e9c into main May 7, 2026
38 of 39 checks passed
@koxudaxi koxudaxi deleted the fix/generated-docs-sync-snapshot-exit branch May 7, 2026 15:03
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9210c19) to head (a0b9a84).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #3134   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           88        88           
  Lines        18583     18583           
  Branches      2145      2145           
=========================================
  Hits         18583     18583           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: This PR adds support for extracting and preserving description fields from anyOf/oneOf const enum patterns and the x-enum-descriptions extension field. It is an additive feature: previously dropped descriptions are now rendered as docstrings on enum members, but only when --use-field-description is enabled and descriptions exist in the schema. Schemas without descriptions are completely unaffected. No existing generated output is modified or removed — new information is added where it was previously silently discarded. The workflow and documentation changes are CI/docs-only and don't affect user-facing behavior.


This analysis was performed by Claude Code Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🎉 Released in 0.57.0

This PR is now available in the latest release. See the release notes for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant