Skip to content

Comments

📂 Fix relative import resolution for nested remote files#18190

Merged
dsyme merged 1 commit intomainfrom
frr
Feb 24, 2026
Merged

📂 Fix relative import resolution for nested remote files#18190
dsyme merged 1 commit intomainfrom
frr

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Feb 24, 2026

Fixes #17620

Summary

  • Bug fix: Nested remote imports now resolve relative to their immediate parent file's directory, not the top-level workflow's directory
  • Root cause: nestedRemoteOrigin was reusing the parent's remoteOrigin (with the wrong BasePath); it now calls parseRemoteOrigin(resolvedPath) to derive the correct BasePath for each file
  • Regression test: Added a two-level nesting test covering the case where workflows/workflow.mdshared/file1.mdfile2.md correctly resolves to workflows/shared/file2.md instead of workflows/file2.md

Copilot AI review requested due to automatic review settings February 24, 2026 17:48
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 a bug in nested remote import resolution where relative imports were incorrectly resolved relative to the top-level workflow's directory instead of their immediate parent file's directory.

Changes:

  • Modified import_processor.go to parse a new remoteOrigin from the resolved path for each nested import, ensuring the correct BasePath is derived
  • Added a comprehensive regression test validating two-level nested imports resolve correctly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/parser/import_processor.go Fixed nested remote origin propagation by calling parseRemoteOrigin(resolvedPath) instead of reusing parent's origin
pkg/parser/import_remote_nested_test.go Added regression test for two-level nested imports to validate the fix

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

@dsyme dsyme merged commit 2e2813b into main Feb 24, 2026
162 checks passed
@dsyme dsyme deleted the frr branch February 24, 2026 20:58
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.

gh aw add of workflow with transitive import from nested directory fails

1 participant