Fix #11: Refactor GitLab tasks into 'core' package for documentation visibility#12
Fix #11: Refactor GitLab tasks into 'core' package for documentation visibility#12hariomch1 wants to merge 1 commit intokestra-io:mainfrom
Conversation
| @@ -0,0 +1 @@ | |||
| {"uuid":"00d39e44-4ea5-4998-9c54-48696a007e22","historyId":"ea0d4a0042ac13ecffc6105bcb30012a","testCaseId":"[engine:junit-jupiter]/[class:io.kestra.plugin.gitlab.CreateIssueTest]/[method:testCreateIssue()]","testCaseName":"testCreateIssue()","fullName":"io.kestra.plugin.gitlab.CreateIssueTest.testCreateIssue","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:io.kestra.plugin.gitlab.CreateIssueTest]/[method:testCreateIssue()]"},{"name":"host","value":"fedora"},{"name":"thread","value":"106662@fedora.Test worker(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"io.kestra.plugin.gitlab.CreateIssueTest"},{"name":"testClass","value":"io.kestra.plugin.gitlab.CreateIssueTest"},{"name":"testMethod","value":"testCreateIssue"},{"name":"suite","value":"io.kestra.plugin.gitlab.CreateIssueTest"}],"links":[],"name":"testCreateIssue()","status":"passed","stage":"finished","description":"","steps":[],"attachments":[],"parameters":[],"start":1761580197201,"stop":1761580198341} No newline at end of file | |||
There was a problem hiding this comment.
Can you remove allure-results from the changes please?
| @@ -0,0 +1,4 @@ | |||
| /** | |||
There was a problem hiding this comment.
Remove this comment and add a @PluginSubGroup annotation like the other package-info.java.
|
@hariomch1 You also have to rename the package in the examples in the tasks. |
|
The tests also have to be moved to the |
60375af to
bdaa176
Compare
|
Did you have time to check my last feedback @hariomch1? In addition, could you duplicate the icon(s) in |
|
yes i made some changes but it fails all checks please review |
| @@ -0,0 +1 @@ | |||
| {"uuid":"00d8eeae-c77f-4494-9f27-35afe7785f4a","historyId":"6aee8db7e21f7172305178a6239aa033","testCaseId":"[engine:junit-jupiter]/[class:io.kestra.plugin.gitlab.CreateIssueTest]/[method:testCreateIssueWithMinimalData()]","testCaseName":"testCreateIssueWithMinimalData()","fullName":"io.kestra.plugin.gitlab.CreateIssueTest.testCreateIssueWithMinimalData","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:io.kestra.plugin.gitlab.CreateIssueTest]/[method:testCreateIssueWithMinimalData()]"},{"name":"host","value":"fedora"},{"name":"thread","value":"106662@fedora.Test worker(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"io.kestra.plugin.gitlab.CreateIssueTest"},{"name":"testClass","value":"io.kestra.plugin.gitlab.CreateIssueTest"},{"name":"testMethod","value":"testCreateIssueWithMinimalData"},{"name":"suite","value":"io.kestra.plugin.gitlab.CreateIssueTest"}],"links":[],"name":"testCreateIssueWithMinimalData()","status":"passed","stage":"finished","description":"","steps":[],"attachments":[],"parameters":[],"start":1761580198352,"stop":1761580198514} No newline at end of file | |||
There was a problem hiding this comment.
Could you remove the allure-results folder from the diff please?
There was a problem hiding this comment.
Could you remove the allure-results folder from the diff please?
"Confirmed, I've removed the file and added allure-results/ to .gitignore. Ready for final review!"
| @NoArgsConstructor | ||
|
|
||
| @Aliases({ | ||
| // Alias points to the old package path |
There was a problem hiding this comment.
Hmm no aliases = {"..."} on each core task inside the @Plugin annotation, not here 🙏
| protected String buildApiEndpoint(String resource, RunContext runContext) throws IllegalVariableEvaluationException { | ||
| String renderedApiPath = runContext.render(this.apiPath).as(String.class).orElse("/api/v4/projects"); | ||
| String renderedProjectId = runContext.render(this.getProjectId()).as(String.class).orElseThrow(); | ||
| String renderedProjectId = runContext.render(this.projectId).as(String.class).orElseThrow(); |
There was a problem hiding this comment.
Unrelated change to remove from the PR
| """ | ||
| ) | ||
| }) | ||
| @Aliases({ |
There was a problem hiding this comment.
No it's to add inside the @Plugin annotation in aliases
d817aa9 to
d67d670
Compare
| @@ -0,0 +1 @@ | |||
| {"uuid":"05469e84-3317-4c8e-b6fb-0e4799750840","historyId":"fd2df4c6f1fed89b5fc7de49dccffb7c","testCaseId":"[engine:junit-jupiter]/[class:io.kestra.plugin.gitlab.MergeRequestTest]/[method:testCreateMergeRequestNotFound()]","testCaseName":"testCreateMergeRequestNotFound()","fullName":"io.kestra.plugin.gitlab.MergeRequestTest.testCreateMergeRequestNotFound","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:io.kestra.plugin.gitlab.MergeRequestTest]/[method:testCreateMergeRequestNotFound()]"},{"name":"host","value":"fedora"},{"name":"thread","value":"106662@fedora.Test worker(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"io.kestra.plugin.gitlab.MergeRequestTest"},{"name":"testClass","value":"io.kestra.plugin.gitlab.MergeRequestTest"},{"name":"testMethod","value":"testCreateMergeRequestNotFound"},{"name":"suite","value":"io.kestra.plugin.gitlab.MergeRequestTest"}],"links":[],"name":"testCreateMergeRequestNotFound()","status":"passed","stage":"finished","description":"","steps":[],"attachments":[],"parameters":[],"start":1761580202472,"stop":1761580202573} No newline at end of file | |||
There was a problem hiding this comment.
@hariomch1 Could you remove allure-results folder from the changes 🙏 ?
There was a problem hiding this comment.
i added this to gitignore and remove also from git tracking index
43c0d99 to
f0af3d6
Compare
src/main/java/io/kestra/plugin/gitlab/core/issues/package-info.java
Outdated
Show resolved
Hide resolved
src/main/java/io/kestra/plugin/gitlab/core/AbstractGitLabTask.java
Outdated
Show resolved
Hide resolved
src/main/java/io/kestra/plugin/gitlab/core/AbstractGitLabTask.java
Outdated
Show resolved
Hide resolved
| @@ -1,5 +1,6 @@ | |||
| package io.kestra.plugin.gitlab.issues; | |||
| package io.kestra.plugin.gitlab.core.issues; | |||
There was a problem hiding this comment.
No... You have to keep the tasks that were in the issues package...
The target tasks to move in io.kestra.plugin.gitlab.core are ONLY the one in the root package io.kestra.plugin.gitlab.
| @@ -1,5 +1,6 @@ | |||
| package io.kestra.plugin.gitlab; | |||
| package io.kestra.plugin.gitlab.core; | |||
There was a problem hiding this comment.
Only this class must be moved to core package
…entation visibility
8c11144 to
18781b1
Compare
|
I'm closing this PR, I'm taking back this part because you deleted tasks in your changes... 👍 |
fixes #11
What changes are being made and why?
The primary goal is to resolve a documentation visibility issue where the automatic documentation generator failed to discover all tasks when they were spread across the root package and sub-packages.
This PR implements the requested refactoring:
AbstractGitLabTask.java,MergeRequest.java, and the entireissuessub-package) were moved from the root package (io.kestra.plugin.gitlab) into a new standardized sub-package:io.kestra.plugin.gitlab.core.@PluginSubGroupannotation was moved to the newcorepackage (package io.kestra.plugin.gitlab.core;).package-info.javafile was added to the nestedissuespackage (io.kestra.plugin.gitlab.core.issues) to ensure proper documentation of that task group.This structural change ensures the Kestra documentation system correctly recognizes and displays all GitLab tasks.
Closes #11How the changes have been QAed?
This change is a structural refactor (moving code) and metadata update, not a feature addition. QA was performed by verifying code integrity and functionality:
./gradlew shadowJarto confirm the Java code compiles in the new package structure../gradlew testto confirm all unit tests pass (15 passing), ensuring no existing functionality was broken by the file moves.Setup Instructions
No external setup (API keys, accounts, etc.) is required, as this change only affects the internal packaging of the plugin.
Contributor Checklist ✅
fix(plugin-gitlab): ...)closes #ISSUE_IDorfixes #ISSUE_IDin the description if the PR relates to an opened issue. (IncludedCloses #11)@Schemafor properties and outputs,@Pluginwith examples,README.mdfile with basic knowledge and specifics). (N/A for this refactor, butpackage-info.javawas updated).rnotrendered(eg:rHost).runContext.logger()to log enough important infos where it's needed and with the best level (DEBUG, INFO, WARN or ERROR).⚙️ Properties
Property<T>carrier type, do not use@PluginProperty.@NotNulland checked during the rendering.Property<Map<String, Object>>.🌐 HTTP
io.kestra.core.http.client📦 JSON
@JsonIgnoreProperties(ignoreUnknown = true)at the mapped class level. So that we will avoid to crash the plugin if the provider add a new field suddenly.io.kestra.core.serializers)✨ New plugins / subplugins
package-info.javaunder each sub package respecting this format and choosing the right category. (Added to.coreand.core.issues)src/main/resources/iconsin SVG format and not in thumbnail (keep it big):-
plugin-icon.svg- One icon per package, e.g.
io.kestra.plugin.aws.svg- For subpackages, e.g.
io.kestra.plugin.aws.s3, addio.kestra.plugin.aws.s3.svgSee example here.
"{{ secret('YOUR_SECRET') }}"in the examples for sensible infos such as an API KEY.Property<FetchType> fetchTypeto be able to useFETCH_ONE,FETCHand evenSTOREto store big amount of data in the internal storage."""to close examples blocks with the flow id.🧪 Tests
RunContextto actually run tasks). (Existing tests confirmed passing)src/test/resources/flows..github/setup-unit.sh(which can be executed locally and in the CI) all along with a newdocker-compose-ci.ymlfile (do not edit the existingdocker-compose.yml).📤 Outputs
VoidOutput.