Skip to content

Commit

Permalink
Events API: use Nessie model API directly and remove DTOs (#9588)
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra authored Sep 26, 2024
1 parent 0d8c84f commit 9799364
Show file tree
Hide file tree
Showing 33 changed files with 315 additions and 1,219 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ as necessary. Empty sections will not end in the release notes.

### Breaking changes

- The Events API has been redesigned to import the Nessie Model API directly, instead of using
specific DTO classes. This change is intended to simplify the API and facilitate consumption of
the events. The following classes from the `org.projectnessie.events.api` package have been
removed and replaced with their respective model classes from the `org.projectnessie.model`
package:
- `CommitMeta`
- `Content` and its subclasses
- `ContentKey`
- `Reference` and its subclasses
- Helm chart: the `service` section has been redesigned to allow for extra services to be defined.
If you have customized the `service.ports` field, beware that this field is now an array. Also,
the management port configuration has been moved to a new `managementService` section. And
Expand Down
9 changes: 9 additions & 0 deletions events/api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@ plugins { id("nessie-conventions-server") }
publishingHelper { mavenName = "Nessie - Events - API" }

dependencies {
api(project(":nessie-model"))

// Immutables
implementation(libs.immutables.builder)
implementation(libs.immutables.value.annotations)
annotationProcessor(libs.immutables.value.processor)

compileOnly(libs.microprofile.openapi)
compileOnly(platform(libs.jackson.bom))
compileOnly("com.fasterxml.jackson.core:jackson-annotations")

// Testing
testImplementation(platform(libs.junit.bom))
testImplementation(libs.bundles.junit.testing)

testCompileOnly(libs.microprofile.openapi)
testCompileOnly(platform(libs.jackson.bom))
testCompileOnly("com.fasterxml.jackson.core:jackson-annotations")
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.projectnessie.events.api;

import org.immutables.value.Value;
import org.projectnessie.model.CommitMeta;

/**
* Event that is emitted when a commit is performed. This event is emitted after the commit has been
Expand Down

This file was deleted.

61 changes: 0 additions & 61 deletions events/api/src/main/java/org/projectnessie/events/api/Content.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.projectnessie.events.api;

import java.time.Instant;
import org.projectnessie.model.ContentKey;

/**
* Event that is emitted when a content is stored (PUT) or removed (DELETE).
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.projectnessie.events.api;

import org.immutables.value.Value;
import org.projectnessie.model.Content;

/**
* Event that is emitted when a content is stored. This event corresponds to a PUT operation in a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.projectnessie.events.api;

import org.immutables.value.Value;
import org.projectnessie.model.Reference;

/**
* Event that is emitted when a merge is performed. This event is emitted after the merge has been
Expand All @@ -30,6 +31,15 @@ default EventType getType() {
return EventType.MERGE;
}

/**
* The source reference where the committed operations come from. This is usually a branch, but
* not always (e.g. it could be a tag or a detached reference).
*/
Reference getSourceReference();

/** The hash of the source reference that was merged into the target reference. */
String getSourceHash();

/**
* The hash of the common ancestor of the two merged branches.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
*/
package org.projectnessie.events.api;

import org.projectnessie.model.Reference;

/**
* Event that affects two references: a source and a target.
* Event that affects more than one reference.
*
* <p>This type has 2 child interfaces:
*
Expand All @@ -27,12 +29,6 @@
*/
public interface MultiReferenceEvent extends Event {

/**
* The source reference where the committed operations come from. This is usually a branch, but
* not always (e.g. it could be a tag or a detached reference).
*/
Reference getSourceReference();

/**
* The target reference where the committed operations were applied to.
*
Expand Down
Loading

0 comments on commit 9799364

Please sign in to comment.