Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cmd): CLI Config Relative Imports #279

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Conversation

jshlbrd
Copy link
Contributor

@jshlbrd jshlbrd commented Nov 26, 2024

Description

Closes #275 by supporting relative imports.

Motivation and Context

This fixes the relative import problem by switching the directory to each config (jsonnet, libsonnet) file's directory during every test or vet call.

How Has This Been Tested?

Tested with an internal repo that has 10s to 100s of config files containing relative imports (substation test -R, substation vet -R).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jshlbrd jshlbrd assigned jshlbrd and jtan-brex and unassigned jshlbrd Nov 26, 2024
@jshlbrd jshlbrd marked this pull request as ready for review November 26, 2024 17:12
@jshlbrd jshlbrd requested a review from a team as a code owner November 26, 2024 17:12
Copy link
Contributor

@jtan-brex jtan-brex left a comment

Choose a reason for hiding this comment

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

Tested and work as expected! left two comments about adding default case in switch filepath.Ext(path) for both test and vet CLI

cmd/substation/test.go Show resolved Hide resolved
cmd/substation/vet.go Show resolved Hide resolved
@jshlbrd jshlbrd merged commit 3b18bfe into main Nov 27, 2024
7 checks passed
@jshlbrd jshlbrd deleted the jshlbrd/fix/cli-relative-imports branch November 27, 2024 15:18
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.

Regression in CLI Tool Testing Subcommand
2 participants