Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SpongePowered/SystemOfADownload
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9c9edb5569a07b25f9213e1af373000dc06be4bc
Choose a base ref
..
head repository: SpongePowered/SystemOfADownload
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6e434163d769ff905d6d5ede6aa86f256568b44e
Choose a head ref
Showing with 1,880 additions and 180 deletions.
  1. +22 −0 HEADER.txt
  2. +24 −0 artifacts/api/src/main/java/org/spongepowered/downloads/artifact/api/ComparableVersion.java
  3. +26 −3 artifacts/api/src/main/java/org/spongepowered/downloads/artifact/api/mutation/Update.java
  4. +12 −8 artifacts/api/src/main/java/org/spongepowered/downloads/artifact/api/query/ArtifactDetails.java
  5. +0 −1 artifacts/api/src/main/java/org/spongepowered/downloads/artifact/api/query/GroupResponse.java
  6. +24 −0 artifacts/api/src/main/java/org/spongepowered/downloads/artifact/api/registration/Response.java
  7. +67 −0 artifacts/api/src/test/java/org/spongepowered/downloads/artifact/api/test/GropuRegistrationTest.java
  8. +24 −0 artifacts/api/src/test/java/org/spongepowered/downloads/artifact/api/test/UpdateValidationTest.java
  9. +19 −3 artifacts/events/build.gradle.kts
  10. +3 −3 artifacts/events/src/main/java/module-info.java
  11. +39 −1 artifacts/events/src/main/java/org/spongepowered/downloads/artifacts/events/ArtifactEvent.java
  12. +1 −1 artifacts/events/src/main/java/org/spongepowered/downloads/artifacts/events/GroupUpdate.java
  13. +17 −18 artifacts/server/build.gradle.kts
  14. +24 −0 artifacts/server/src/main/java/org/spongepowered/downloads/artifacts/server/Application.java
  15. +40 −0 ...er/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/details/ArtifactRepository.java
  16. +81 −0 ...rver/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/details/ArtifactsService.java
  17. +11 −0 ...server/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/details/DetailsCommand.java
  18. +153 −0 ...erver/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/details/domain/Artifact.java
  19. +24 −0 ...rver/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/group/ArtifactRepository.java
  20. +7 −0 ...cts/server/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/group/GroupCommand.java
  21. +24 −0 .../server/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/group/GroupRepository.java
  22. +18 −9 ...cts/server/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/group/GroupService.java
  23. +25 −1 .../server/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/group/domain/Artifact.java
  24. +32 −4 ...cts/server/src/main/java/org/spongepowered/downloads/artifacts/server/cmd/group/domain/Group.java
  25. +100 −66 ...in/java/org/spongepowered/downloads/artifacts/server/cmd/transport/ArtifactCommandController.java
  26. +26 −1 .../main/java/org/spongepowered/downloads/artifacts/server/cmd/transport/GroupCommandController.java
  27. +24 −0 .../main/java/org/spongepowered/downloads/artifacts/server/lib/git/GitRemoteValidationException.java
  28. +24 −0 artifacts/server/src/main/java/org/spongepowered/downloads/artifacts/server/lib/git/GitResolver.java
  29. +24 −0 ...ver/src/main/java/org/spongepowered/downloads/artifacts/server/query/group/GroupQueryService.java
  30. +24 −0 ...ver/src/main/java/org/spongepowered/downloads/artifacts/server/query/meta/ArtifactRepository.java
  31. +24 −0 ...ts/server/src/main/java/org/spongepowered/downloads/artifacts/server/query/meta/domain/Group.java
  32. +24 −0 ...in/java/org/spongepowered/downloads/artifacts/server/query/transport/ArtifactQueryController.java
  33. +24 −0 .../main/java/org/spongepowered/downloads/artifacts/server/query/transport/GroupQueryController.java
  34. +27 −0 artifacts/server/src/main/resources/application.yaml
  35. +1 −0 artifacts/server/src/main/resources/db/liquibase-changelog.xml
  36. +24 −0 ...facts/server/src/test/java/org/spongepowered/downloads/test/artifacts/server/ApplicationTest.java
  37. +24 −0 ...erver/src/test/java/org/spongepowered/downloads/test/artifacts/server/ArtifactRepositoryTest.java
  38. +25 −0 artifacts/server/src/test/java/org/spongepowered/downloads/test/artifacts/server/LiquibaseTest.java
  39. +24 −0 ...server/src/test/java/org/spongepowered/downloads/test/artifacts/server/cmd/details/StateTest.java
  40. +132 −0 ...rc/test/java/org/spongepowered/downloads/test/artifacts/server/cmd/group/GroupRepositoryTest.java
  41. +60 −2 ...r/src/test/java/org/spongepowered/downloads/test/artifacts/server/cmd/group/GroupServiceTest.java
  42. +24 −0 .../java/org/spongepowered/downloads/test/artifacts/server/cmd/transport/ArtifactControllerTest.java
  43. +127 −0 ...a/org/spongepowered/downloads/test/artifacts/server/cmd/transport/GroupCommandControllerTest.java
  44. +24 −0 ...rver/src/test/java/org/spongepowered/downloads/test/artifacts/server/lib/git/GitResolverTest.java
  45. +1 −0 artifacts/server/src/test/resources/db/test-changelog.xml
  46. +0 −20 artifacts/server/src/test/resources/logback.xml
  47. +25 −14 artifacts/worker/src/main/java/org/spongepowered/downloads/artifacts/worker/Application.java
  48. +20 −1 build.gradle.kts
  49. 0 events/{ → api}/build.gradle.kts
  50. +1 −1 events/{ → api}/src/main/java/module-info.java
  51. +30 −0 events/api/src/main/java/org/spongepowered/downloads/events/DomainObject.java
  52. +52 −0 events/api/src/main/java/org/spongepowered/downloads/events/Envelope.java
  53. +36 −0 events/api/src/main/java/org/spongepowered/downloads/events/EventMarker.java
  54. +28 −0 events/api/src/main/java/org/spongepowered/downloads/events/KafkaEvent.java
  55. +1 −1 events/outbox/build.gradle.kts
  56. +1 −1 events/outbox/src/main/java/module-info.java
  57. +24 −0 events/outbox/src/main/java/org/spongepowered/downloads/events/outbox/OutboxEvent.java
  58. +24 −0 events/outbox/src/main/java/org/spongepowered/downloads/events/outbox/OutboxProducer.java
  59. +24 −0 events/outbox/src/main/java/org/spongepowered/downloads/events/outbox/OutboxRepository.java
  60. +24 −0 events/outbox/src/main/java/org/spongepowered/downloads/events/outbox/OutboxService.java
  61. +24 −0 events/outbox/src/test/java/org/spongeopwered/downloads/outbox/test/DemoEvent.java
  62. +24 −0 events/outbox/src/test/java/org/spongeopwered/downloads/outbox/test/OutboxRepoTest.java
  63. +24 −0 events/outbox/src/test/java/org/spongeopwered/downloads/outbox/test/OutboxServiceTest.java
  64. +0 −12 events/src/main/java/org/spongepowered/downloads/events/EventMarker.java
  65. +0 −4 events/src/main/java/org/spongepowered/downloads/events/KafkaEvent.java
  66. +5 −0 gradle.properties
  67. +8 −4 gradle/libs.versions.toml
  68. +1 −1 settings.gradle.kts
