feat: add bulk operations, migrate command, and datetime timestamps#43
Merged
feat: add bulk operations, migrate command, and datetime timestamps#43
Conversation
Adds 50 new tests targeting low-coverage modules: - ProtoImportFixer class: init, find_pb_files, fix_file, fix_all - MigrationSyntax: fix_migration_file with various SQL patterns - MdxSyntax: fix_mdx_issues, process_file - InternalLinks: fix_links_in_content, fix_links_in_file, process_directory - CodeBlocksProper: fix_code_blocks function - DocsModule: fix_trailing_whitespace, fix_code_fence_languages, fix_blank_lines_before_fences, fix_blank_lines_after_fences - CLI: bootstrap command with various guides - Schemas: all frontmatter types with complete field validation Coverage improvement: 67.81% → 68.91% (+1.1%) Key module improvements: - proto_imports.py: 54.67% → 90.67% (+36%) - cli.py: 79.85% → 84.98% (+5%) Co-Authored-By: Claude <noreply@anthropic.com>
Removed modules that were leftovers from the source repository and not relevant to general documentation validation: - proto_imports.py - HashiCorp-specific protobuf import fixing - migration_syntax.py - PostgreSQL migration file fixing (Goose) - broken_links.py - Hardcoded prism-data-layer/netflix link patterns - code_blocks_proper.py - Duplicate of code_blocks.py - mdx_code_blocks.py - Duplicate with project-specific directories Also removed corresponding test files and updated test_bug_fixes.py and test_coverage_improvements.py to remove references to deleted modules. Test count: 620 → 552 (68 tests removed with deprecated modules) Co-Authored-By: Claude <noreply@anthropic.com>
…mands Adds new `bulk` command group with three subcommands: - `bulk update`: Set, add, remove, or rename frontmatter fields across multiple documents with --type filtering and --dry-run preview - `bulk timestamps`: Derive created/updated timestamps from git history, migrates legacy 'date' field to created/updated format - `bulk migrate`: Comprehensive schema migration that adds missing project_id, generates doc_uuid, normalizes id/tags, and derives timestamps from git history Also updates templates: - All templates now use consistent created/updated datetime format (ISO 8601 UTC: YYYY-MM-DDTHH:MM:SSZ) - Templates include generation snippets as comments for each field - doc_uuid placeholder standardized to 00000000-0000-4000-8000-000000000000 - ADR template uses created/updated instead of legacy 'date' field Co-Authored-By: Claude <noreply@anthropic.com>
deciders is the team/person who made the decision, not the author. The author field (in RFC/Memo/PRD) uses git config user.name. Co-Authored-By: Claude <noreply@anthropic.com>
- ADRFrontmatter now uses `created` and `updated` fields like other doc types - Legacy `date` field is deprecated and auto-migrated by bulk migrate command - Updated all ADR tests to use new schema fields - Schema maintains consistency: ADRs use `deciders`, other types use `author` Co-Authored-By: Claude <noreply@anthropic.com>
- Update timestamps.py to generate full datetime (YYYY-MM-DDTHH:MM:SSZ) instead of date-only format - Update schemas.py to accept datetime | date | str for flexibility - Move migrate command from bulk subgroup to top-level command - Update tests to expect new datetime format Co-Authored-By: Claude <noreply@anthropic.com>
- Use ternary operator for date_str assignment (SIM108) - Format schemas.py Co-Authored-By: Claude <noreply@anthropic.com>
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
bulkcommand group withupdateandtimestampssubcommands for bulk frontmatter operationsmigratecommand for comprehensive schema migration (project_id, doc_uuid, tag normalization, date→created/updated)created/updatedfields instead of legacydatefieldNew Commands
docuchango migratedocuchango bulk updatedocuchango bulk timestampsSchema Changes
created/updatedfields instead of legacydatefielddatetime | date | strfor flexibilityTest plan
docuchango migratesuccessfully migrates 100+ files in target repositorydocuchango validatepasses after migration🤖 Generated with Claude Code