Skip to content
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

Manage NullPointerException when namespaceFiles.enabled property is not true #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bellec1u
Copy link

@bellec1u bellec1u commented Oct 4, 2024

What changes are being made and why?

Manage the case when the property namespaceFiles.enabled is not true.

The objective of this pull request is to be able to not commit the namespace files to a git repository.

Note

This case can be reached by using false as value.

So maybe the main issue seems coming from the @PluginProperty annotation as lombok set it at null ?
Why not using native boolean ?

Moreover, I'm not able to exclude them via namespaceFiles.exclude

Example:

- id: test
  type: io.kestra.plugin.get.Push
  namespaceFiles:
    enabled: false
  ...

Execution result:

java.long.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "io.kestra.core.models.tasks.NamespaceFiles.getEnabled()" is null

How the changes have been QAed?

tasks:
  - id: working_directory
    type: io.kestra.plugin.core.flow.WorkingDirectory
    tasks:

    - id: pull
      type: io.kestra.plugin.git.Clone
      url: "{{ my_repo_url }}"
      branch: "{{ my_branch }}"
      username: "{{ my_username}}"
      password: "{{ my_password }}"

  # do some tasks in order to do changes on the git repository files

    - id: push
      type: io.kestra.plugin.git.Push
      namespaceFiles:
        enabled: false
      flows:
        enabled: false
      branch: "{{ my_branch }}"
      username: "{{ my_username}}"
      password: "{{ my_password }}"
      commitMessage: "{{ my_commit_message }}"

@Skraye Skraye force-pushed the master branch 4 times, most recently from a670228 to a003ba9 Compare November 5, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To review
Development

Successfully merging this pull request may close these issues.

1 participant