22 changes: 22 additions & 0 deletions HEADER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
This file is part of ${name}, licensed under the MIT License (MIT).

Copyright (c) ${organization} <${url}>
Copyright (c) contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* This file is part of SystemOfADownload, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://spongepowered.org/>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.downloads.artifact.api;


Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* This file is part of SystemOfADownload, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://spongepowered.org/>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.downloads.artifact.api.mutation;

import com.fasterxml.jackson.annotation.JsonProperty;
@@ -70,10 +94,9 @@ record GitRepository(
@JsonTypeName("git-repos")
@Introspected
record GitRepositories(
@Pattern(regexp = GIT_URL_PATTERN,
message = "Invalid URL format")
@NotEmpty
@JsonProperty(required = true)
List<String> gitRepos
List<@Pattern(regexp = GIT_URL_PATTERN, message = "Invalid URL format") String> gitRepos
) implements Update {

}
Original file line number Diff line number Diff line change
@@ -24,32 +24,36 @@
*/
package org.spongepowered.downloads.artifact.api.query;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.util.List;

public final class ArtifactDetails {

@JsonSerialize
@JsonTypeInfo(use = JsonTypeInfo.Id.NONE)
public sealed interface Response {

record Ok(
String name,
String displayName,
String website,
String issues,
String gitRepo
) implements Response{
List<String> gitRepo
) implements Response {
}

record ValidRepo(String repoURL) implements Response {
}

record ValidRepo(String url) implements Response {}
record NotFound(String message) implements Response {
}

record NotFound(String message) implements Response {}
record Error(String message) implements Response {
}

record Error(String message) implements Response {}
record NotModified() implements Response {
}
}



}
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.spongepowered.downloads.artifact.api.Group;

@JsonTypeInfo(use = JsonTypeInfo.Id.NONE)
public sealed interface GroupResponse {

@JsonSerialize
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* This file is part of SystemOfADownload, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://spongepowered.org/>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.downloads.artifact.api.registration;

import com.fasterxml.jackson.annotation.JsonIgnore;
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* This file is part of SystemOfADownload, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://spongepowered.org/>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.downloads.artifact.api.test;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import jakarta.inject.Inject;
import jakarta.validation.Validator;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.spongepowered.downloads.artifact.api.query.GroupRegistration;

@MicronautTest(startApplication = false)
public class GropuRegistrationTest {

@Inject
Validator validator;


@Test
void testRegisterGroup() {
final var request = new GroupRegistration.RegisterGroupRequest(
"org.spongepowered", "SpongePowered", "https://spongepowered.org");
assertTrue(validator.validate(request).isEmpty());
}

@ParameterizedTest
@ValueSource(
strings = {
"",
" ",
"-.group.id",
"0invalid.ending.$"
}
)
void testInvlaidGroupIds(String groupId) {
final var request = new GroupRegistration.RegisterGroupRequest("example", groupId, "https://spongepowered.org");
assertFalse(validator.validate(request).isEmpty());
}


}
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* This file is part of SystemOfADownload, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://spongepowered.org/>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.downloads.artifact.api.test;


22 changes: 19 additions & 3 deletions artifacts/events/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@


plugins {
`java-library`
id("com.github.johnrengelman.shadow")
id("io.micronaut.library")
id("io.micronaut.test-resources")
id("io.micronaut.aot")
}

micronaut {

runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("org.spongepowered.downloads.outbox.*")
}
testResources {
enabled.set(true)
// sharedServer.set(true)
// additionalModules.addAll(KnownModules.R2DBC_POSTGRESQL)
}
}

dependencies {
api(project(":artifacts:api"))
api(project(":events"))

api(project(":events:api"))
}


6 changes: 3 additions & 3 deletions artifacts/events/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

exports org.spongepowered.downloads.artifacts.events;

requires org.spongepowered.downloads.artifacts.api;
requires com.fasterxml.jackson.databind;
requires org.spongepowered.downloads.events;
requires transitive org.spongepowered.downloads.artifacts.api;
requires transitive com.fasterxml.jackson.databind;
requires transitive org.spongepowered.downloads.events.api;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* This file is part of SystemOfADownload, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://spongepowered.org/>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.downloads.artifacts.events;

import com.fasterxml.jackson.annotation.JsonCreator;
@@ -6,7 +30,8 @@
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.spongepowered.downloads.artifact.api.ArtifactCoordinates;
import org.spongepowered.downloads.events.EventMarker;
import org.spongepowered.downloads.events.KafkaEvent;

import java.util.List;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
public sealed interface ArtifactEvent extends EventMarker {
@@ -44,6 +69,19 @@ record GitRepositoryAssociated(
}
}

@JsonTypeName("git-repositories-replacement")
@JsonDeserialize
record GitReposReplaced(
ArtifactCoordinates coordinates,
List<String> repository
) implements ArtifactEvent {

@JsonCreator
public GitReposReplaced {
}

}

@JsonTypeName("website")
@JsonDeserialize
record WebsiteUpdated(
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ record GroupRegistered(String groupId, String name, String website)

@JsonTypeName("artifact-registered")
@JsonDeserialize
final record ArtifactRegistered(ArtifactCoordinates coordinates) implements GroupUpdate {
record ArtifactRegistered(ArtifactCoordinates coordinates) implements GroupUpdate {

@JsonCreator
public ArtifactRegistered {
Loading