Skip to content

Commit d39e846

Browse files
tobiajoclaude
andauthored
Scaladoc generation fix (evolution-gaming#840)
* Fix Scaladoc generation failures in persistence-kafka The doc task (run by +publish) failed on 5 broken Scaladoc references introduced with the transactional snapshot docs: - [[ScheduleCommit]] could not be linked (imported type, not a linkable member) -> use a monospace reference. - s"$groupId-$inputTopic" was parsed as Scaladoc variable expansions ($groupId, $inputTopic undefined) -> reword without interpolation. - [[caching]] was ambiguous between the two caching overloads -> de-link to a monospace reference. - [[cachingTransactional]] from the trait scope could not be resolved -> reference it via the companion object name. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011rniFrCMdoVACjj6CVd8xB * CI: validate Scaladoc generation on PRs Scaladoc was only generated by '+publish' at release time, so broken doc links/references could merge to master and only surface as a failed release. Add a 'Compile/doc' step to the CI test job (both Scala 2.13 and 3.3 matrix legs) so they fail the PR instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011rniFrCMdoVACjj6CVd8xB * Apply scalafmt to reformatted doc comments Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011rniFrCMdoVACjj6CVd8xB --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 362dfb9 commit d39e846

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
if: success()
4242
run: sbt clean coverage "++${{ matrix.scala }} test" docs/mdoc "++${{ matrix.scala }} versionPolicyCheck"
4343

44+
- name: Check Scaladoc ${{ matrix.scala }} # Scaladoc is only generated by `+publish` at release time; validate it here so broken links/refs fail the PR instead of slipping to master
45+
if: success()
46+
run: sbt "++${{ matrix.scala }} Compile/doc"
47+
4448
- name: Report test coverage
4549
if: success() && github.repository == 'evolution-gaming/kafka-flow'
4650
env:

persistence-kafka/src/main/scala/com/evolutiongaming/kafka/flow/kafkapersistence/KafkaPersistenceModule.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ trait KafkaPersistenceModule[F[_], S] {
2828

2929
/** A `ScheduleCommit` that overrides the default way input offsets are committed (by the consumer), binding them to
3030
* the snapshot writes for single-writer offset safety. `None` means the module does not override it and offsets are
31-
* committed the default way. See [[cachingTransactional]].
31+
* committed the default way. See `KafkaPersistenceModule.cachingTransactional`.
3232
*/
3333
def scheduleCommit: Option[ScheduleCommit[F]]
3434
}
@@ -44,7 +44,7 @@ object KafkaPersistenceModule {
4444
* `clientId` is suffixed with it
4545
* @param transactionalIdPrefix
4646
* prefix for `transactional.id` (partition number and a unique per-producer suffix are appended). Fencing is by
47-
* consumer generation, not this id, so it is just a readable label; `s"$groupId-$inputTopic"` is fine.
47+
* consumer generation, not this id, so it is just a readable label (e.g. a `"<groupId>-<inputTopic>"` string).
4848
* @param snapshotTopic
4949
* snapshot topic name (should be configured as a 'compacted' topic) to read/write snapshots
5050
* @param inputTopic
@@ -156,14 +156,14 @@ object KafkaPersistenceModule {
156156
}
157157
}
158158

159-
/** Variant of [[caching]] protecting the snapshot topic from stale writers by binding the input-offset commit into
160-
* the snapshot transaction. Each assigned partition gets a transactional producer with a unique `transactional.id`;
159+
/** Variant of `caching` protecting the snapshot topic from stale writers by binding the input-offset commit into the
160+
* snapshot transaction. Each assigned partition gets a transactional producer with a unique `transactional.id`;
161161
* snapshot writes run in group-committed transactions (see [[KafkaSnapshotWriteDatabase.transactional]]) that also
162162
* commit the input offset. A stale consumer generation is rejected by the broker (KIP-447), aborting the
163163
* transaction, so a stale owner can neither advance offsets nor overwrite a newer snapshot. Recovery reads with
164-
* `read_committed`, and unlike [[caching]] the identity partition mapping is always used; output stays
165-
* at-least-once. See the "Protecting against stale snapshot writes" persistence docs for guarantees, limitations,
166-
* costs and rollout, and `docs/kafka-single-writer-design.md` for the mechanism.
164+
* `read_committed`, and unlike `caching` the identity partition mapping is always used; output stays at-least-once.
165+
* See the "Protecting against stale snapshot writes" persistence docs for guarantees, limitations, costs and
166+
* rollout, and `docs/kafka-single-writer-design.md` for the mechanism.
167167
*/
168168
def cachingTransactional[F[_]: LogOf: Async: Parallel: Runtime, S](
169169
consumerOf: ConsumerOf[F],

persistence-kafka/src/main/scala/com/evolutiongaming/kafka/flow/kafkapersistence/KafkaSnapshotWriteDatabase.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ object KafkaSnapshotWriteDatabase {
2323
): SnapshotWriteDatabase[F, KafkaKey, S] =
2424
apply(snapshotTopicPartition, partitionMapper, record => producer.send(record).flatten.void)
2525

26-
/** Result of [[transactional]]: the snapshot write database plus a [[ScheduleCommit]] that routes input offset
27-
* commits through the same per-partition transactions as the snapshot writes.
26+
/** Result of [[transactional]]: the snapshot write database plus a `ScheduleCommit` that routes input offset commits
27+
* through the same per-partition transactions as the snapshot writes.
2828
*/
2929
final case class Transactional[F[_], S](
3030
writeDatabase: SnapshotWriteDatabase[F, KafkaKey, S],

0 commit comments

Comments
 (0)