feat!: simplify bean linking with explicit parent and blocks fields#17
Merged
feat!: simplify bean linking with explicit parent and blocks fields#17
Conversation
Replace generic `links` array with explicit `parent` (scalar) and `blocks` (array) fields. Breaking changes: - YAML format: `links` array replaced with `parent` and `blocks` fields - CLI: `--link type:id` replaced with `--parent id` and `--block id` - CLI: `--unlink type:id` replaced with `--no-parent` and `--unblock id` - GraphQL: `addLink`/`removeLink` mutations replaced with `setParent`/`addBlock`/`removeBlock` - GraphQL: `Link` type removed, `Bean` type now has `parent` and `blocks` fields directly - Removed "duplicates" and "related" link types entirely New features: - Parent type validation enforces hierarchy rules (milestone cannot have parent, epic can only have milestone as parent, etc.) - Simpler YAML format: `parent: <id>` and `blocks: [<id>, ...]` - Cleaner GraphQL API with direct field access Migration: - Old beans with `links` array will be automatically migrated when read - "duplicates" and "related" links will be silently dropped during migration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
7517424 to
a293ee5
Compare
- Migrate beans-thi to use `parent:` instead of `links: - parent:` - Update prompt.tmpl to document new relationship model - Replace old GraphQL filter examples (linkedAs, noLinks) with new ones (isBlocked, noParent) - Document --parent/--no-parent CLI flags instead of --epic/--milestone
- Add filterByNotBlocked function to filters.go - Update resolver to handle both true and false values for isBlocked - Add test for isBlocked: false case
- Rename YAML frontmatter field from `blocks` to `blocking` - Rename GraphQL fields: `blockIds` → `blockingIds`, `blocks` → `blocking` - Rename GraphQL mutations: `addBlock` → `addBlocking`, `removeBlock` → `removeBlocking` - Rename GraphQL filters: `hasBlocks` → `hasBlocking`, `noBlocks` → `noBlocking` - Rename CLI flags: `--has-blocks` → `--has-blocking`, `--no-blocks` → `--no-blocking` - Rename Go methods: `BlocksBean` → `IsBlocking`, `AddBlock` → `AddBlocking`, `RemoveBlock` → `RemoveBlocking` - Update internal link type from "blocks" to "blocking" - Add migration support for old `blocks` field in frontmatter 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Rename CLI flags for consistency with field names - Harmonize flag descriptions between create and update commands - Clarify "link" terminology in archive/delete help text to specify "parent or blocking" relationships - Update prompt.tmpl documentation to match new flag names
- Rename --no-parent to --remove-parent - Rename --unblocking to --remove-blocking - Rename --untag to --remove-tag - Add blockingId filter to GraphQL schema - Remove unused Link type and migration code - Remove KnownLinkTypes constant - Clean up gqlgen.yml Link model binding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
linksarray with explicitparent(scalar) andblocks(array) fields--parent,--no-parent,--block,--unblockLinktypeBreaking Changes
YAML Format
CLI
--link parent:<id>→--parent <id>--link blocks:<id>→--block <id>--unlink parent:<id>→--no-parent--unlink blocks:<id>→--unblock <id>GraphQL
addLink/removeLinkmutations →setParent/addBlock/removeBlockLinktype removedBean.links→Bean.parentandBean.blocksParent Type Validation
Migration
Old beans with
linksarray will be automatically migrated when read and saved in the new format. "duplicates" and "related" links will be silently dropped.Test plan
go test ./...)mise build)