feat: replace hardcoded ~/lf/ with dynamic linuxfoundation org discovery#7
Open
niravpatel27 wants to merge 1 commit intomainfrom
Open
feat: replace hardcoded ~/lf/ with dynamic linuxfoundation org discovery#7niravpatel27 wants to merge 1 commit intomainfrom
niravpatel27 wants to merge 1 commit intomainfrom
Conversation
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>
Contributor
There was a problem hiding this comment.
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-journeywith a remote-based discovery + validation scan. - Added discovery snippets to
/lfx-researchand/lfx-coordinatorfor locating locallinuxfoundationrepos. - Updated README wording to describe auto-discovery via
linuxfoundationGitHub 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 |
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
linuxfoundationorg repos are cloned by inspecting git remotes instead of assuming~/lf/~/lf,~/code,~/projects, etc.) →LFX_REPOS_DIR_OVERRIDEenv var → ask userlinuxfoundationremote (HTTPS or SSH), rather than blindly listing everythingFiles changed
lfx-test-journey/SKILL.md— Full discovery logic replacing hardcoded~/lf/scanlfx-coordinator/SKILL.md— Discovery snippet in Step 3 research + dynamic path in proselfx-research/SKILL.md— Discovery snippet for local repo detection + updated rulesREADME.md— Updated auto-discovery descriptionTest plan
grep -rn '~/lf/' --include='*.md'returns zero matchesbash -nsyntax checkgithub\.com[:/]linuxfoundation/covers both HTTPS and SSH remoteslinuxfoundationrepo correctly resolves the parent directoryLFX_REPOS_DIR_OVERRIDEenv var takes precedence when set