Skip to content

Commit

Permalink
[#1666] Release v1.2.2
Browse files Browse the repository at this point in the history
* Adopt Zcash SDK v2.2.6

* Changelogs version update

* Version name change

* Update WHATS_NEW_EN.md

updated Whats New for 1.2.2 release

* Update WHATS_NEW_ES.md

Updated WhatsNew in Spanish for 1.2.2 release

* Switch to non-snapshot Zcash SDK version

* Fix app version in What’s New title

* Center longer screen text

* ChangelogParser works with translated titles

---------

Co-authored-by: Andrea Kobrlova <[email protected]>
  • Loading branch information
HonzaR and true-jared authored Nov 18, 2024
1 parent d31f713 commit 13cf2c4
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 58 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2

## [Unreleased]

## [1.2.2 (788)] - 2024-11-17

### Added
- Address book encryption
- Android auto backup support for address book encryption
Expand All @@ -21,6 +23,7 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2
- The Not enough space and In-app udpate screens have been redesigned
- External links now open in in-app browser
- All the Settings screens have been redesigned
- Adopted Zcash SDK version 2.2.6

### Fixed
- Address book toast now correctly shows on send screen when adding both new and known addresses to text field
Expand Down
93 changes: 78 additions & 15 deletions build-conventions-secant/src/main/kotlin/publish/ChangelogParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package publish
import org.intellij.markdown.ast.getTextInNode
import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
import org.intellij.markdown.parser.MarkdownParser
import publish.ChangelogParser.ENGLISH_TAG
import publish.ChangelogParser.SPANISH_TAG
import java.io.File
import java.text.SimpleDateFormat
import java.util.Date
Expand All @@ -15,6 +17,18 @@ object ChangelogParser {
private const val CHANGELOG_TITLE_POSITION = 0
private const val UNRELEASED_TITLE_POSITION = 4

internal const val ENGLISH_TAG = "EN"
internal const val SPANISH_TAG = "ES"

private const val ADDED_PART_EN = "Added"
private const val ADDED_PART_ES = "Agregado"
private const val CHANGED_PART_EN = "Changed"
private const val CHANGED_PART_ES = "Cambiado"
private const val FIXED_PART_EN = "Fixed"
private const val FIXED_PART_ES = "Arreglado"
private const val REMOVED_PART_EN = "Removed"
private const val REMOVED_PART_ES = "Removido"

private fun log(value: Any) {
if (DEBUG_LOGS_ENABLED) {
println(value)
Expand All @@ -23,9 +37,10 @@ object ChangelogParser {

fun getChangelogEntry(
filePath: String,
versionNameFallback: String
languageTag: LanguageTag,
versionNameFallback: String,
): ChangelogEntry {
log("Parser: starting...")
log("Parser: starting for file: $filePath")

val src = File(filePath).readText()
val parsedTree = MarkdownParser(GFMFlavourDescriptor()).buildMarkdownTreeFromString(src)
Expand All @@ -46,7 +61,7 @@ object ChangelogParser {
"Provided changelog file is incorrect or its structure is malformed."
}

val fromIndex = findFirstValidNodeIndex(nodes)
val fromIndex = findFirstValidNodeIndex(languageTag, nodes)
log("Parser: index from: $fromIndex")

val toIndex =
Expand All @@ -67,20 +82,23 @@ object ChangelogParser {
ChangelogEntry(
version = parts.getVersionPart(versionNameFallback),
date = parts.getDatePart(),
added = parts.getNodePart("Added"),
changed = parts.getNodePart("Changed"),
fixed = parts.getNodePart("Fixed"),
removed = parts.getNodePart("Removed"),
added = parts.getNodePart(titleByLanguage(TitleType.ADDED, languageTag)),
changed = parts.getNodePart(titleByLanguage(TitleType.CHANGED, languageTag)),
fixed = parts.getNodePart(titleByLanguage(TitleType.FIXED, languageTag)),
removed = parts.getNodePart(titleByLanguage(TitleType.REMOVED, languageTag)),
)
}

log("Parser: result: $lastChangelogEntry")
return lastChangelogEntry
}

private fun findFirstValidNodeIndex(nodes: List<String>): Int {
private fun findFirstValidNodeIndex(
languageTag: LanguageTag,
nodes: List<String>
): Int {
nodes.forEachIndexed { index, node ->
if (findNodeByPrefix(node) && findValidSubNodeByPrefix(nodes[index + 1])) {
if (findNodeByPrefix(node) && findValidSubNodeByPrefix(languageTag, nodes[index + 1])) {
return index
}
}
Expand All @@ -90,17 +108,21 @@ object ChangelogParser {

private fun findNodeByPrefix(node: String): Boolean = node.startsWith("## [")

private fun findValidSubNodeByPrefix(subNode: String): Boolean =
subNode.startsWith("### Added") ||
subNode.startsWith("### Changed") ||
subNode.startsWith("### Fixed") ||
subNode.startsWith("### Removed")
private fun findValidSubNodeByPrefix(
languageTag: LanguageTag,
subNode: String
): Boolean =
subNode.startsWith("### ${titleByLanguage(TitleType.ADDED, languageTag)}") ||
subNode.startsWith("### ${titleByLanguage(TitleType.CHANGED, languageTag)}") ||
subNode.startsWith("### ${titleByLanguage(TitleType.FIXED, languageTag)}") ||
subNode.startsWith("### ${titleByLanguage(TitleType.REMOVED, languageTag)}")

private fun List<String>.getVersionPart(versionNameFallback: String): String {
return if (this.contains("## [Unreleased]")) {
versionNameFallback
} else {
this[0].split("[")[1].split("]")[0].trim()
// Parse just version name omitting version code as we currently don't need it in the UI
this[0].split("[")[1].split(" ")[0].trim()
}
}

Expand Down Expand Up @@ -142,4 +164,45 @@ object ChangelogParser {
ChangelogEntrySection(title = title, content = it)
}
}

private fun titleByLanguage(
type: TitleType,
languageTag: LanguageTag
): String {
return when (type) {
TitleType.ADDED ->
when (languageTag) {
is LanguageTag.English -> ADDED_PART_EN
is LanguageTag.Spanish -> ADDED_PART_ES
}
TitleType.CHANGED ->
when (languageTag) {
is LanguageTag.English -> CHANGED_PART_EN
is LanguageTag.Spanish -> CHANGED_PART_ES
}
TitleType.FIXED ->
when (languageTag) {
is LanguageTag.English -> FIXED_PART_EN
is LanguageTag.Spanish -> FIXED_PART_ES
}
TitleType.REMOVED ->
when (languageTag) {
is LanguageTag.English -> REMOVED_PART_EN
is LanguageTag.Spanish -> REMOVED_PART_ES
}
}
}
}

sealed class LanguageTag(open val tag: String) {
data class English(override val tag: String = ENGLISH_TAG) : LanguageTag(tag)

data class Spanish(override val tag: String = SPANISH_TAG) : LanguageTag(tag)
}

private enum class TitleType {
ADDED,
CHANGED,
FIXED,
REMOVED
}
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ abstract class PublishToGooglePlay @Inject constructor(
val inAppUpdatePriority = project.property("ZCASH_IN_APP_UPDATE_PRIORITY").toString().toInt()

val releaseNotes: List<LocalizedText> = getReleaseNotesFor(
gradleVersionName, listOf("EN", "ES")
gradleVersionName = gradleVersionName,
languageTags = listOf(
LanguageTag.English(),
LanguageTag.Spanish()
)
)

log("Publish - Version: $versionName has been uploaded")
Expand Down Expand Up @@ -279,14 +283,18 @@ abstract class PublishToGooglePlay @Inject constructor(
private val releaseNotesFilePath = "docs/whatsNew/WHATS_NEW_"
private val releaseNotesFileSuffix = ".md"

private fun getReleaseNotesFor(gradleVersionName: String, languageTags: List<String>): MutableList<LocalizedText> {
private fun getReleaseNotesFor(
gradleVersionName: String,
languageTags: List<LanguageTag>
): MutableList<LocalizedText> {
return buildList {
languageTags.forEach { languageTag ->
// A description of what is new in this release in form of [LocalizedText]
add(LocalizedText().apply {
language = languageTag
language = languageTag.tag
text = ChangelogParser.getChangelogEntry(
filePath = releaseNotesFilePath + languageTag + releaseNotesFileSuffix,
languageTag = languageTag,
versionNameFallback = gradleVersionName
).toInAppUpdateReleaseNotesText()
})
Expand Down
7 changes: 5 additions & 2 deletions build-info-lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import co.electriccoin.zcash.Git
import publish.ChangelogParser
import publish.LanguageTag
import java.text.SimpleDateFormat
import java.util.Date
import java.util.TimeZone
Expand Down Expand Up @@ -103,14 +104,16 @@ fun fillInReleaseNotes(inputs: TaskInputs) {

val releaseNotesEnJson = ChangelogParser.getChangelogEntry(
filePath = releaseNotesEnPath,
versionNameFallback = gradleVersionName
versionNameFallback = gradleVersionName,
languageTag = LanguageTag.English()
).toJsonString()

inputs.property(releaseNotesEn, releaseNotesEnJson)

val releaseNotesEsJson = ChangelogParser.getChangelogEntry(
filePath = releaseNotesEsPath,
versionNameFallback = gradleVersionName
versionNameFallback = gradleVersionName,
languageTag = LanguageTag.Spanish()
).toJsonString()

inputs.property(releaseNotesEs, releaseNotesEsJson)
Expand Down
26 changes: 10 additions & 16 deletions docs/whatsNew/WHATS_NEW_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,21 @@ directly impact users rather than highlighting other key architectural updates.*

## [Unreleased]

## [1.2.2 (788)] - 2024-11-17

### Added
- Address book encryption
- Android auto backup support for address book encryption
- The device authentication feature on the Zashi app launch has been added
- Zashi app now supports Spanish language. It can be changed in the System settings options.
- The Flexa SDK has been adopted to enable payments using the embedded Flexa UI
- New Sending, Success, Failure, and GrpcFailure subscreens of the Send Confirmation screen have been added
- New Copy Transaction IDs feature has been added to the MultipleTransactionFailure screen
- Hola! We taught Zashi to speak Spanish!
- We adopted SDK release 2.2.6 which should help speed up sending multiple transactions.
- We implemented encryption and remote storage for Address Book!
- We added device authentication to app launch.
- We added animated progress screen and new success and failure screens.

### Changed
- Shielded transactions are properly indicated in transaction history
- The in-app update logic has been fixed and is now correctly requested with every app launch
- The Not enough space and In-app udpate screens have been redesigned
- External links now open in in-app browser
- All the Settings screens have been redesigned
- We made Settings and status screens pretty.
- Let us know how you like Zashi with the improved Send Feedback feature.

### Fixed
- Address book toast now correctly shows on send screen when adding both new and known addresses to text field
- The application now correctly navigates to the homepage after deleting the current wallet and creating a new or
recovering an older one
- The in-app update logic has been fixed and is now correctly requested with every app launch
- We fixed the shield icon behaviour in Transaction History.

## [1.2.1 (760)] - 2024-10-22

Expand Down
32 changes: 13 additions & 19 deletions docs/whatsNew/WHATS_NEW_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,18 @@ directly impact users rather than highlighting other key architectural updates.*

## [Unreleased]

### Added
- Address book encryption
- Android auto backup support for address book encryption
- The device authentication feature on the Zashi app launch has been added
- Zashi app now supports Spanish language. It can be changed in the System settings options.
- The Flexa SDK has been adopted to enable payments using the embedded Flexa UI
- New Sending, Success, Failure, and GrpcFailure subscreens of the Send Confirmation screen have been added
- New Copy Transaction IDs feature has been added to the MultipleTransactionFailure screen
## [1.2.2 (788)] - 2024-11-17

### Changed
- Shielded transactions are properly indicated in transaction history
- The in-app update logic has been fixed and is now correctly requested with every app launch
- The Not enough space and In-app udpate screens have been redesigned
- External links now open in in-app browser
- All the Settings screens have been redesigned
### Agregado
- ¡Hola!, Zashi aprendió Español.
- Nuevo manejo de transacciones de baja denominación, esto hace transacciones más rápidas y uso eficiente del saldo.
- Implementación de encriptado y almacenamiento remoto de información en agenda.
- Se agrego una barra de progreso y nuevas pantallas de éxito y falla.
- Inicio de aplicación con autenticación implementada.

### Fixed
- Address book toast now correctly shows on send screen when adding both new and known addresses to text field
- The application now correctly navigates to the homepage after deleting the current wallet and creating a new or
recovering an older one
- The in-app update logic has been fixed and is now correctly requested with every app launch
### Cambiado
- Mejora en pantalla de configuración y estatus.
- Comentarios y sugerencias mejoradas.

### Arreglado
- Icono de transacciones privadas arreglado.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ NDK_DEBUG_SYMBOL_LEVEL=symbol_table
# VERSION_CODE is effectively ignored. VERSION_NAME is suffixed with the version code.
# If not using automated Google Play deployment, then these serve as the actual version numbers.
ZCASH_VERSION_CODE=1
ZCASH_VERSION_NAME=1.2.1
ZCASH_VERSION_NAME=1.2.2

# Set these fields, as you need them (e.g. with values "Zcash X" and "co.electriccoin.zcash.x")
# to distinguish a different release build that can be installed alongside the official version
Expand Down Expand Up @@ -220,7 +220,7 @@ ZCASH_BIP39_VERSION=1.0.8
FLEXA_VERSION=1.0.5

# WARNING: Ensure a non-snapshot version is used before releasing to production
ZCASH_SDK_VERSION=2.2.5-SNAPSHOT
ZCASH_SDK_VERSION=2.2.6

# Toolchain is the Java version used to build the application, which is separate from the
# Java version used to run the application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ private fun Empty(
text = stringResource(id = R.string.address_book_empty),
fontWeight = FontWeight.SemiBold,
color = ZashiColors.Text.textPrimary,
style = ZashiTypography.header6
style = ZashiTypography.header6,
textAlign = TextAlign.Center
)
}

Expand Down

0 comments on commit 13cf2c4

Please sign in to comment.