Skip to content

feat: replace hardcoded ~/lf/ with dynamic linuxfoundation org discovery#7

Open
niravpatel27 wants to merge 1 commit intomainfrom
dynamic-repo-discovery
Open

feat: replace hardcoded ~/lf/ with dynamic linuxfoundation org discovery#7
niravpatel27 wants to merge 1 commit intomainfrom
dynamic-repo-discovery

Conversation

@niravpatel27
Copy link
Collaborator

Summary

  • Skills now auto-detect where linuxfoundation org repos are cloned by inspecting git remotes instead of assuming ~/lf/
  • Discovery chain: current repo parent → common directory scan (~/lf, ~/code, ~/projects, etc.) → LFX_REPOS_DIR_OVERRIDE env var → ask user
  • Repo scan validates each directory has a linuxfoundation remote (HTTPS or SSH), rather than blindly listing everything

Files changed

  • lfx-test-journey/SKILL.md — Full discovery logic replacing hardcoded ~/lf/ scan
  • lfx-coordinator/SKILL.md — Discovery snippet in Step 3 research + dynamic path in prose
  • lfx-research/SKILL.md — Discovery snippet for local repo detection + updated rules
  • README.md — Updated auto-discovery description

Test plan

  • grep -rn '~/lf/' --include='*.md' returns zero matches
  • All bash discovery snippets pass bash -n syntax check
  • Regex github\.com[:/]linuxfoundation/ covers both HTTPS and SSH remotes
  • Running from inside a linuxfoundation repo correctly resolves the parent directory
  • LFX_REPOS_DIR_OVERRIDE env var takes precedence when set

Skills now auto-detect where linuxfoundation repos are cloned by
inspecting git remotes, instead of assuming ~/lf/. The discovery
chain: current repo parent → common directory scan → env var
override → ask user.

Signed-off-by: Nirav Patel <npatel@linuxfoundation.org>
Copilot AI review requested due to automatic review settings March 17, 2026 20:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the LFX skill documentation to stop assuming repos live under ~/lf/ by introducing linuxfoundation org repo discovery based on Git remotes, and reflecting that behavior in the README and related skills.

Changes:

  • Replaced the hardcoded ~/lf/ repo scan in /lfx-test-journey with a remote-based discovery + validation scan.
  • Added discovery snippets to /lfx-research and /lfx-coordinator for locating local linuxfoundation repos.
  • Updated README wording to describe auto-discovery via linuxfoundation GitHub remotes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
lfx-test-journey/SKILL.md Adds multi-step repo directory discovery and scans only repos with linuxfoundation remotes.
lfx-research/SKILL.md Updates “prefer local reads” guidance with an auto-detected local repos directory snippet.
lfx-coordinator/SKILL.md Updates Step 3 research instructions to use auto-discovered local repo paths instead of ~/lf/.
README.md Updates the /lfx-test-journey quick start description to match new discovery behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Once `LFX_REPOS_DIR` is resolved, scan it for repos that belong to the `linuxfoundation` org:

```bash

```bash
for dir in "$LFX_REPOS_DIR"/*/; do
if [ -d "$dir/.git" ] && git -C "$dir" remote -v 2>/dev/null | grep -q 'github\.com[:/]linuxfoundation/'; then
Comment on lines +95 to +96
if [ -d "$candidate" ] && find "$candidate" -maxdepth 2 -name .git -type d 2>/dev/null | while read gitdir; do git -C "$(dirname "$gitdir")" remote -v 2>/dev/null | grep -q 'github\.com[:/]linuxfoundation/' && echo found && break; done | grep -q found; then
LFX_REPOS_DIR="$candidate"; break
done
fi
[ -n "${LFX_REPOS_DIR_OVERRIDE:-}" ] && LFX_REPOS_DIR="$LFX_REPOS_DIR_OVERRIDE"
# Then check: ls -d "$LFX_REPOS_DIR"/lfx-v2-*-service 2>/dev/null
Comment on lines +67 to +69
for candidate in ~/lf ~/code ~/projects ~/workspace ~/src ~/dev; do
if [ -d "$candidate" ] && find "$candidate" -maxdepth 2 -name .git -type d 2>/dev/null | while read gitdir; do git -C "$(dirname "$gitdir")" remote -v 2>/dev/null | grep -q 'github\.com[:/]linuxfoundation/' && echo found && break; done | grep -q found; then
LFX_REPOS_DIR="$candidate"; break
LFX_REPOS_DIR="$(dirname "$(git rev-parse --show-toplevel)")"
else
for candidate in ~/lf ~/code ~/projects ~/workspace ~/src ~/dev; do
if [ -d "$candidate" ] && find "$candidate" -maxdepth 2 -name .git -type d 2>/dev/null | while read gitdir; do git -C "$(dirname "$gitdir")" remote -v 2>/dev/null | grep -q 'github\.com[:/]linuxfoundation/' && echo found && break; done | grep -q found; then
if [ -z "$LFX_REPOS_DIR" ]; then
for candidate in ~/lf ~/code ~/projects ~/workspace ~/src ~/dev; do
if [ -d "$candidate" ]; then
match=$(find "$candidate" -maxdepth 2 -name .git -type d 2>/dev/null | while read gitdir; do
Comment on lines +73 to +75
[ -n "${LFX_REPOS_DIR_OVERRIDE:-}" ] && LFX_REPOS_DIR="$LFX_REPOS_DIR_OVERRIDE"
# Check for local Go repos
ls -d ~/lf/lfx-v2-*-service 2>/dev/null
ls -d "$LFX_REPOS_DIR"/lfx-v2-*-service 2>/dev/null
LFX_REPOS_DIR="$(dirname "$(git rev-parse --show-toplevel)")"
else
for candidate in ~/lf ~/code ~/projects ~/workspace ~/src ~/dev; do
if [ -d "$candidate" ] && find "$candidate" -maxdepth 2 -name .git -type d 2>/dev/null | while read gitdir; do git -C "$(dirname "$gitdir")" remote -v 2>/dev/null | grep -q 'github\.com[:/]linuxfoundation/' && echo found && break; done | grep -q found; then
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.

3 participants