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

Fixup the dependency line matching #771

Merged

Conversation

lukebakken
Copy link
Contributor

@lukebakken lukebakken commented Jul 28, 2020

I discovered this issue while running some tests. I must have always fetched deps before running LicenseFinder prior to these changes.

To reproduce prior to this PR, run the following command on the master branch:

cd ./features/fixtures/erlangmk
rm -rf .erlang.mk/ deps; git clean -fxd
bundle exec license_finder --project-path ./features/fixtures/erlangmk

Error:

$ bundle exec license_finder --project-path ./features/fixtures/erlangmk
LicenseFinder::Erlangmk: is active
bundler: failed to load command: license_finder (/home/lbakken/.gem/ruby/2.7.0/bin/license_finder)
InvalidErlangmkPackageError: 'DEP    rabbitmq_management (v3.8.5)' does not look like a valid Erlank.mk dependency. A valid dependency example: 'lager: goldrush git https://github.com/DeadZen/goldrush.git 0.1.9 /absolute/path/to/dep'
  /home/lbakken/development/rabbitmq/LicenseFinder/lib/license_finder/packages/erlangmk_package.rb:55:in `raise_invalid'
  /home/lbakken/development/rabbitmq/LicenseFinder/lib/license_finder/packages/erlangmk_package.rb:25:in `initialize'
  /home/lbakken/development/rabbitmq/LicenseFinder/lib/license_finder/package_managers/erlangmk.rb:26:in `new'

You will see an error concerning a line that begins with DEP. This is because the --prepare argument is not specified, so the make QUERY=... query-deps call out will actually fetch the deps, resulting in output that doesn't match the expectation for a dependency.

It can be fixed by...

  • Adding the --prepare argument
  • Applying this PR!

cc @xtreme-shane-lattanzio @gerhard

@cf-gitbot
Copy link
Collaborator

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@lukebakken lukebakken marked this pull request as draft July 29, 2020 00:01
@lukebakken lukebakken force-pushed the lrb-fix-processing-fetch-deps branch from b966f5c to 08f77e3 Compare July 29, 2020 00:03
@lukebakken lukebakken marked this pull request as ready for review July 29, 2020 00:03
@lukebakken lukebakken marked this pull request as draft July 29, 2020 02:12
@lukebakken lukebakken force-pushed the lrb-fix-processing-fetch-deps branch from 51f703f to 9581369 Compare July 29, 2020 13:34
@lukebakken lukebakken marked this pull request as ready for review July 30, 2020 16:49
@lukebakken
Copy link
Contributor Author

@xtreme-shane-lattanzio @gerhard ready for review (finally!)

@xtreme-shane-lattanzio
Copy link
Contributor

@lukebakken Thanks! Do you think we should have a test for this new change?

@lukebakken
Copy link
Contributor Author

Well, there are already tests but let me see if I can adjust the "fake output" to match what caused this issue in the first place.

@lukebakken
Copy link
Contributor Author

@xtreme-shane-lattanzio 💥 75b7696

@lukebakken
Copy link
Contributor Author

Thanks @xtreme-shane-lattanzio

@lukebakken lukebakken deleted the lrb-fix-processing-fetch-deps branch July 31, 2020 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants