Skip to content

feat: add manage:list-external-buckets command - #108

Closed
jirkasemmler wants to merge 1 commit into
mainfrom
jirka/list-external-buckets
Closed

feat: add manage:list-external-buckets command#108
jirkasemmler wants to merge 1 commit into
mainfrom
jirka/list-external-buckets

Conversation

@jirkasemmler

Copy link
Copy Markdown
Contributor

Changes:

  • Adds manage:list-external-buckets, a read-only stack-wide audit of external buckets (buckets with hasExternalSchema). For each one it reports the created date, the isReadOnly flag, whether the bucket is linked from elsewhere, and whether KBC.description metadata is set.
  • Documents it in the README next to storage:force-unlink-shared-buckets.

Written while investigating why descriptions were missing on older external buckets (DMD-1496), where the cause turned out to be isReadOnly on buckets created before that flag changed meaning. Keeping the command means the next person does not have to rebuild the query.

Implementation notes:

  • Creates a 15-minute Storage token per project and drops it in a finally block, so a listing failure does not leak tokens.
  • Projects the manage token cannot reach are reported and counted as skipped rather than aborting the run, which matters on stacks where not every project is accessible.
  • De-duplicates projects that appear under more than one maintainer/organization.
  • Writes CSV to stdout with the header projectId,projectName,bucketId,created,isReadOnly,linked,hasDescription,description, so it can be redirected straight to a file. Progress and summary lines are prefixed with #.

phpcs, phpstan (level 9), phpunit and a CLI boot check all pass. Not run against any real stack.

Split out of #106 — it is unrelated to the workspace tooling that PR consolidates.


Additional notes

⚠️ Don't forget to release new version after merge

Read-only stack-wide audit of external buckets (buckets with hasExternalSchema),
reporting created date, the isReadOnly flag, whether the bucket is linked from
elsewhere, and whether KBC.description metadata is set.

Written while investigating why descriptions were missing on older external
buckets (DMD-1496), where the answer turned out to be isReadOnly on buckets
created before the flag changed meaning. Output is CSV on stdout so it can be
redirected straight to a file; progress and summary lines are prefixed with #.

Creates a 15-minute Storage token per project and drops it in a finally block,
so a listing failure does not leak tokens. Projects the manage token cannot
reach are reported and counted as skipped rather than aborting the run, which
matters on stacks where not every project is accessible.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jirkasemmler
jirkasemmler force-pushed the jirka/list-external-buckets branch from 4432d2e to c7b4ec2 Compare August 3, 2026 14:00
@jirkasemmler

Copy link
Copy Markdown
Contributor Author

tbh nevim kdo to chce, zaviram. si navajbi znova

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant