Skip to content

Resolve nested imports and symlinks#15987

Merged
pelikhan merged 9 commits intogithub:mainfrom
strawgate:resolve-remote-import-paths-too
Feb 15, 2026
Merged

Resolve nested imports and symlinks#15987
pelikhan merged 9 commits intogithub:mainfrom
strawgate:resolve-remote-import-paths-too

Conversation

@strawgate
Copy link
Contributor

  • Resolve nested relative imports from remote workflows against the remote repo's .github/workflows/ directory instead of the local one
  • Follow symlinks in remote repository paths when the GitHub Contents API returns 404 (the API doesn't traverse symlinks in path components)

#15982

Copilot AI review requested due to automatic review settings February 15, 2026 20:56
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

This PR fixes remote workflow import edge-cases in the parser by (1) ensuring nested relative imports inside a remotely-imported workflow resolve against the remote repository’s .github/workflows/ directory, and (2) adding a fallback that resolves symlink path components when the GitHub Contents API returns 404.

Changes:

  • Track remote repo context (owner/repo/ref) for workflowspec imports and propagate it to nested imports so relative paths become remote workflowspecs under .github/workflows/.
  • Add a 404 fallback in remote GitHub fetches to resolve symlinks in intermediate path components (bounded recursion).
  • Add unit tests around remote-origin parsing/propagation helpers and symlink path construction logic.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
pkg/parser/remote_fetch.go Adds 404 retry path that resolves remote symlink components before re-fetching via Contents API.
pkg/parser/import_processor.go Introduces remote-origin tracking on import queue items and rewrites nested relative imports from remote parents into remote .github/workflows/* workflowspecs.
pkg/parser/import_remote_nested_test.go Adds tests for remote-origin parsing/struct plumbing and some symlink path math checks.

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

@pelikhan
Copy link
Contributor

Add logging, specially around path resolutions.

LGTM

@strawgate
Copy link
Contributor Author

Done

Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

Can an have integration tests that try the symlink route?

@pelikhan
Copy link
Contributor

Looks great overall!

@strawgate
Copy link
Contributor Author

should be good

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.

2 participants

Comments