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

MTA-1309: Do not allow input and output dirs to be the same for transform rules #73

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

eemcmullan
Copy link
Collaborator

@eemcmullan eemcmullan commented Sep 21, 2023

@@ -77,6 +77,11 @@ func (w *windupShimCommand) Validate() error {
if w.input == nil || len(w.input) == 0 {
return fmt.Errorf("input for rule file or directory must not be empty")
}
for _, r := range w.input {
if r == w.output {
return fmt.Errorf("input rule directory and output directory must be different")

Choose a reason for hiding this comment

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

question: Will this error be triggered also if the paths are different but just by slashes?

Example:

  • input: /path/to/folder/ (Slash at the end)
  • output: /path/to/folder (No slash at the end)

Or

  • input: /path\to\folder (backslashes)
  • output: /path/to/folder

I'm new to Go so I don't know if the paths are being sanitized before this condition.

Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

@abrugaro great point, paths indeed need to be cleaned before comparing, thank you

@pranavgaikwad
Copy link
Contributor

@eemcmullan need to update line numbers in demo-output because of konveyor/analyzer-lsp@dca2d15

Copy link
Contributor

@pranavgaikwad pranavgaikwad left a comment

Choose a reason for hiding this comment

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

Clean paths, and increment line numbers by 1 in demo-output for

jni-native-code-00000:
and
local-storage-00001:

Copy link
Contributor

@pranavgaikwad pranavgaikwad left a comment

Choose a reason for hiding this comment

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

LGTM just need DCO

test-data/analysis-output.yaml Outdated Show resolved Hide resolved
@pranavgaikwad pranavgaikwad merged commit 879412a into konveyor:main Sep 26, 2023
2 checks passed
dymurray pushed a commit that referenced this pull request Oct 6, 2023
* MTA-1309: Do not allow input and output dirs to be the same for transform rules (#73)

* do not allow input and output dirs to be the same for transform

Signed-off-by: Emily McMullan <[email protected]>

* update filepath clean and test output

Signed-off-by: Emily McMullan <[email protected]>

---------

Signed-off-by: Emily McMullan <[email protected]>

* display link to static report (#80)

Signed-off-by: Emily McMullan <[email protected]>

---------

Signed-off-by: Emily McMullan <[email protected]>
Co-authored-by: Emily McMullan <[email protected]>
@eemcmullan eemcmullan deleted the 1309 branch January 23, 2024 16:01
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