Skip to content

Conversation

@jmjava
Copy link
Owner

@jmjava jmjava commented Jan 10, 2026

No description provided.

jmjava added 23 commits January 10, 2026 11:40
- Create config.sh.example template for user configuration
- Add config-loader.sh utility for loading config with backward compatibility
- Update safety-checks.sh to use UPSTREAM_ORG and YOUR_GITHUB_USER variables
- Update list-embabel-repos.sh to use configuration variables
- Update fork-all-embabel.sh and clone-embabel-repos.sh to use config
- Update monitor-embabel.sh to use configurable repo list (MONITOR_REPOS)
- Update setup-aliases.sh to generate aliases dynamically based on config

All scripts now support configuration via config.sh while maintaining
backward compatibility with hardcoded defaults (embabel/jmjava).

Part of refactor/generify branch to make the workspace usable for any GitHub organization.
… scripts

- Update setup-upstreams.sh to use UPSTREAM_ORG and YOUR_GITHUB_USER
- Refactor sync-upstream.sh to be fully generic:
  - Removes hardcoded guide/agent repos
  - Uses MONITOR_REPOS or auto-detects from BASE_DIR
  - Uses generic upstream org and user variables
- Update my-contributions.sh to use configuration variables
- All scripts now use block_upstream_push instead of block_embabel_push
- Update check-sync-status.sh to use configuration and support generic repos
- Remove hardcoded guide/agent repos, use MONITOR_REPOS or auto-detect
- Update reset-to-upstream.sh to use UPSTREAM_ORG and YOUR_GITHUB_USER
- Both scripts now work with any repository name, not just hardcoded ones
- Update remote URLs to use generic variables
…n-commit, and prepare-commit-summaries

- Update compare-branches.sh to use MONITOR_REPOS or auto-detect repos
- Update view-pr.sh to accept any repo-name instead of hardcoded guide/agent
- Update analyze-pr-impact.sh to use generic repo-name parameter
- Update explain-commit.sh to use generic repo-name parameter
- Update prepare-commit-summaries.sh to use generic repo-name parameter

All scripts now accept any repository name from BASE_DIR and use UPSTREAM_ORG variable.
- Replace hardcoded guide/agent repos with loop over MONITOR_REPOS
- Update PR checking to iterate over all configured repos
- Update releases checking to iterate over all configured repos
- Update recent commits checking to iterate over all configured repos
- Use UPSTREAM_ORG and BASE_DIR variables
- Update get-embabel-summary.sh to use UPSTREAM_ORG and configuration
- Update list-fork-urls.sh to use YOUR_GITHUB_USER and BASE_DIR from config
- Both scripts now load configuration automatically
- Update generate-catch-up.sh to iterate over configured repos instead of hardcoded guide/agent
- Update generate-weekly-notes.sh to use MONITOR_REPOS and iterate over configured repos
- Replace hardcoded embabel/jmjava references with UPSTREAM_ORG/YOUR_GITHUB_USER variables
- Update PR checking, releases, and sync status to work with any configured repos
- Update action items generation to loop over all configured repos
- Update safe-push.sh to use block_upstream_push and check_upstream_repo (with backward compat aliases)
- Update install-git-safety-hooks.sh to use generic functions and UPSTREAM_ORG/YOUR_GITHUB_USER
- Update review-pr-workflow.sh to accept any repo-name instead of hardcoded guide/agent
- Update open-workspace.sh to generate workspace file dynamically from MONITOR_REPOS
- Update setup-git-remote.sh to use LEARNING_DIR and generic organization checks
- Update prep-for-discussion.sh and review-my-pr.sh to use configuration
- Update generate-daily-checklist.sh to load configuration (template is user-facing)

All scripts now work with any GitHub organization and user.
- Fix heredoc variable expansion issue by using echo statements instead
- Generate workspace folders dynamically from MONITOR_REPOS
- Use WORKSPACE_NAME from configuration
- Replace hardcoded 'embabel' with UPSTREAM_ORG variable
- Fix variable name from REPO to REPO_NAME
- Add configuration section at top of README.md
- Update Quick Start to include configuration setup
- Update all examples to use generic variables (UPSTREAM_ORG, YOUR_GITHUB_USER, BASE_DIR)
- Make safety section generic (works with any upstream organization)
- Update usage examples to use generic repo names
- Create comprehensive CONFIGURATION.md guide with:
  - Quick start instructions
  - All configuration variables explained
  - Multiple examples (Embabel, Spring, Apache, Custom)
  - Troubleshooting guide
  - Advanced configuration options

The workspace is now fully generic and documented for use with any GitHub organization.
- Create lightweight, self-contained test framework (test-framework.sh)
- Add unit tests for config-loader.sh (configuration loading, defaults, warnings)
- Add unit tests for safety-checks.sh (commit/push blocking, repo detection)
- Add test runner script (run-tests.sh)
- Add comprehensive test README.md with examples and documentation

Test framework features:
- No external dependencies (pure bash)
- Assertion functions (assertTrue, assertEquals, assertContains, etc.)
- Color output (green for pass, red for fail)
- Automatic test discovery
- Setup/teardown functions
- Summary reporting

