Skip to content

refactor(scripts): replace licenses directory with symlink - #25

Merged
trumpyla merged 7 commits into
mainfrom
refactor/24-licenses-symlink
Oct 20, 2025
Merged

refactor(scripts): replace licenses directory with symlink#25
trumpyla merged 7 commits into
mainfrom
refactor/24-licenses-symlink

Conversation

@trumpyla

Copy link
Copy Markdown
Member

Summary

Replace licenses/ directory with a symlink to .legal/artagon-license/licenses/ to eliminate duplicate files and ensure automatic synchronization with the artagon-license submodule.

Problem

The licenses/ directory currently contains copied files from .legal/artagon-license/licenses/, causing:

  • Duplicate files: Same content stored in two locations
  • Sync issues: Changes to source files require manual re-copying
  • Maintenance burden: Must remember to update both locations
  • Larger repository: Duplicated files increase repo size

Solution

Replace the directory with a symlink:

licenses -> .legal/artagon-license/licenses/

Changes

artagon-common (this repo)

  • Replace licenses/ directory with symlink
  • Add scripts/repo_validate.sh with license symlink validation
  • Update .legal/artagon-license submodule reference

artagon-license submodule

  • Update scripts/export-license-assets.sh to create symlink instead of copying files
  • Handle existing directory/symlink cases
  • Remove LICENSE_FILES array (no longer needed)

Benefits

  • ✅ No duplication - single source of truth
  • ✅ Automatic sync with submodule updates
  • ✅ Reduced repository size (-1580 lines, +1014 lines = net -566 lines)
  • ✅ Simpler maintenance
  • ✅ Files remain accessible at same paths

Testing

  • Verified symlink creation
  • Verified license files accessible through symlink
  • Verified export-license-assets.sh creates symlink correctly
  • Verified repo_validate.sh checks for symlink
  • All script syntax validated

Backward Compatibility

No breaking changes: Files remain accessible at licenses/ paths. Git tracks the symlink, not the target files.

Files Changed

  • 10 files: +1,014 insertions, -1,580 deletions
  • Net reduction: 566 lines

Closes #24

Replace licenses/ directory with symlink to .legal/artagon-license/licenses
to avoid file duplication and ensure automatic synchronization.

Changes:
- Replace licenses/ directory with symlink
- Update repo_validate.sh to check for symlink
- Update artagon-license submodule with export script changes

Benefits:
- Eliminates duplicate license files
- Automatic sync with artagon-license submodule
- Single source of truth for license content
- Reduced repository size

Closes #24
Copilot AI review requested due to automatic review settings October 20, 2025 17:30

Copilot AI 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.

Pull Request Overview

This PR replaces the licenses/ directory with a symlink to .legal/artagon-license/licenses/ to eliminate duplicate license files. It also adds repository validation to ensure the symlink is properly configured and updates the artagon-license submodule reference.

  • Adds repo_validate.sh script to validate repository structure including license symlink verification
  • Removes duplicate license files (6 files totaling ~1580 lines)
  • Creates symlink from licenses to .legal/artagon-license/licenses

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

File Description
scripts/repo_validate.sh New validation script that checks for proper license symlink configuration
licenses/* Removed duplicate license files (LICENSE-AGPL.txt, LICENSE-COMMERCIAL.txt, LICENSING.md, CLA.md, CLA-CORPORATE.md, SOURCE-FILE-HEADER.txt, TRADEMARK-POLICY.md)
licenses Created as symlink pointing to .legal/artagon-license/licenses
.legal/artagon-license Updated submodule reference

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread licenses Outdated
trumpyla and others added 4 commits October 20, 2025 13:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Multiple improvements to repository setup and validation scripts:

repo_setup.sh:
- Add --build-system flag for C/C++ projects (cmake|bazel)
- Fix Nix submodule handling to support both SSH and HTTPS protocols
- Add protocol fallback when adding artagon-nix submodule
- Fix heredoc quoting in README generation

repo_validate.sh:
- Fix directory detection to only search existing src/include dirs
- Prevent errors when directories don't exist
- Use safer find command with conditional directory list

tests:
- Add test for --build-system flag documentation
- Update arithmetic operations to use safer $((expr)) syntax
- Add test_repo_validate_detection.sh for project type detection
- Improve test reliability and error handling

nix submodule:
- Update to include flake.lock files for C and Rust templates
Update nix submodule reference to include flake.lock files for C and
Rust templates, ensuring reproducible builds.
Resolved conflicts in scripts/repo_validate.sh:
- Kept safer directory detection (only searches existing directories)
- Kept license symlink validation (core feature of PR #25)
- Used bash-style test syntax for consistency
@trumpyla trumpyla changed the title refactor(licenses): replace licenses directory with symlink refactor(scripts): replace licenses directory with symlink Oct 20, 2025
@trumpyla
trumpyla merged commit d72f496 into main Oct 20, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(licenses): replace licenses directory with symlink to avoid duplicates

2 participants