Skip to content

fix(list): report the stored row count as size with STORE - #42

Merged
Malaydewangan09 merged 2 commits into
kestra-io:mainfrom
PedroHenrique0713:fix/store-size
Oct 27, 2026
Merged

Malaydewangan09 merged 2 commits into
kestra-io:mainfrom
PedroHenrique0713:fix/store-size

Conversation

@PedroHenrique0713

@PedroHenrique0713 PedroHenrique0713 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What changes are being made and why?

Closes #37.

Every List task in the plugin returned size: 0 with fetchType: STORE, even though the rows were written to the stored file and total was right. toPageOutput in AbstractDigitalOceanTask took the size from rows or row, and both are empty with STORE. It showed up in the QA report on #25 (8 rows stored, size: 0).

With STORE, size is now the number of rows written to the file, as it is with FETCH. FETCH, FETCH_ONE and NONE are unchanged.


How the changes have been QAed?

  • New test in droplet.ListTest: two droplets with STORE give size: 2, total: 2, no rows, and two lines in the stored file. It fails on main (was <0>) and passes with the fix. The full suite passes and ./gradlew javadoc is clean.
  • Ran this flow on Kestra 2.0.5 against a small local mock returning 3 droplets (baseUrl pointed to the mock; drop it to hit the real API):
id: digitalocean_list_droplets_store
namespace: company.team

tasks:
  - id: list_droplets
    type: io.kestra.plugin.digitalocean.droplet.List
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    fetchType: STORE

  - id: log_counts
    type: io.kestra.plugin.core.log.Log
    message: "size={{ outputs.list_droplets.size }} total={{ outputs.list_droplets.total }} stored at {{ outputs.list_droplets.uri }}"

Before / after

Before: size=0 total=3

After: size=3 total=3

Before: size=0 total=3 After: size=3 total=3


Contributor Checklist ✅

@kestrabot kestrabot Bot added area/plugin Plugin-related issue or feature request kind/external Pull requests raised by community contributors labels Oct 26, 2026
@github-project-automation github-project-automation Bot moved this to To review in Pull Requests Oct 26, 2026
@kestrabot
kestrabot Bot requested a review from a team October 26, 2026 20:43
@kestrabot
kestrabot Bot requested a review from Malaydewangan09 October 26, 2026 20:43
@Malaydewangan09

Copy link
Copy Markdown
Member

Thanks, the fix is right. I checked that the new test fails on main.

I made a few changes on top. fetchOutput now returns the size with each result, with the count from FileSerde.writeAll for STORE, so toPageOutput no longer guesses the mode from null fields. The size description and the javadoc now say what NONE returns, and the test reads the stored rows with FileSerde and uses nullValue().

I pushed these tweaks.

@Malaydewangan09
Malaydewangan09 merged commit 156a8c4 into kestra-io:main Oct 27, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from To review to Done in Pull Requests Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/plugin Plugin-related issue or feature request kind/external Pull requests raised by community contributors

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

DigitalOcean: List tasks report size 0 when fetchType is STORE

2 participants