Skip to content

storage(lifecycle): use RegisterCLICommand pattern#855

Merged
natalie-o-perret merged 1 commit into
sc-184182/bucket-lifecyclefrom
natalie-o-perret/lifecycle-struct-pattern
Jul 2, 2026
Merged

storage(lifecycle): use RegisterCLICommand pattern#855
natalie-o-perret merged 1 commit into
sc-184182/bucket-lifecyclefrom
natalie-o-perret/lifecycle-struct-pattern

Conversation

@natalie-o-perret

@natalie-o-perret natalie-o-perret commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

Rewrites the lifecycle commands to use the struct-based RegisterCLICommand pattern, consistent with newer commands like cmd/aiservices/deployment/.

Changes:

  • set, show, delete converted to typed structs with RegisterCLICommand
  • Parent command simplified (redundant zone flag and helper func removed)

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block, and add the Pull Request #number for each bit you add to the CHANGELOG.md)
  • Testing

Testing

Build and full test suite pass (make build && make test-verbose). Lint clean.

@natalie-o-perret natalie-o-perret requested a review from a team July 1, 2026 13:57
@natalie-o-perret natalie-o-perret marked this pull request as draft July 1, 2026 14:01
@natalie-o-perret

Copy link
Copy Markdown
Contributor Author

[SC-187336]

@natalie-o-perret natalie-o-perret changed the title storage(lifecycle): use RegisterCLICommand pattern + add AGENTS.md storage(lifecycle): use RegisterCLICommand pattern Jul 1, 2026
@natalie-o-perret natalie-o-perret force-pushed the natalie-o-perret/lifecycle-struct-pattern branch from 8a6f696 to 52f758e Compare July 1, 2026 14:20
@natalie-o-perret natalie-o-perret marked this pull request as ready for review July 1, 2026 14:21

@quentinalbertone quentinalbertone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea ! Do you think that you can move the storage_bucket_lifecycle* into a subpackage ? You can find an example in the aiservices package

@natalie-o-perret

natalie-o-perret commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

good idea ! Do you think that you can move the storage_bucket_lifecycle* into a subpackage ? You can find an example in the aiservices package

I've just signed off, 🚇-typing, but the idea is that we can drive the people using "AI" for external contributions with the AGENTS.md, (#856) file sitting now at the root of the repo.

Ironically-speaking, I precisely gave the AI services as an example to develop rule for the LLM to grasp the structure / pattern, and it didn't pick it on its own 😂, I will further adjust the rules there so that next time it picks it up.

Good catch anyway, thanks!


Addressed

natalie-o-perret added a commit that referenced this pull request Jul 2, 2026
PR #855 refactored storage_bucket_lifecycle* in place, keeping the
flat layout in cmd/storage/. Review feedback asked for them to be moved
into a subpackage along the lines of cmd/aiservices/deployment/.

Add a paragraph to AGENTS.md that names the legacy flat groups and
points the agent at the cmd/aiservices/... subpackage layout, with
the storage_bucket_lifecycle case as the worked example.
natalie-o-perret added a commit that referenced this pull request Jul 2, 2026
PR #855 refactored storage_bucket_lifecycle* in place, keeping the
flat layout in cmd/storage/. Review feedback asked for them to be moved
into a subpackage along the lines of cmd/aiservices/deployment/.

Three small tweaks so a future agent picks this up automatically:

- Folder layout: add an anti-pattern callout naming the legacy flat
  groups (cmd/storage, cmd/dns, cmd/dbaas), the cmd/aiservices/deployment
  subpackage as the canonical pattern, and the storage_bucket_lifecycle
  case as a worked example. Wording is imperative ("MUST promote").
- Command pattern: cross-ref to Folder layout so an agent starting
  from the struct pattern doesn't miss the placement cue.
- File header rule: parametrize the model name (<model>) instead of
  hard-coding claude-sonnet-4.6.
@natalie-o-perret natalie-o-perret force-pushed the natalie-o-perret/lifecycle-struct-pattern branch from 52f758e to ead38f6 Compare July 2, 2026 09:31
@natalie-o-perret natalie-o-perret merged commit 42798d0 into sc-184182/bucket-lifecycle Jul 2, 2026
7 checks passed
@natalie-o-perret natalie-o-perret deleted the natalie-o-perret/lifecycle-struct-pattern branch July 2, 2026 09:39
natalie-o-perret added a commit that referenced this pull request Jul 2, 2026
# Description

Follow-up to #856. PR #855 refactored `storage_bucket_lifecycle*` in
place; review asked to move them into a subpackage per
`cmd/aiservices/deployment/`. AGENTS.md missed the placement cue: 3
tweaks so a future agent picks this up automatically:

- **Folder layout**: anti-pattern callout naming the legacy flat groups
(`cmd/storage`, `cmd/dns`, `cmd/dbaas`), `cmd/aiservices/deployment/` as
the canonical subpackage, and `storage_bucket_lifecycle*` as a worked
example. Wording imperative (`MUST promote`).
- **Command pattern**: cross-ref to Folder layout so an agent starting
from the struct pattern doesn't skip placement.
- **File header rule**: parametrize the model name (`<model>`) instead
of pinning to `claude-sonnet-4.6`.

## Checklist
(For exoscale contributors)

* [ ] Changelog updated (under *Unreleased* block, and add the Pull
Request #number for each bit you add to the `CHANGELOG.md`)
* [ ] Testing

## Testing

Docs-only.

---

> [!NOTE]
> AI assistance: PR description.
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.

3 participants