Update main.yml and sonar-project.properties#1630
Merged
olabusayoT merged 1 commit intoapache:mainfrom Feb 19, 2026
Merged
Conversation
stevedlawrence
approved these changes
Feb 18, 2026
Member
stevedlawrence
left a comment
There was a problem hiding this comment.
+1, looks good, just minor tweaks/suggestions
.github/workflows/main.yml
Outdated
| JAVA_JARS=$(sbt -batch -no-colors -error "export Compile/dependencyClasspath" 2>/dev/null) | ||
| TEST_JAVA_JARS=$(sbt -batch -no-colors -error "export Test/dependencyClasspath" 2>/dev/null) | ||
| SONAR_JAVA_JARS=$(echo "$JAVA_JARS" | sed 's/.*dependencyClasspath[[:space:]]*//' | sed '/^[[:space:]]*$/d' | tr ';' '\n' | tr ':' '\n' | sort -ui | tr '\n' ',' | sed 's/,$//') | ||
| SONAR_TEST_JAVA_JARS=$(echo "$TEST_JAVA_JARS" | sed 's/.*dependencyClasspath[[:space:]]*//' | sed '/^[[:space:]]*$/d' | tr ';' '\n'| tr ':' '\n' | sort -ui | tr '\n' ',' | sed 's/,$//') |
Member
There was a problem hiding this comment.
I think these can be simplified a bit, e.g.
SONAR_JAVA_JARS=$(echo "$JAVA_JARS" | grep -v dependencyClasspath | tr ':;' '\n'| sort -u | paste -sd ',' -)
Uses grep -v to remove the 'dependencyClasspath' lines, combines the colon/semicolon tr into a single tr, and uses paste to avoid having to strip the trailing comma
.github/workflows/main.yml
Outdated
| echo "SCALA_BINARY_VERSION=$SCALA_BINARY_VERSION" >> $GITHUB_ENV | ||
| # have the right reportPath per version, as well as the proper | ||
| # path to jar dependencies | ||
| echo "SCALA_VERSION=$SCALA_VERSION" >> $GITHUB_ENV |
Member
There was a problem hiding this comment.
Should we make this SONAR_SCALA_VERSION just to make it distinct and make it clear it's for the sonar stuff? SCALA_VERSION is kindof generic--if someone ever wanted to run this locally I could imagine that possibly affecting something other than the sonar scans.
…oud integration - use environment vars `SONAR_JAVA_JARS` and `SONAR_TEST_JAVA_JARS` for dependency resolution. - Updated workflow to dynamically generate environment variables for jar dependencies during scans, as well as scala version - Update reportPaths to use env var SONAR_SCALA_VERSION in case of scala version updates - Modified `.sonar-project.properties` to reference new environment variables for library paths. DAFFODIL-3071, DAFFODIL-3068
73fd8a7 to
fd21de2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
SONAR_JAVA_JARSandSONAR_TEST_JAVA_JARSfor dependency resolution..sonar-project.propertiesto reference new environment variables for library paths.DAFFODIL-3071, DAFFODIL-3068