Add a flag to give an exit code if there are still pages left for
repos ls? #498
I have a number of processes that pull in all the repositories of a given organization (website generation, ebook, some metadata processing). I'm using
tea to download the repositories as part of a CI/CD pipeline without having to remember what is in the repository. In effect, using the organization's repository list as the source of truth.
tea repos ls --limit 200 doesn't really return 200 entries, I would like some ability to determine if there is more data available. At the moment, I'm just fudging the page count with this:
for p in 1 2 3 4 5 6 7 8 9 10
for i in $(tea repos ls --login mfgames --page $p --output simple | grep fedran-sources | cut -f 4 -d ' ')
echo magic happens
It would be nice if there was some way of knowing that there is more pages so I can change it from an arbitrary number of pages to always grabbing only the needed amount.
At the moment, exit codes seem to be a useful manner of doing that but today's code returns
0 for a page retrieval, so to use an exit code might include
--more-pages-exit-code 2 or something like that? Or another mechanism that would let me know how many pages I need to retrieve.
You don't get 200 results, because you can't query arbitrary page sizes. the maximum is configured server side and can be queried at
/api/v1/settings/api. Maybe tea should provide a helper for that.
I'm not a fan of the exit code as notification channel for this - people may run tea in scripts with
set -e, halting the script in that case.
Maybe something like
more results - listing 10-20 of 50could be emitted on stderr? This solution would depend on #456
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?