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

Address #365 by properly handling submodule path #372

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

acc-jon
Copy link
Contributor

@acc-jon acc-jon commented Nov 6, 2020

This fixes #365 by properly handling sub-module path.

@acc-jon acc-jon linked an issue Nov 6, 2020 that may be closed by this pull request
@sonarcloud
Copy link

sonarcloud bot commented Nov 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #372 into master will increase coverage by 0.96%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #372      +/-   ##
==========================================
+ Coverage   62.53%   63.50%   +0.96%     
==========================================
  Files          76       76              
  Lines        1679     1677       -2     
==========================================
+ Hits         1050     1065      +15     
+ Misses        539      520      -19     
- Partials       90       92       +2     
Impacted Files Coverage Δ
pkg/iac-providers/terraform/v12/load-dir.go 82.00% <100.00%> (-0.70%) ⬇️
pkg/iac-providers/terraform/v12/references.go 81.63% <0.00%> (+4.08%) ⬆️
...g/iac-providers/terraform/v12/module-references.go 47.05% <0.00%> (+44.11%) ⬆️

@cesar-rodriguez cesar-rodriguez changed the title address #365 by properly handling submodule path Address #365 by properly handling submodule path Nov 6, 2020
@kanchwala-yusuf kanchwala-yusuf merged commit e3bb0bd into tenable:master Nov 6, 2020
pathArr := strings.Split(req.Path.String(), ".")
pathArr = pathArr[:len(pathArr)-1]
pathToModule = filepath.Join(absRootDir, filepath.Join(pathArr...), req.SourceAddr)
pathToModule = filepath.Join(absRootDir, req.Parent.SourceAddr, req.SourceAddr)
Copy link

Choose a reason for hiding this comment

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

I'm concerned that this only moves the issue one level deeper. If you go back to salexpdx@89b06f6#diff-ed0a902412e1c2c9cca7b9c8d22f14edcd3711f1535d0bc128e801e3ac300c84R95, you can see that i looped through. That is done so that if there is more than one layer of sub-modules, it will parse through all the way.

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.

Deep modules location mis-proccessed.
3 participants