Tests are working but need some refinements for result aggregation across multiple test files.
- Fix test result parsing to correctly extract counts from output
- Fix safety-checks tests to properly source functions
- Improve test file execution to prevent infinite loops
- Add verification documentation (VERIFICATION.md)
- Fix setUp/tearDown to use unique test directories per test

Tests are now verified to be running:
- 19 total tests executed
- 16 tests passing
- 3 tests failing (safety-checks functions need proper loading)

Test framework is functional and tests are executing correctly.
- Add .env-template for embabel-learning scripts with user/org settings
- Update config-loader.sh to load .env file (takes precedence over config.sh)
- Update CONFIGURATION.md to document .env usage as recommended method
- Update README.md to mention .env file as primary configuration option
- Add .env-template for guide application with Neo4j and API keys
- Add scripts/load-env.sh helper script for guide Spring Boot app
- Update guide README.md with .env configuration documentation
- Both .env and config.sh are supported (.env takes precedence)

.env files are git-ignored and contain user-specific settings.
Backward compatible with existing config.sh files.
- Update .env-template to clarify that YOUR_GITHUB_USER is personal username
- Update CONFIGURATION.md to explain UPSTREAM_ORG can be different from user org
- Add examples showing monitoring different organizations
- Clarify that UPSTREAM_ORG is the organization to monitor, not user's org
- Add real-world examples of monitoring embabel while having different username

Key point: YOUR_GITHUB_USER is your personal account (for forks),
UPSTREAM_ORG is the organization you want to monitor (can be different).
- Update testConfigLoaderWarningMessage to check for new warning message
- Update testConfigLoaderNoDuplicateWarnings to use new warning text
- Tests now check for 'No configuration file found' instead of 'config.sh not found'
- All tests now pass (19/19)
- Clarify that YOUR_GITHUB_USER is username, not org name
- Add guidance for testing vs production scenarios
- Add example for jmjava/menkelabs/embabel scenario
- Explain that personal org (menkelabs) is better for testing
- Explain that monitoring org (embabel) is for production use
- Update .env-template with testing vs production notes

Key distinction:
- YOUR_GITHUB_USER = personal username (jmjava)
- Personal org (menkelabs) = good for testing
- UPSTREAM_ORG (embabel) = organization to monitor in production
- Add TEST_UPSTREAM_ORG parameter to .env-template for test organization
- Update config-loader.sh to use TEST_UPSTREAM_ORG when TEST_MODE=true
- Update run-tests.sh to set TEST_MODE=true before loading config
- Update CONFIGURATION.md to document TEST_UPSTREAM_ORG feature

Benefits:
- No manual switching between test and production orgs
- Production scripts always use UPSTREAM_ORG (e.g., embabel)
- Test scripts automatically use TEST_UPSTREAM_ORG (e.g., menkelabs)
- Clear separation of test vs production configurations
- Safer testing with personal orgs

Usage:
  UPSTREAM_ORG=embabel         # Production
  TEST_UPSTREAM_ORG=menkelabs  # Testing (optional)
- Add block-upstream-commit as local pre-commit hook
- Hook runs safety checks (block_upstream_commit) on every commit
- Loads config-loader.sh to get UPSTREAM_ORG from .env
- Safety checks now run automatically alongside ggshield
- All commits from scripts will run both ggshield and safety checks

This ensures:
- Secret scanning (ggshield) runs on every commit
- Safety checks prevent commits to upstream org repos
- Both hooks run automatically, no manual intervention needed
- Run pre-commit migrate-config to fix deprecated stage names
- Configuration now uses current pre-commit standards
- All hooks still working correctly
- Update 'What's Included' section to list safety checks
- Document that safety checks use UPSTREAM_ORG from .env
- Update 'How It Works' section to mention pre-commit hooks
- Add safety checks to 'What Gets Checked' table
- Clarify that all commits automatically run both ggshield and safety checks
- Document that hooks run automatically on every commit

Key points:
- GitGuardian (ggshield) runs on every commit
- Safety checks (block-upstream-commit) run on every commit
- Both hooks are integrated into pre-commit framework
- Uses UPSTREAM_ORG from .env configuration
- All hooks run automatically, no manual intervention needed
- Configure ggshield to run on pre-push stage (in addition to pre-commit)
- Add block-upstream-push hook for pre-push stage
- Create block-upstream-push-hook.sh wrapper script for pre-push hooks
- Update README to document that git push invokes hooks automatically
- Update 'What Gets Checked' table to show push hooks
- Fix detect-secrets false positive in commit summary file

Answer to user question:
✅ YES - git push will work in embabel-learning repo
✅ YES - git push WILL invoke GitGuardian (ggshield) hooks automatically
✅ YES - git push WILL invoke safety checks (block-upstream-push) automatically

When you run git push:
  1. ggshield (GitGuardian) runs automatically
  2. block-upstream-push (safety checks) runs automatically
  3. All other pre-push hooks run automatically

This ensures:
- Secret scanning on every push (ggshield)
- Safety checks prevent pushes to upstream org repos
- All hooks run automatically, no manual steps needed
@jmjava jmjava merged commit fa8cb5e into master Jan 10, 2026
1 check passed
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.

1 participant