-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#126: Update gradle to version 6.9.4 #156
Conversation
…of files gradle now expects annotation @InputFiles
…, made endpoint class serializable so gradle can track changes
…istProperty and cleaned up build.gradle for metapublisher
…be able to run the task
@edigonzales Ich konnte heute nun endlich das Update auf Gradle 6.9.4 fertigstellen. Ein paar letzte Knacknüsse haben das etwas verzögert. 😅 Bitte schau dir den PR doch an. Ich habe im PR Beschrieb eine Zusammenfassung der wichtigsten Änderungen gemacht. |
@@ -4,21 +4,23 @@ | |||
|
|||
import ch.so.agi.gretl.logging.GretlLogger; | |||
import ch.so.agi.gretl.logging.LogEnvironment; | |||
import kotlin.jvm.Transient; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ist das eine von Gradle bereitgestellte Abhängigkeit? Was macht das genau? Und warum nur in dieser Klasse? In anderen Klassen, wo Gretllogger verwendet wird, braucht es transient nicht.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edigonzales Nice catch. :) Der Import konnte entfernt werden, ich hatte zuerst probiert transient als Annotation zu benutzen. Das geht aber nur in Kotlin. Ich habe vergessen den Import wieder zu entfernen.😅
Transient ist ein Java Keyword, welches einem Objekt, welches Serializable implementiert (hier Connector.java) sagt, dass das mit transient markierte Property nicht serialisiert werden soll. Das hat grundsätzlich nichts mit dem GretlLogger an sich zu tun, sondern hängt mit dem Connector Objekt zusammen. Wir verwenden z.B. in CsvExport.java ein Connector Objekt als Taskinput. Damit Gradle den Cache korrekt aufbauen kann, um zu sehen, ob sich Objekte verändert haben zwischen zwei Runs, muss alles serialisierbar sein. Gradle wirft einen Fehler, wenn Connector.java das Serializable Interface nicht implementiert. Der GretlLogger ist ansonsten nicht Teil eines Objektes, welches als Taskinput verwendet wird, daher benötigt es nicht an jeder Stelle wo der GretlLogger vorkommt das transient Keyword.
Warum ich die zwei Properties im Connector als transient markiert habe: Beim GretlLogger macht es aus meiner Sicht keinen Sinn diesen zu serialisieren. Der Status des Objektes wird durch den Logger nicht beeinflusst. Das Connection Objekt (Connection dbConnection) kann ich nicht serialisierbar machen, da es sich um eine Klasse handelt, die von Java zur Verfügung gestellt wird. Spielt hier aber auch keine Rolle, da sich die Connection in Abhängigkeit von dbUri, dbUser und dbPassword verändert und wir Änderungen also schon tracken.
Anmerkung zum Logger: Dieser wird im Connector gar nicht benötigt. Könnte man diesen auch einfach entfernen?
Versteht man da die Logik? @optional mit @internal ersetzen, dünkt mich komisch. Da ich dachte, dass @internal schon was anderes aussagt, als optional. Das hat keine für uns relevanten Auswirkungen, dass es nicht mehr @InputFile ist, nehme ich an? Und das müssten optionale Parameter gewesen sein, oder?
Ja, wenn es jetzt in jedem DB-Task vorkommt. Können wir noch diskutieren. |
} | ||
|
||
|
||
@Internal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@optional muss neu mit z.B. @input kombiniert werden (https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/Optional.html). Ich habe dieses Property mit @internal markiert, da aus meiner Sicht @input hier nicht passt. Das Property wird immer auf Basis anderer Properties (Regions/Region) gesetzt. Für den Up-To-Date Check ist es daher nicht nötig, dieses auch noch zu berücksichtigen, da es sich gezwungenermassen ändert, sobald sich Region oder Regions auch ändert.
Ich habe dir im Publisher.java File direkt einen Kommentar diesbezüglich gemacht und bin alle Stellen mit @internal nochmals durchgegangen. Bei einigen war es möglich @input zu setzen, da habe ich wohl nicht genug gut geschaut, ob das Property auch von extern gesetzt werden können soll.
Also Auswirkungen hat es schon. @InputFile ist speziell auf Files ausgerichtet und kann z.B. auch schauen ob sich der Inhalt geändert hat. Das ist vorallem auch für inkrementelle Builds interessant. @input kann das nicht, dort wird nur geschaut, ob sich das File noch am selben Ort befindet oder nicht. Zitat aus der Dokumentation von Gradle: This will cause the task to be considered out-of-date when the file path or contents have changed. Es waren nicht alle Orte als optional markiert. In folgenden Files musste ich die Anpassungen vornehmen:
Du musst einschätzen, wo es allenfalls möglich wäre eine existierende Datei vorauszusetzen und wo nicht. Ich gehe auch davon aus, dass es nicht in allen Fällen relevant ist ob sich der Inhalt verändert hat oder nicht.
Ich habe einen Task in unserem Project Board erstellt: #157 |
…hat is expected as the property input
…the property input type
@@ -41,7 +39,8 @@ public class CsvExport extends DefaultTask { | |||
public Connector getDatabase() { | |||
return database; | |||
} | |||
@Input | |||
|
|||
@OutputFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edigonzales Konnte ich als OutputFile annotieren. Das passt nun auch besser zur Logik.
* In this case the file does not have to exist for the task to run. | ||
*/ | ||
@Input | ||
@OutputFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edigonzales Auch hier passt OutputFile besser als Annotation.
@@ -23,7 +23,7 @@ public class Ili2gpkgImport extends Ili2gpkgAbstractTask { | |||
private Boolean createMetaInfo = false; | |||
private Boolean createGeomIdx = false; | |||
|
|||
@Input | |||
@InputFiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edigonzales Hier habe ich gesehen, dass vorausgesetzt wird, dass die InputFiles bestehen (zumindest ist der Test so aufgebaut). Deshalb habe ich hier die Annotation auch angepasst.
|
||
/* | ||
Input kann hier FileCollection, File oder String sein. | ||
*/ | ||
@Input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edigonzales Hier muss es @input bleiben, da man eine FileCollection, ein File oder einen String (Ili ID) übergeben kann.
/* | ||
* @InputFile kann hier nicht verwendet werden, da die Datei existieren muss. | ||
* Bei einem ersten Run dieses Tasks kann es sein, dass die Datei noch nicht existiert. | ||
*/ | ||
@Input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hier wäre @OutputFile nicht logisch aus meiner Sicht. Auch @InputFile passt irgendwie nicht. In der TaskAction wird mit dem Pfad dann eine Datei erstellt/geholt. Daher habe ich @input gelassen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -34,7 +31,7 @@ public Connector getDatabase() { | |||
return database; | |||
} | |||
|
|||
@Input | |||
@OutputFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edigonzales hier konnte ich ebenfalls OutputFile verwenden.
* In this case the file does not have to exist for the task to run. | ||
*/ | ||
@Input | ||
@OutputFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edigonzales Auch hier macht OutputFile mehr Sinn.
@edigonzales Du kannst nochmals über den PR schauen. An den Stellen an welchen ich @input mit @OutputFile ersetzen konnte habe ich dir einen kurzen Kommentar gemacht. So findest du diese einfacher. :) |
@Saela Bin kein Git-Experte. Squash and merge ist i.O.? |
ja squash merge passt👍🏻 |
* #126: Update gradle to version 6.9.4 (#156) * #126: Update to gradle 6.9.4 * #126: Update custom task according to 6.9.4 user guide * #126: Update custom task according to 6.9.4 user guide * #126: Update custom task according to 6.9.4 user guide * #126: Update some more custom tasks * #126: finish updating rest of custom tasks * #126: fix gradle warnings * #126: fix gradle download sha * #126: fix gradle warnings about usage of deprecated parts * #126: update missing tasks to use getters * #126: fix missing getters * #126: fix warnings from run * #126: remove @internal if the field is already marked as @optional * #126: Fix @optional annotations * #126: Fix @optional annotations * #126: add setters * #126: make connector serializable so gradle doesn't throw an error anymore * #126: Fix wrong input annotation * #126: Fix groovy string interpolation issue * #126: Fix file input error due to new gradle restriction. For a list of files gradle now expects annotation @InputFiles * #126: Fix file input error due to new gradle restriction * #126: Fix file input annotations * #126: Fix another file input annotation * #126: Fixed lazy configuration of publisher publishedRegions property, made endpoint class serializable so gradle can track changes * #126: Fixed issue with not existing dummy file, harmonized usage of ListProperty and cleaned up build.gradle for metapublisher * #126: Update gradle annotation as file doesn't have to exist * #126: Update gradle annotation as data file doesn't have to exist to be able to run the task * #126: fix annotations * #126: mark fields with @optional if they don't have to be provided * #126: remove commented code * #126: Remove unused import * #126: Removed @nullable in combination with @internal, Re-Checked @internal usage * #126: Add description for using @input instead of @InputFile * #126: Update file property of csv export task to make it more clear what is expected as the property input * #126: Update file property to make it more clear what is expected as the property input type * #126: use output file annotation to make it clearer what is expected * #126: update annotations for file outputs and inputs --------- Co-authored-by: Sabrina Wullschleger <[email protected]> * #127: Upgrade gradle to version 7.6.4 (#158) * #127: remove deprecated jcenter repository * #127: Add latest gradle 7 version, add duplicates strategy for integration test resources --------- Co-authored-by: Sabrina Wullschleger <[email protected]> * #128: Upgrade to gradle version 8.7 (#159) * #127: remove deprecated jcenter repository * #127: Add latest gradle 7 version, add duplicates strategy for integration test resources * #128: Upgrade to gradle 8.7 --------- Co-authored-by: Sabrina Wullschleger <[email protected]> * #129: Clean up gradle files (#160) * #129: remove oracle dependency (already added in gretl jar) * #129: clean up commented parts, activate db plugin tests * #129: clean up commented parts, update integration of oracle dependency * #129: fix configuration syntax --------- Co-authored-by: Sabrina Wullschleger <[email protected]> * #131 Switch to versioning catalog (#163) * #1231: add new versioning file, migrate libraries to new versioning * #131: rename clashing dependencies * #131: fix issue with libs syntax, add libs from runtime image, add plugins * #131: fix db driver * #131: remove old dependencies file --------- Co-authored-by: Sabrina Wullschleger <[email protected]> * Update README.md * #132 Update selected tasks to use lazy configuration (#165) * #132: Update user documentation (repos were missing in sample) * #132: Update SqlExecutor.java to use lazy configuration * #132: Adjust sqlexecutor test jobs to register tasks lazily * #132: move constructing connector object to taskutil for better reusability * #132: rewrite db2dbtask to use lazy configuration, rewrite build.gradle files in test jobs folders * #132: rewrite Ili2pg - Task group to use lazy configuration, update respective build.gradle files * #132: fix IDE warnings * #132: fix minor issues after migration to lazy configuration * #132: improve naming * #132: updated gzip task to use lazy configuration, updated annotations, minor refactoring * #132: fix property api errors for ili2pg, re-write range property as gradle doesn't support this * #132: fix range error in ili2pg tasks * #132: fix boolean value naming * #132: fix boolean value getter * #132: fix wrong init value for exception filter * #132: rewrite tasks in gradle files to use register --------- Co-authored-by: Sabrina Wullschleger <[email protected]> * Feature/151 homogenisierung testcode (#166) * wip: homogenizing tests Signed-off-by: Daniel Kubányi <[email protected]> * wip: homogenizing tests Signed-off-by: Daniel Kubányi <[email protected]> * feat: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * wip: homogenisierung testcode * wip: homogenisierung testcode * feat: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * wip: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * wip: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * wip: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * wip: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * feat: homogenize test code Signed-off-by: Daniel Kubányi <[email protected]> * chore: cleanup Signed-off-by: Daniel Kubányi <[email protected]> --------- Signed-off-by: Daniel Kubányi <[email protected]> * feat: use maxParallelForks (#169) * Feature/134 update junit (#168) * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * chore: cleanup Signed-off-by: Daniel Kubányi <[email protected]> * fix: jarTest Signed-off-by: Daniel Kubányi <[email protected]> * fix: PublisherStepDb2LocalTest * feat: use junit5 in integration tests --------- Signed-off-by: Daniel Kubányi <[email protected]> * Feature/136 testcontainers (#171) * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * chore: cleanup Signed-off-by: Daniel Kubányi <[email protected]> * fix: jarTest Signed-off-by: Daniel Kubányi <[email protected]> * wip: testcontainers localstack * wip: testcontainers localstack * feat: use localstack for AWS testcontainers * wip: use localstack * wip: use localstack * wip: use localstack * fix: PublisherStepDb2LocalTest * wip: localstack * feat: use junit5 in integration tests * fix: revert failing tests Signed-off-by: Daniel Kubányi <[email protected]> * wip: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * wip: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * feat: use testcontainers Signed-off-by: Daniel Kubányi <[email protected]> * feat: use testcontainers Signed-off-by: Daniel Kubányi <[email protected]> * fix: s3 tests Signed-off-by: Daniel Kubányi <[email protected]> * fix: s3 tests Signed-off-by: Daniel Kubányi <[email protected]> * fix: s3 tests Signed-off-by: Daniel Kubányi <[email protected]> * fix: s3 tests Signed-off-by: Daniel Kubányi <[email protected]> * fix: resolve merge conflicts Signed-off-by: Daniel Kubányi <[email protected]> --------- Signed-off-by: Daniel Kubányi <[email protected]> Co-authored-by: Daniel Kubanyi <[email protected]> * Feature/146 update to java 11 (#172) * #146: Update to java 11 (adoptium) * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * wip: update junit4 to junit5 Signed-off-by: Daniel Kubányi <[email protected]> * chore: cleanup Signed-off-by: Daniel Kubányi <[email protected]> * fix: jarTest Signed-off-by: Daniel Kubányi <[email protected]> * wip: testcontainers localstack * wip: testcontainers localstack * feat: use localstack for AWS testcontainers * wip: use localstack * wip: use localstack * wip: use localstack * fix: PublisherStepDb2LocalTest * wip: localstack * feat: use junit5 in integration tests * fix: revert failing tests Signed-off-by: Daniel Kubányi <[email protected]> * wip: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * wip: improve code quality Signed-off-by: Daniel Kubányi <[email protected]> * feat: use testcontainers Signed-off-by: Daniel Kubányi <[email protected]> * feat: use testcontainers Signed-off-by: Daniel Kubányi <[email protected]> * fix: s3 tests Signed-off-by: Daniel Kubányi <[email protected]> * fix: s3 tests Signed-off-by: Daniel Kubányi <[email protected]> * fix: s3 tests Signed-off-by: Daniel Kubányi <[email protected]> * fix: s3 tests Signed-off-by: Daniel Kubányi <[email protected]> * feat: update iox-wkf to 2.0.0 Signed-off-by: Daniel Kubányi <[email protected]> * fix: change deprecated com.vividsolutions classes to org.locationtech Signed-off-by: Daniel Kubányi <[email protected]> * fix: change deprecated com.vividsolutions classes to org.locationtech Signed-off-by: Daniel Kubányi <[email protected]> * fix: revert some imports Signed-off-by: Daniel Kubányi <[email protected]> * fix: ShpExportTest Signed-off-by: Daniel Kubányi <[email protected]> * fix: build.gradle of Ili2pgImportFileSetTest feat: use constants in integration tests feat: add exclusion group for iox dependency Signed-off-by: Daniel Kubányi <[email protected]> * fix: integration tests Signed-off-by: Daniel Kubányi <[email protected]> * experimental: disable duckdb test Signed-off-by: Daniel Kubányi <[email protected]> * experimental: disable Csv2ParquetTest Signed-off-by: Daniel Kubányi <[email protected]> * fix: incorrect jdk tag used, won't build for arm64 architecture Signed-off-by: Daniel Kubányi <[email protected]> * fix: image tag Signed-off-by: Daniel Kubányi <[email protected]> * fix: integration tests Signed-off-by: Daniel Kubányi <[email protected]> --------- Signed-off-by: Daniel Kubányi <[email protected]> Co-authored-by: Sabrina Wullschleger <[email protected]> Co-authored-by: Daniel Kubanyi <[email protected]> * fix: use user functions from v 2.4.X (#175) Signed-off-by: Daniel Kubányi <[email protected]> * feature/#135: Migrate from custom runner to test kit (#173) * #135: add new gradle task to generate plugin txt file for testkit * #135: add helper method to run testkit tests or docker tests * #135: update tests with new test runner call * #135: update additional tests with new test runner call * #135: update last tests with new test runner call * #135: update gitignore and remove result files from source code --------- Co-authored-by: Sabrina Wullschleger <[email protected]> * chore: update gradle (#176) Signed-off-by: Daniel Kubányi <[email protected]> * use upload-artifact@v3 * bump version number * rename some dependencies in libs.versions.toml * fix eclipse project (_is accessible from more than one module_) * add source and target compatibility * [Dockerfile] use older base image with older alpine version (that runs on openshift) * Update Gradle in Dockerfile (adjust to projects Gradle version) * [Dockerfile] clean Dockerfile * clean up comments * clean formatting * clean formatting * clean s3 unit tests * clean s3 integration tests * add missing file for s3 test * fix localstack dependency on aws sdk v1 * update localstack container * Move Docker build to Gradle tasks (#190) * remove aws plugin in docker build / clean libs.versions.toml * clean libs.versions.toml * add docker build image tastk / start adjusting pipeline * work on pipeline * work on pipeline * Feature/157 connector refactor (#174) * wip: connector Signed-off-by: Daniel Kubányi <[email protected]> * wip: connector Signed-off-by: Daniel Kubányi <[email protected]> * wip: connector Signed-off-by: Daniel Kubányi <[email protected]> * wip: connector Signed-off-by: Daniel Kubányi <[email protected]> * Revert "wip: connector" This reverts commit c995ec9. * Revert "wip: connector" This reverts commit 2135a4c. * wip: connector Signed-off-by: Daniel Kubányi <[email protected]> * wip: connector Signed-off-by: Daniel Kubányi <[email protected]> * wip: connector Signed-off-by: Daniel Kubányi <[email protected]> * Revert "wip: connector" This reverts commit dd98bda. * fix: connector Signed-off-by: Daniel Kubányi <[email protected]> * fix: review Signed-off-by: Daniel Kubányi <[email protected]> * fix: review Signed-off-by: Daniel Kubányi <[email protected]> --------- Signed-off-by: Daniel Kubányi <[email protected]> * update gradle wrapper / parameterize gretl dependency in runtimeImage build.gradle --------- Signed-off-by: Daniel Kubányi <[email protected]> Co-authored-by: Sabrina Wullschleger <[email protected]> Co-authored-by: Sabrina Wullschleger <[email protected]> Co-authored-by: Daniel Kubányi <[email protected]> Co-authored-by: Daniel Kubanyi <[email protected]>
Das Update auf Gradle 6.9.4 hat einige Changes mit sich gebracht. Hier eine Liste der wichtigsten Änderungen:
getProject().getObjects().listProperty(String.class)
initialisiert, daher machte eine Harmonisierung sowieso Sinn.Daneben gab es noch einige weitere, kleinere Anpassungen. Die Hauptarbeit musste jedoch in den Tasks gemacht werden.