Skip to content

Commit

Permalink
* Removed totalByModule because the results were very verbose and not…
Browse files Browse the repository at this point in the history
… being used. (#39)

* Removed duplicate GitSha for report metadata and cleaned up the model class.
  • Loading branch information
handstandsam authored Dec 16, 2024
1 parent 1b1ae95 commit ef59366
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ object InvertJsReportUtils {
statMetadata.key to StatTotalAndMetadata(
metadata = statMetadata,
total = totalCount,
totalByModule = totalByModule,
totalByOwner = ownerToTotalCount
)
}.toMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ object ProjectMetadataCollector {

return MetadataJsReportModel(
currentTime = time.epochSecond,
currentTimeStr = formatter.format(time),
currentTimezoneId = timeZoneId,
currentTimeFormatted = formatter.format(time),
timezoneId = timeZoneId,
latestCommitTime = latestCommitTimestamp,
latestCommitTimeFormatted = formatter.format(Instant.ofEpochSecond(latestCommitTimestamp)),
latestCommitGitSha = currentBranchHash,
branchName = currentBranch,
tagName = currentTag,
latestCommitSha = currentBranchHash,
remoteRepoGit = remoteGitRepoUrl,
remoteRepoUrl = remoteRepoUrl,
artifactRepositories = repoUrls,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ data class CollectedStatTotalsJsReportModel(
data class StatTotalAndMetadata(
val metadata: StatMetadata,
val total: Int,
val totalByModule: Map<ModulePath, Int>,
val totalByOwner: Map<OwnerName, Int>,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ import kotlinx.serialization.Serializable
*/
@Serializable
data class MetadataJsReportModel(
val currentTime: Long,
val currentTimeStr: String,
val currentTimezoneId: String,
val latestCommitSha: GitSha,
val latestCommitTime: Long,
val latestCommitTimeFormatted: String,
val latestCommitGitSha: GitSha?,
val branchName: GitBranch?,
val tagName: GitTag?,
val remoteRepoGit: String,
val remoteRepoUrl: String,
val artifactRepositories: List<String>,
val buildSystem: BuildSystem,
val artifactRepositories: List<String>,
val branchName: GitBranch?,
val buildSystem: BuildSystem,
val currentTime: Long,
val currentTimeFormatted: String,
val latestCommitGitSha: GitSha,
val latestCommitTime: Long,
val latestCommitTimeFormatted: String,
val tagName: GitTag?,
val timezoneId: String,
val remoteRepoGit: String,
val remoteRepoUrl: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object FormattingUtils {
} ${dateTime.dayOfMonth}, ${dateTime.year} at " +
"${dateTime.hour.toString().padStart(2, '0')}:${
dateTime.minute.toString().padStart(2, '0')
}:${dateTime.second.toString().padStart(2, '0')} ($currentTimezoneId)"
}:${dateTime.second.toString().padStart(2, '0')} ($timezoneId)"

return formattedDate
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fun LeftNavigationComposable(
}
}
Br()
metadata.latestCommitSha.let { currentBranchHash ->
metadata.latestCommitGitSha.let { currentBranchHash ->
Text("Commit ")
A(href = metadata.remoteRepoUrl + "/tree/${currentBranchHash}", attrs = { target(Blank) }) {
Text(currentBranchHash.substring(0, 7))
Expand Down

0 comments on commit ef59366

Please sign in to comment.