Don't override github.external_url if its already defined #512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So I came across a bug from a specific corner case when trying to integrate github ref links into one of my projects. After some debugging I found the state that causes the issue
scmInfo
defined (in my case its because we use ghpages to publish the paradox site to github pages)github.external_url
inparadoxProperties
. In my case this is done because we have amain
branch rather than amaster
branch.When I tried doing this in my project I noticed that no matter how I overrode
github.external_url
the setting would never apply, after looking into Paradox I found the offending code, i.e. https://github.com/lightbend/paradox/blob/master/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala#L427-L436Basically if you have
scmInfo
defined then it will always override a custom definedgithub.external_url
because thelinkProperties
just ignoresgithub.external_url
and returns a hardcodedgithub.external_url
value that overrides the original.