Implement centralized metadata system and eliminate content duplication#34
Implement centralized metadata system and eliminate content duplication#34DutchmanNL merged 5 commits intomainfrom
Conversation
Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive centralized metadata system to eliminate content duplication across the repository. The solution introduces a single source of truth for repository metadata and reusable content snippets, replacing scattered duplicate information with centralized configuration.
Key changes:
- Created centralized
config/metadata.jsonfor all repository metadata and configuration - Implemented reusable snippet system in
snippets/directory for commonly duplicated content - Enhanced existing scripts to use centralized metadata with fallback capabilities
- Added comprehensive testing and validation infrastructure
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test-centralized-metadata.sh | Comprehensive test suite for centralized metadata system and shared utilities |
| templates/initial-setup-automation.md | Updated to reference centralized snippets instead of duplicated content |
| templates/automated-template-update.md | Replaced duplicated version check command with snippet reference |
| snippets/version-management-commands.md | New reusable snippet for version management script documentation |
| snippets/version-check-command.md | New centralized version check command snippet |
| snippets/github-action-version-check.yml | Complete GitHub Action template for automated version monitoring |
| scripts/shared-utils.sh | New utility functions for accessing centralized metadata |
| scripts/manage-versions.sh | Enhanced with metadata integration and centralized version updates |
| scripts/extract-version.sh | Added metadata support with fallback capabilities |
| scripts/check-template-version.sh | Updated to use centralized metadata for dynamic URL generation |
| docs/testing.md | Replaced duplicated GitHub Action YAML with snippet reference |
| docs/maintenance.md | Updated to reference centralized snippets and removed duplicated content |
| docs/automated-updates.md | Enhanced with centralized snippet references |
| config/metadata.json | New centralized repository metadata and configuration file |
| config/README.md | Documentation for the centralized configuration system |
| README.md | Enhanced with centralized snippet content |
| .github/workflows/validate-consistency.yml | New GitHub Action for automated consistency validation |
Comments suppressed due to low confidence (1)
tests/test-centralized-metadata.sh:1
- Line 136 contains leftover content from documentation files that shouldn't be in this test script. This appears to be from a GitHub Action template and doesn't belong in the test output.
#!/bin/bash
scripts/shared-utils.sh
Outdated
| ".version") | ||
| grep '"version"' "$METADATA_FILE" 2>/dev/null | sed 's/.*"version": *"//;s/".*//' || echo "0.4.0" |
There was a problem hiding this comment.
The hardcoded fallback version '0.4.0' creates a maintenance burden. Consider extracting this to a variable or using a more dynamic approach to determine the fallback version.
There was a problem hiding this comment.
@copilot try to avoid a fixed version and trowh an error/failing if automation fails
There was a problem hiding this comment.
Removed the hardcoded "0.4.0" fallback and improved error handling. The shared utility functions now properly fail with descriptive error messages when automation fails, rather than falling back to fixed versions. This ensures issues are caught early rather than being masked. Commit: 9a667c5
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
using the script is for advanced users, move to that section. regular and best practise should stick to the automation
There was a problem hiding this comment.
Moved the manual version check script to the new "Advanced Usage" section in the README. Regular users are now guided to use the automated processes first, with manual commands available for advanced users who need more control. Commit: 9a667c5
scripts/shared-utils.sh
Outdated
| ".version") | ||
| grep '"version"' "$METADATA_FILE" 2>/dev/null | sed 's/.*"version": *"//;s/".*//' || echo "0.4.0" |
There was a problem hiding this comment.
@copilot try to avoid a fixed version and trowh an error/failing if automation fails
…e error handling Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
config/metadata.jsonas single source of truthscripts/shared-utils.shfor accessing metadatasnippets/directorytest-centralized-metadata.sh) for the new systemvalidate-consistency.yml) for automated validationDuplication Reduction Results
Before:
After:
config/metadata.json) as single source of truthNew Centralized Structure
Configuration:
config/metadata.json- Repository metadata and settingsconfig/README.md- Documentation for centralized systemReusable Snippets:
snippets/version-check-command.md- Standardized version check commandsnippets/github-action-version-check.yml- Complete GitHub Action templatesnippets/version-management-commands.md- Version management documentationEnhanced Scripts:
scripts/shared-utils.sh- Utility functions with robust error handling (no hardcoded fallbacks)Testing & Validation:
User Experience Improvements:
The repository now follows DRY principles with centralized configuration management, proper error handling without hardcoded fallbacks, and user-friendly organization that prioritizes automation while providing advanced options for power users.
Fixes #32.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.