Required task inputs fail at runtime instead of validation (Build.dockerfile/tags, Stop.containerId)

Open Beginner friendly
#154 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, java
Domain
devops

Research direction

Inspect src/main/java/io/kestra/plugin/docker/cli/Build.java around the dockerfile and tags fields and their use in run(), then inspect Stop.java around containerId and its run() method. Confirm that missing or empty required inputs fail validation and that containerId appears in the main group instead of connection.

Written by the indexing model from the issue text.

Description

area/plugin good first issue kind/quick-win
Describe the issue

plugin-docker

Build: dockerfile and tags can fail at runtime instead of validation

Summary
Build derives required inputs without null/empty validation, so bad input throws a raw exception at execution time rather than failing flow validation up front.

Locationsrc/main/java/io/kestra/plugin/docker/cli/Build.java

  • dockerfile field (~L157) has no @NotNull, but run() calls runContext.render(this.dockerfile)...orElseThrow() (~L258).
  • tags is @NotNull (guards null, not empty), and run() calls tags.iterator().next() (~L251) to derive the registry.

Impact

  • Omitting dockerfile passes validation, then throws NoSuchElementException/orElseThrow at runtime.
  • An empty tags: [] passes @NotNull, then throws NoSuchElementException.

Suggested fix
Add @NotNull to dockerfile (or validate before use) and @NotEmpty/@Size(min = 1) to tags.


Stop: containerId lacks @NotNull and is mis-grouped

Summary
containerId is the required primary input but is neither validated nor grouped as such.

Locationsrc/main/java/io/kestra/plugin/docker/cli/Stop.java

  • containerId (~L59-64) is @PluginProperty(group = "connection") with no @NotNull.
  • run() calls ...containerId...orElseThrow() (~L88-94).

Impact
Omitting containerId throws a raw NoSuchElementException at runtime instead of failing validation; the property also renders under "connection" instead of "main" in the UI.

Suggested fix
Add @NotNull and move it to group = "main".

Environment
  • Kestra Version: rc10
  • Latest plugin version
Dominant language
Java
Stars
4
Forks
7
Avg merge
4d 14h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kestra-io/plugin-docker

All issues in kestra-io/plugin-docker

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.