Skip to content

Commit

Permalink
Merge branch 'master' into unused_usings
Browse files Browse the repository at this point in the history
  • Loading branch information
kiminuo committed May 8, 2024
2 parents 6dc2468 + b971f85 commit 1004f5c
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 104 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ dotnet_diagnostic.CA1847.severity = warning
# CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1859.severity = none

# CA1865-CA1867: Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char
dotnet_diagnostic.CA1865.severity = warning
dotnet_diagnostic.CA1866.severity = warning
dotnet_diagnostic.CA1867.severity = warning

# CA1868: Unnecessary call to Set.Contains(item)
dotnet_diagnostic.CA1868.severity = warning

Expand Down
160 changes: 65 additions & 95 deletions WalletWasabi.Documentation/ClientRelease/ClientDeployment.md
Original file line number Diff line number Diff line change
@@ -1,106 +1,76 @@
# 1. Final tests

1. Go to https://github.com/zkSNACKs/WalletWasabi/releases.
2. Check the exact **date** of the last release and the **name** of the last PR.
3. List the PR-s in order, open the [link and (adjust date!)](https://github.com/zkSNACKs/WalletWasabi/pulls?q=is%3Apr+merged%3A%3E%3D2019-07-07+sort%3Aupdated-asc).
4. Go trough all PR, create the Release Notes document and the Final Test issue. Create test cases according to PR-s and write a list. [Release Notes format](https://github.com/zkSNACKs/WalletWasabi/releases/tag/v1.1.6) and [Final Test format](https://github.com/zkSNACKs/WalletWasabi/issues/2227).
5. Go trough all issues and pick the [important ones (adjust date!)](https://github.com/zkSNACKs/WalletWasabi/issues?utf8=%E2%9C%93&q=is%3Aissue+closed%3A%3E%3D2019-07-07+sort%3Aupdated-asc+) and add to Release Notes or to Final Tests if required.
6. Check Tor status. Never release during a Tor network disruption: https://status.torproject.org/
7. At the end there will be a Final Test document and a Release Notes document.

# 2. Release candidate

1. Go to https://github.com/molnard/WalletWasabi/releases and press Draft a new release.
2. Tag version: add `rc1` postfix e.g: v1.1.7rc1.
3. Set release title e.g: `Wasabi v1.1.7: <Release Title> - Release candidate`.
4. Set description use [previous releases](https://github.com/molnard/WalletWasabi/releases) as a template.
5. Add the Release Notes, the same as it will be at the final release (can be typofixed).
6. Make sure local .NET Core version is up to date.
7. Set the version number in the software but only increase the rev number by one to avoid version collision like: 1.1.6.4.
8. Run tests.
9. Run packager in publish mode.
10. Create `.msi`.
11. Run packager in sign mode. (Set back to publish mode)
12. Test asc file for `.msi`.
13. Final `.msi` test on own computer.
14. Upload the files to the pre-release.
15. Check `This is a pre-release` and press Publish Release.
16. Add the pre-release link to the Final Test issue.
17. Share the Final Test issue link with developers an test it for 24 hours.
18. Every PR which is contained in the release must be at least 24 hours old.
# Final tests

- Check the exact **date** of the last release and the **name** of the last PR.
- List the PR-s in order, open the [link and (adjust date!)](https://github.com/zkSNACKs/WalletWasabi/pulls?q=is%3Apr+merged%3A%3E%3D2019-07-07+sort%3Aupdated-asc).
- Go through all PR, create the Final Test issue. Create test cases according to PR-s and write a list - [Final Test format](https://github.com/zkSNACKs/WalletWasabi/issues/2227).
- Go through all issues and pick the [important ones (adjust date!)](https://github.com/zkSNACKs/WalletWasabi/issues?utf8=%E2%9C%93&q=is%3Aissue+closed%3A%3E%3D2019-07-07+sort%3Aupdated-asc+) and add to Final Tests if required.
- Check Tor status. Never release during a Tor network disruption: https://status.torproject.org/
- At the end there will be a Final Test document.
- Do testing contribution game if needed.

# Release candidate

- Go to your own fork of Wasabi and press Draft a new release. Release candidates are not published in the main repository!
- Tag version: add `rc1` postfix e.g: v1.1.7rc1.
- Set release title e.g: `Wasabi v1.1.7: <Release Title> - Release candidate`.
- Add "Do not use this" to the release notes.
- Set as a pre-release. Save Draft.
- Do Packaging (see below).
- Upload the files to the pre-release.
- Check `This is a pre-release` and press Publish Release.
- Add the pre-release link to the Final Test issue.
- Share the Final Test issue link with developers and test it for 24 hours.
- Every PR that is contained in the release must be at least 24 hours old.

Make sure to run a virus detection scan on one of the Release candidate's .msi installer (preferably the final one). You can use this site for example: https://www.virustotal.com/gui/home/upload.

# 3. Packaging
# Packaging

0. Make sure local .NET Core version is up to date.
1. Run tests.
2. Retest every PR since last release on Windows, macOS and Linux.
3. Bump client version. (WalletWasabi/Helpers/Constants.cs, WalletWasabi.Backend\wwwroot\index.html).
4. Run packager in publish mode.
5. [mac sign] Copy Wasabi-osx-version.zip to [macOS release environment](https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/Guides/MacOsSigning.md) desktop.
6. [mac sign] Run the packager on macOS.
7. [mac sign] Copy the final dmg back to dist folder on windows.
8. Create `.msi`.
9. Run packager in sign mode. (Set back to publish mode)
10. Final `.msi` test on own computer.
- Make sure the local .NET Core version is up to date.
- Make sure CI and CodeFactor check out.
- Run tests.
- MAKE SURE YOU ARE ON THE RIGHT BRANCH AND UP TO DATE in GitHub Desktop on the release machine!
- Discard packages.lock changes if there are. Inserted USB drive name must contain the string USB!
- Run the [script file](https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Packager/scripts/Wasabi_release.ps1) on the **Windows Release Laptop** and follow the instructions.
- At some point you will need to run [this script](https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Packager/scripts/WasabiNoratize.scpt) file on Mac. Don't forget to open the script file on Mac and insert your Apple dev username and password. Guide how to setup it: [macOS release environment](https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/Guides/MacOsSigning.md).
- Finish the script on Windows. Now a folder should pop up with all the files that need to be uploaded to GitHub.
- Test asc file for `.msi`.
- Final `.msi` test on own computer. Check the About dialog and optionally the BUILDINFO.json next to the wasabi executable, the commit ID should match with the one on GitHub.

# 4. GitHub Release
# Final release

1. Create GitHub Release. (Use the previous release as template)
2. Write Release notes based on commits since last release.
3. Download and test the binaries on all VMs.
- Draft a [new release at the main repo](https://github.com/zkSNACKs/WalletWasabi/releases/new).
- Bump client version. (WalletWasabi/Helpers/Constants.cs) - maybe you already did this.
- Create the release notes by using [the template](https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/ClientRelease/ReleaseNotesTemplate.md). Make sure the the recent changes are in the What's new section.
- Run tests.
- Do Packaging (see above).
- Upload the files to the main repo!
- Download MSI from the draft release to your local computer, test it, and verify the version number in about!
- Do not set pre-release flag!
- Publish the release.

# 5. Notify
# Notify

1. Refresh website download and signature links.
2. Update InstallationGuide and DeterministicBuildGuide download links, [here](https://github.com/zkSNACKs/WasabiDoc/blob/master/docs/.vuepress/variables.js).
3. Make sure CI and CodeFactor checks out.
4. [Deploy testnet and mainnet backend](https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/BackendDeployment.md#update).
- Refresh website download and signature links.
- [Deploy testnet and mainnet backend](https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/HowToDeploy.md). Make sure the client version number is bumped here as well. If it is a hotfix you do not need to update the backend, but you need to update the website!

# 6. Update Docs
# Announce

1. Bump the client version in [the docs](https://github.com/zkSNACKs/WasabiDoc/blob/master/docs/.vuepress/variables.js).
- [Twitter](https://twitter.com) (tag @wasabiwallet #Bitcoin #Privacy).
- Submit to [/r/WasabiWallet](https://old.reddit.com/r/WasabiWallet/) and [/r/Bitcoin](https://old.reddit.com/r/Bitcoin/).

# 7. Announce

1. [Twitter](https://twitter.com) (tag @wasabiwallet #Bitcoin #Privacy).
2. Submit to [/r/WasabiWallet](https://old.reddit.com/r/WasabiWallet/) and [/r/Bitcoin](https://old.reddit.com/r/Bitcoin/).

# 8. Backporting
# Backporting

Backport is a branch. It is used for creating silent releases (hotfixes, small improvements) on top of the last released version. For this reason it has to be maintained with special care.

## Merge PR into backport

1. There is a PR which is merged to master and selected to backport.
2. Checkout the current backport branch to a new local branch like bp_whatever: `git checkout -b bp_whatever upstream/backport`.
3. Go to the merged PR / Commits and copy the hash of the commit.
4. Cherry pick: `git cherry-pick 35c4db348__hash of the commit__06abcd9278c`.
5. git push origin bp_whatever.
6. Create a PR into upstream/backport name it as: [Backport] Whatever.

Notes:
- In Backport the index.html does not need to be maintained.

## Create squash commit
Squash commit makes cherry-picking easier as you only need to do that for one commit. Squash commit "merge" together multiple commits. GitHub has an easy solution to do this.
## Merge PR into backport (release branch)

1. Merge the PR into the master as usually.
2. Revert the merge.
3. Revert the reverted merge, so the original PR will be in the master.
4. Go to the PR which reverted the revert you will find the only one commit there - it will be the squash commit.
5. Cherry pick the squash commit into backport.

## Rebase backport after release

If it's a major release, then the backport branch must be rebased, so we can start backporting stuff.

```sh
git checkout --track upstream/backport
git rebase upstream/master
git push -u upstream backport
```
- There is a PR which is merged to master and selected to backport.
- Checkout the current backport branch to a new local branch like bp_whatever: `git checkout -b bp_whatever upstream/backport`.
- Go to the merged PR / Commits and copy the hash of the commit.
- Cherry-pick: `git cherry-pick 35c4db348__hash of the commit__06abcd9278c`.
- git push origin bp_whatever.
- Create a PR into upstream/backport and name it as [Backport] Whatever.

## Code signing certificate

Expand All @@ -112,15 +82,15 @@ Digicert holds our Code Signing Certificate under the name "zkSNACKs Limited".

**Renewal**

1. Create a new Certificate Signing Request (CSR) file with DigiCert® Certificate Utility application.
- Create a new Certificate Signing Request (CSR) file with DigiCert® Certificate Utility application.
DigiCert® Certificate Utility is using the logged in user's public key to encrypt the file and only the same user can decrypt it after we receive the certificate.
Make sure to create the CSR file in David's profile (or wherever the release script is located)!
2. Upload the CSR file to DigiCert.
3. Wait for DigiCert to issue a new `zksnacks_limited.p7b` file.
4. Import the `zksnacks_limited.p7b` file to DigiCert® Certificate Utility.
5. Choose a friendly name for the certificate and apply the default password to it.
6. Export the `zksnacks_limited.pfx` to `C:\zksnacks_limited.pfx`.
7. Rename `C:\zksnacks_limited.pfx` to `C:\digicert.pfx`, so the Packager can find it!!
- Upload the CSR file to DigiCert.
- Wait for DigiCert to issue a new `zksnacks_limited.p7b` file.
- Import the `zksnacks_limited.p7b` file to DigiCert® Certificate Utility.
- Choose a friendly name for the certificate and apply the default password to it.
- Export the `zksnacks_limited.pfx` to `C:\zksnacks_limited.pfx`.
- Rename `C:\zksnacks_limited.pfx` to `C:\digicert.pfx`, so the Packager can find it!!


## Packager environment setup
Expand Down
4 changes: 2 additions & 2 deletions WalletWasabi.Fluent/Controls/CurrencyEntryBox.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ protected override void OnTextInput(TextInputEventArgs e)

private bool IsReplacingWithImplicitDecimal(string input)
{
return input.StartsWith(".") && SelectedText == Text;
return input.StartsWith('.') && SelectedText == Text;
}

private bool IsInsertingImplicitDecimal(string input)
{
return input.StartsWith(".") && CaretIndex == 0 && Text is not null && !Text.Contains('.');
return input.StartsWith('.') && CaretIndex == 0 && Text is not null && !Text.Contains('.');
}

private TextInputEventArgs ReplaceCurrentTextWithLeadingZero(TextInputEventArgs e)
Expand Down
8 changes: 7 additions & 1 deletion WalletWasabi.Fluent/Controls/TagsBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" />
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
<Setter Property="Padding" Value="{DynamicResource TagsBoxBorderPadding}" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="Cursor" Value="IBeam" />
<Setter Property="Focusable" Value="True" />
<Setter Property="IsTabStop" Value="False" />
Expand Down Expand Up @@ -63,7 +64,8 @@
<Border x:Name="PART_Border" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
Padding="{TemplateBinding Padding}"
CornerRadius="{TemplateBinding CornerRadius}">
<Panel>
<TextBlock Name="PART_Watermark"
Opacity="0.5"
Expand Down Expand Up @@ -99,8 +101,12 @@
</DataValidationErrors>
</ControlTemplate>
</Setter>

<Setter Property="(ScrollViewer.HorizontalScrollBarVisibility)" Value="Disabled" />

<Style Selector="^:focus-within /template/ Border#PART_Border">
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}"/>
</Style>
</ControlTheme>

</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public void UpdateLabels()

protected override void OnActivated(CompositeDisposable disposables)
{
_topSuggestions.Clear();
_suggestions.Clear();

var suggestionLabelsFilter = this.WhenAnyValue(x => x.Labels).ToSignal()
.Merge(Observable.FromEventPattern(Labels, nameof(Labels.CollectionChanged)).ToSignal())
.Select(_ => SuggestionLabelsFilter());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public void UpdateFeeEstimates(IEnumerable<(TimeSpan timeSpan, FeeRate feeRate)>
if (satoshiPerByteValues.Length != 0)
{
var maxY = satoshiPerByteValues.Max();
var minY = satoshiPerByteValues.Min();
var minY = 1; // If values are not the same, it will be always rendered starting from 1.

SatoshiPerByteLabels = areAllValuesEqual
? new[] { "", "", maxY.ToString("F0") }
Expand Down
5 changes: 5 additions & 0 deletions WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
<!-- Balance -->
<PrivacyContentControl PrivacyReplacementMode="Text" DockPanel.Dock="Top" HorizontalAlignment="Center" Classes="h8" Opacity="0.6">
<Button Focusable="False" Classes="plainHyperlink h8" Command="{Binding InsertMaxCommand}">
<Interaction.Behaviors>
<EventTriggerBehavior EventName="Click">
<InvokeCommandAction Command="{Binding #amountTb.FocusCommand}"/>
</EventTriggerBehavior>
</Interaction.Behaviors>
<AmountControl Amount="{Binding Balance^}" />
</Button>
</PrivacyContentControl>
Expand Down
2 changes: 1 addition & 1 deletion WalletWasabi/Blockchain/Keys/WalletGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static bool ValidateWalletName(string walletName)
return false;
}
var invalidChars = Path.GetInvalidFileNameChars();
var isValid = !walletName.Any(c => invalidChars.Contains(c)) && !walletName.EndsWith(".");
var isValid = !walletName.Any(c => invalidChars.Contains(c)) && !walletName.EndsWith('.');
var isReserved = ReservedFileNames.Any(w => walletName.ToUpper() == w || walletName.ToUpper().StartsWith(w + "."));
return isValid && !isReserved;
}
Expand Down
4 changes: 2 additions & 2 deletions WalletWasabi/Helpers/EnvironmentHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ public static string GetDefaultBitcoinCoreDataDirOrEmptyString()
// the whole string is the file name.
public static string ExtractFileName(string callerFilePath)
{
var lastSeparatorIndex = callerFilePath.LastIndexOf("\\");
var lastSeparatorIndex = callerFilePath.LastIndexOf('\\');
if (lastSeparatorIndex == -1)
{
lastSeparatorIndex = callerFilePath.LastIndexOf("/");
lastSeparatorIndex = callerFilePath.LastIndexOf('/');
}

var fileName = callerFilePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static CircuitInfo ParseLine(string line)
while (remainder != "")
{
// Read <PATH>.
if (remainder.StartsWith("$", StringComparison.Ordinal))
if (remainder.StartsWith('$'))
{
string pathVal;
(pathVal, remainder) = Tokenizer.ReadUntilSeparator(remainder);
Expand Down
2 changes: 1 addition & 1 deletion WalletWasabi/Userfacing/CurrencyInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static bool TryCorrectAmount(string original, [NotNullWhen(true)] out str
}

// Trim starting zeros.
if (corrected.StartsWith("0"))
if (corrected.StartsWith('0'))
{
// If zeroless starts with a dot, then leave a zero.
// Else trim all the zeros.
Expand Down

0 comments on commit 1004f5c

Please sign in to comment.