Skip to content

ci: fix version-sync assertion (no-op rewrite is fine)#150

Merged
saurabhjain1592 merged 1 commit into
mainfrom
feature/qf-10-java-version-sync-fix
Apr 28, 2026
Merged

ci: fix version-sync assertion (no-op rewrite is fine)#150
saurabhjain1592 merged 1 commit into
mainfrom
feature/qf-10-java-version-sync-fix

Conversation

@saurabhjain1592

Copy link
Copy Markdown
Member

Summary

Post-merge run of #149 on main hit the version-sync assertion immediately:

```
AssertionError: Failed to rewrite example pom version
```

The assertion was `assert new != s` — fires when parent and example versions already agree (rewrite is an identity no-op). The parent is at 6.1.0 and the example was already pinned to 6.1.0, so the regex matched 1 occurrence but the content was unchanged.

Fix

Use `re.subn` to count matches and assert `count >= 1`. A no-op rewrite (versions already match) is the expected steady state; a zero-match means the pom layout drifted and CI should fail loud.

Test plan

  • Local rerun of the inlined script with synthetic pom — assertion fires only when regex doesn't match
  • CI: contract-integration green
  • CI: live-integration green on push to main (the version-sync step now succeeds; the basic example smoke runs)

The version-sync step asserted `new != s`, which fires when parent and
example versions already agree (the rewrite is an identity no-op, no
content change). Post-merge run on main hit this immediately because
the parent is at 6.1.0 and the example was already pinned to 6.1.0.

Use re.subn to count matches and assert count >= 1 — a no-op rewrite
when versions match is the expected steady state; a zero-match means
the pom layout drifted and CI should fail loud.
@saurabhjain1592 saurabhjain1592 merged commit fdb3729 into main Apr 28, 2026
13 checks passed
@saurabhjain1592 saurabhjain1592 deleted the feature/qf-10-java-version-sync-fix branch April 28, 2026 16:23
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.

1 participant