Commit 0bf68df
ci: Update bump-version workflow to regenerate snapshot tests (#552)
* ci: Update bump-version workflow to regenerate snapshot tests
The bump-version workflow now includes:
1. Verification that pyproject.toml has exactly one line changed
2. A step to update snapshot tests when bumping the version
3. Verification that each snapshot SVG file has exactly one line changed
This ensures that version bumps are clean and only affect the version
string in pyproject.toml and the splash screen version in snapshot files.
Changes:
- Add verification that pyproject.toml diff has exactly 1 line change
- Add 'Update snapshot tests' step that runs pytest with --snapshot-update
- Add 'Verify snapshot diffs' step to check each SVG has exactly 1 line diff
- Stage tests/snapshots/ files in the commit step
- Update PR description to show diff verification status
Co-authored-by: openhands <openhands@all-hands.dev>
* fix: Remove || true from pytest to not hide snapshot failures
Removing the error suppression ensures the workflow fails if snapshot
regeneration encounters any issues, preventing broken state from being
committed.
* refactor: Remove unused PYPROJECT_DIFF_ESCAPED variable
The variable was captured and exported to env but never used - the PR
body uses a hardcoded template instead. Removing dead code to reduce
complexity.
* refactor: Rename LINES_CHANGED to DIFF_LINES in pyproject.toml check
The variable name now accurately reflects what it measures - the numstat
total (added + deleted lines), not logical lines changed. Also improved
the log message to clarify the expectation.
* refactor: Rename LINES_CHANGED to DIFF_LINES in snapshot verification
For consistency with the pyproject.toml check, renamed the variable to
accurately reflect what it measures - the numstat total (added + deleted).
Also improved log messages to clarify the diff lines terminology.
* fix: Replace brittle line-count check with version value verification
Instead of checking that exactly 1 line changed (which fails in
legitimate scenarios like updating dependencies during release),
verify that the version field has the expected value. This checks
what matters, not how many lines changed.
* fix: Remove brittle snapshot diff verification step
The per-file diff line check was over-specified and would break when:
- pytest-textual-snapshot changes SVG generation formatting
- Version string appears in multiple SVG elements
- Whitespace normalization occurs
The workflow already runs snapshot tests - if they're broken, the tests
will fail. Trust the actual test run to catch broken snapshots instead
of over-specifying validation based on implementation details.
---------
Co-authored-by: openhands <openhands@all-hands.dev>1 parent 3ffa60f commit 0bf68df
1 file changed
+28
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
86 | 101 | | |
87 | 102 | | |
88 | 103 | | |
89 | 104 | | |
90 | 105 | | |
91 | | - | |
| 106 | + | |
92 | 107 | | |
| 108 | + | |
93 | 109 | | |
94 | 110 | | |
95 | 111 | | |
96 | 112 | | |
97 | 113 | | |
98 | 114 | | |
99 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
100 | 120 | | |
101 | 121 | | |
102 | 122 | | |
103 | | - | |
| 123 | + | |
| 124 | + | |
104 | 125 | | |
105 | 126 | | |
106 | 127 | | |
| |||
131 | 152 | | |
132 | 153 | | |
133 | 154 | | |
| 155 | + | |
134 | 156 | | |
135 | 157 | | |
136 | 158 | | |
| |||
141 | 163 | | |
142 | 164 | | |
143 | 165 | | |
144 | | - | |
| 166 | + | |
145 | 167 | | |
146 | 168 | | |
147 | 169 | | |
| |||
0 commit comments