Fix HybridQueryRanker commonMain compile (unblocks v0.5.0 publish)#479
Merged
Conversation
`MutableMap.putIfAbsent` is JVM-only and breaks `:ampere-core:compileCommonMainKotlinMetadata`, which is what the publish.yml workflow runs on tag push. The regular PR CI doesn't run that task, so the issue slipped through when AMPR-156 (#476) merged and only surfaced when the v0.5.0 tag triggered the publish workflow. Swap to `getOrPut`, which is in commonMain and has the same effect (insert if absent, leave existing alone) when the return value is discarded inside `forEach`. Verified with `./gradlew :ampere-core:compileCommonMainKotlinMetadata` and the existing HybridQueryRankerTest. Commit authored by Claude Opus 4.7 on Miley's behalf. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Concept staleness check — clean. No tracked-source changes need a concept update. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
v0.5.0tag pushed by #478 triggeredpublish.yml, which failed at:ampere-core:compileCommonMainKotlinMetadatabecauseHybridQueryRanker.kt:64usedMutableMap.putIfAbsent— a JVM-only method not available incommonMain. The regular PR CI doesn't run the metadata-compile task, so the issue slipped through when AMPR-156 (#476) merged.This swaps
putIfAbsentforgetOrPut, which exists in commonMain and is semantically identical when the return value is discarded insideforEach.Verification
./gradlew :ampere-core:compileCommonMainKotlinMetadata— passes locally (was the failing task in the publish run)./gradlew :ampere-core:jvmTest --tests "*HybridQueryRanker*"— passes./gradlew ktlintFormat— cleanRelease recovery (after merge)
Maven Central never received
0.5.0(publish failed before the upload step), so thev0.5.0tag can be safely moved to the merge commit and re-pushed to retriggerpublish.yml:Fix authored and committed by Claude Opus 4.7 on Miley's behalf.