Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat_: LogOnPanic linter #5969

Merged
merged 6 commits into from
Oct 23, 2024
Merged

feat_: LogOnPanic linter #5969

merged 6 commits into from
Oct 23, 2024

Conversation

igor-sirotin
Copy link
Collaborator

@igor-sirotin igor-sirotin commented Oct 19, 2024

Closes #5866

FYI: I know it's not an urgent task.
I mostly used my free time to play with it, because I was interested in implementing such a thing.

Important

Review by commits

  • 204c40a chore_: make vendor
  • a5bca14 fix_: add missing defer LogOnPanic
  • ed22a12 feat_: LogOnPanic linter

Description

#5849 introduced a requirement for defer LogOnPanic() to be as the first line in all goroutines in status-go code. This PR introduces a custom linter that checks if the requirement is satisifted.

3 cases are supported:

  • go func() { ... }
  • go <free-func>
  • go <method>

So far it seems that only 1 case is not supported: when a goroutine is passed as an argument. But after implementing this PR, it seems to me that it should be very easy to track as well, we have access to all go statements.
UPD: I even think that it might be working right in this PR 🤔

UPD2: This case is also kinda covered by the linter, just not directly.
It will detect such go statement:

func runAsync(fn func()) {
	go fn() // want "missing defer call to LogOnPanic"
}

... it just won't be able to check if the body of fn has the LogOnPanic.
But if you wrap fn into an anonymous function, then we're back to a usual case of anonymous funcs and the linter is satisfied.

func runAsyncOk(fn func()) {
	go func() {
		defer common.LogOnPanic()
		fn()
	}()
}

So far there's only one such case in our code and it already uses an anonymous func wrapper 👌

status-go/api/utils.go

Lines 13 to 23 in 38308d4

// RunAsync runs the specified function asynchronously.
func RunAsync(f func() error) <-chan error {
resp := make(chan error, 1)
go func() {
defer common.LogOnPanic()
err := f()
resp <- err
close(resp)
}()
return resp
}

Implementation

The linter uses go/analysis and implements the Analyzer type.
It also runs gopls under the hood to find definitions of funcs/methods.

Later this could be integrated into golangci-lint, if needed.

Example

Here's what you get without the fixes in a3382f1:

/Users/igorsirotin/Repositories/Status/status-go/waku/v1/peer.go:87:7: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/wakuv2/waku.go:199:11: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/wakuv2/waku.go:1222:17: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/wakuv2/waku.go:1721:22: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/protocol/encryption/publisher/publisher.go:54:7: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/healthmanager/blockchain_health_manager.go:74:5: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/rpc/client.go:178:7: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/services/wallet/balance/ttl_cache.go:59:13: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/services/wallet/api.go:781:5: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/services/wallet/api.go:843:5: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/services/wallet/api.go:929:7: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/protocol/messenger.go:584:22: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/protocol/messenger.go:919:28: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/protocol/messenger_store_node_request_manager.go:563:7: missing defer call to LogOnPanic
/Users/igorsirotin/Repositories/Status/status-go/services/wallet/common/mock/feed_subscription.go:22:5: missing defer call to LogOnPanic

@status-im-auto
Copy link
Member

status-im-auto commented Oct 19, 2024

Jenkins Builds

Click to see older builds (78)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 0bb7cc8 #1 2024-10-19 19:10:25 ~1 min tests 📄log
✔️ 0bb7cc8 #1 2024-10-19 19:13:18 ~4 min ios 📦zip
✔️ 0bb7cc8 #1 2024-10-19 19:13:24 ~4 min linux 📦zip
✔️ 0bb7cc8 #1 2024-10-19 19:13:49 ~5 min android 📦aar
✔️ 0bb7cc8 #1 2024-10-19 19:14:21 ~5 min tests-rpc 📄log
✖️ 0ac1275 #2 2024-10-19 19:18:45 ~1 min tests 📄log
✔️ 0ac1275 #2 2024-10-19 19:18:53 ~1 min android 📦aar
✔️ 0ac1275 #2 2024-10-19 19:19:36 ~2 min linux 📦zip
✔️ 0ac1275 #2 2024-10-19 19:20:07 ~2 min ios 📦zip
✔️ 0ac1275 #2 2024-10-19 19:22:40 ~5 min tests-rpc 📄log
✔️ 4802b92 #3 2024-10-19 19:34:14 ~1 min android 📦aar
✖️ 4802b92 #3 2024-10-19 19:35:44 ~3 min tests 📄log
✔️ 4802b92 #3 2024-10-19 19:36:57 ~4 min linux 📦zip
✔️ 4802b92 #3 2024-10-19 19:37:47 ~5 min tests-rpc 📄log
✔️ 4802b92 #3 2024-10-19 19:39:49 ~7 min ios 📦zip
✖️ fd29ab5 #4 2024-10-22 15:35:59 ~3 min tests 📄log
✔️ fd29ab5 #4 2024-10-22 15:37:06 ~5 min ios 📦zip
✔️ fd29ab5 #4 2024-10-22 15:37:23 ~5 min linux 📦zip
✔️ fd29ab5 #4 2024-10-22 15:38:40 ~6 min android 📦aar
✖️ fd29ab5 #4 2024-10-22 15:38:59 ~6 min tests-rpc 📄log
✖️ 5a2c129 #5 2024-10-22 15:38:54 ~2 min tests 📄log
✔️ f42f8c9 #5 2024-10-22 15:40:44 ~3 min ios 📦zip
✔️ f42f8c9 #5 2024-10-22 15:40:51 ~3 min linux 📦zip
✔️ f42f8c9 #5 2024-10-22 15:42:02 ~2 min android 📦aar
✔️ 67bfb7e #6 2024-10-22 15:44:00 ~3 min ios 📦zip
✖️ 67bfb7e #7 2024-10-22 15:44:05 ~2 min tests 📄log
✔️ 67bfb7e #6 2024-10-22 15:44:30 ~3 min linux 📦zip
✔️ 67bfb7e #6 2024-10-22 15:48:04 ~6 min tests-rpc 📄log
✖️ 6a7d004 #8 2024-10-22 15:46:27 ~2 min tests 📄log
✔️ 6a7d004 #7 2024-10-22 15:46:35 ~3 min android 📦aar
✔️ 6a7d004 #7 2024-10-22 15:47:00 ~2 min ios 📦zip
✔️ 6a7d004 #7 2024-10-22 15:48:00 ~3 min linux 📦zip
✖️ 6a7d004 #7 2024-10-22 15:54:26 ~6 min tests-rpc 📄log
✔️ 52ba068 #8 2024-10-22 17:16:23 ~2 min android 📦aar
✖️ 52ba068 #9 2024-10-22 17:17:36 ~3 min tests 📄log
✔️ 52ba068 #8 2024-10-22 17:17:44 ~3 min ios 📦zip
✔️ 52ba068 #8 2024-10-22 17:19:32 ~5 min linux 📦zip
✖️ 52ba068 #8 2024-10-22 17:20:36 ~6 min tests-rpc 📄log
✖️ 9193993 #10 2024-10-22 18:57:51 ~2 min tests 📄log
✔️ 9193993 #9 2024-10-22 18:57:53 ~2 min linux 📦zip
✔️ 9193993 #9 2024-10-22 18:57:57 ~2 min ios 📦zip
✔️ 9193993 #9 2024-10-22 18:58:19 ~3 min android 📦aar
✖️ 9193993 #9 2024-10-22 19:01:09 ~5 min tests-rpc 📄log
✔️ bd6c6d9 #10 2024-10-22 19:12:34 ~2 min android 📦aar
✔️ bd6c6d9 #10 2024-10-22 19:13:05 ~2 min linux 📦zip
✔️ bd6c6d9 #10 2024-10-22 19:13:26 ~2 min ios 📦zip
✖️ bd6c6d9 #11 2024-10-22 19:14:25 ~3 min tests 📄log
✖️ bd6c6d9 #10 2024-10-22 19:16:46 ~6 min tests-rpc 📄log
✖️ a3382f1 #12 2024-10-22 21:02:16 ~1 min tests 📄log
✔️ a3382f1 #11 2024-10-22 21:02:26 ~1 min android 📦aar
✔️ a3382f1 #11 2024-10-22 21:03:38 ~2 min ios 📦zip
✔️ a3382f1 #11 2024-10-22 21:05:10 ~4 min linux 📦zip
✖️ a3382f1 #11 2024-10-22 21:07:06 ~6 min tests-rpc 📄log
✔️ 204c40a #12 2024-10-22 21:07:21 ~2 min android 📦aar
✔️ 204c40a #12 2024-10-22 21:07:47 ~2 min linux 📦zip
✔️ 204c40a #12 2024-10-22 21:08:03 ~2 min ios 📦zip
✖️ 204c40a #13 2024-10-22 21:08:59 ~3 min tests 📄log
✔️ 204c40a #12 2024-10-22 21:12:47 ~5 min tests-rpc 📄log
✔️ b0c689a #13 2024-10-22 21:16:45 ~1 min android 📦aar
✖️ b0c689a #14 2024-10-22 21:17:04 ~1 min tests 📄log
✔️ b0c689a #13 2024-10-22 21:17:46 ~2 min linux 📦zip
✔️ b0c689a #13 2024-10-22 21:18:52 ~3 min ios 📦zip
✖️ b0c689a #13 2024-10-22 21:21:03 ~6 min tests-rpc 📄log
✔️ 2362d1d #14 2024-10-22 21:39:22 ~1 min android 📦aar
✔️ 2362d1d #14 2024-10-22 21:40:15 ~2 min ios 📦zip
✔️ 2362d1d #14 2024-10-22 21:40:24 ~2 min linux 📦zip
✖️ 2362d1d #14 2024-10-22 21:43:41 ~5 min tests-rpc 📄log
✖️ 2362d1d #15 2024-10-22 22:10:06 ~32 min tests 📄log
✔️ 304c049 #15 2024-10-23 09:04:32 ~1 min android 📦aar
✔️ 304c049 #15 2024-10-23 09:05:24 ~2 min linux 📦zip
✔️ 304c049 #15 2024-10-23 09:05:34 ~2 min ios 📦zip
✖️ 304c049 #15 2024-10-23 09:08:40 ~5 min tests-rpc 📄log
✔️ 304c049 #16 2024-10-23 09:35:04 ~32 min tests 📄log
✔️ 9de1a4b #16 2024-10-23 10:02:53 ~1 min android 📦aar
✔️ 9de1a4b #16 2024-10-23 10:03:50 ~2 min linux 📦zip
✔️ 9de1a4b #16 2024-10-23 10:04:14 ~3 min ios 📦zip
✖️ 9de1a4b #16 2024-10-23 10:07:10 ~5 min tests-rpc 📄log
✔️ 9de1a4b #17 2024-10-23 10:33:28 ~32 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 7735ef9 #17 2024-10-23 11:39:16 ~2 min ios 📦zip
✔️ 7735ef9 #17 2024-10-23 11:42:11 ~5 min linux 📦zip
✔️ 7735ef9 #17 2024-10-23 11:42:34 ~5 min tests-rpc 📄log
✔️ 7735ef9 #17 2024-10-23 11:43:13 ~6 min android 📦aar
✔️ 7735ef9 #18 2024-10-23 12:09:08 ~32 min tests 📄log
✔️ cc809f9 #18 2024-10-23 19:41:18 ~2 min android 📦aar
✔️ cc809f9 #18 2024-10-23 19:41:37 ~2 min linux 📦zip
✔️ cc809f9 #18 2024-10-23 19:42:03 ~3 min ios 📦zip
✔️ cc809f9 #18 2024-10-23 19:44:55 ~5 min tests-rpc 📄log
✔️ cc809f9 #19 2024-10-23 20:11:32 ~32 min tests 📄log

@igor-sirotin igor-sirotin changed the title feat: LogOnPanic linter feat_: LogOnPanic linter Oct 19, 2024
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

Attention: Patch coverage is 63.07692% with 120 lines in your changes missing coverage. Please review.

Project coverage is 47.69%. Comparing base (8dc70e9) to head (cc809f9).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
cmd/lint-panics/gopls/gopls.go 54.21% 31 Missing and 7 partials ⚠️
cmd/lint-panics/gopls/dummy_client.go 21.95% 31 Missing and 1 partial ⚠️
cmd/lint-panics/analyzer/analyzer.go 78.94% 18 Missing and 10 partials ⚠️
cmd/lint-panics/analyzer/config.go 60.00% 5 Missing and 5 partials ⚠️
cmd/lint-panics/gopls/stream.go 40.00% 6 Missing ⚠️
cmd/lint-panics/utils/utils.go 83.33% 2 Missing and 1 partial ⚠️
protocol/messenger.go 0.00% 2 Missing ⚠️
metrics/metrics.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5969      +/-   ##
===========================================
+ Coverage    47.64%   47.69%   +0.04%     
===========================================
  Files          843      849       +6     
  Lines       138244   138576     +332     
===========================================
+ Hits         65873    66089     +216     
- Misses       64608    64696      +88     
- Partials      7763     7791      +28     
Flag Coverage Δ
functional 10.65% <42.85%> (+<0.01%) ⬆️
unit 47.01% <62.15%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
healthmanager/blockchain_health_manager.go 94.82% <100.00%> (+1.78%) ⬆️
protocol/encryption/publisher/publisher.go 72.88% <100.00%> (+0.46%) ⬆️
protocol/messenger_store_node_request_manager.go 40.95% <100.00%> (+0.21%) ⬆️
rpc/client.go 65.74% <100.00%> (+0.15%) ⬆️
services/wallet/api.go 37.60% <100.00%> (+0.30%) ⬆️
services/wallet/balance/ttl_cache.go 95.55% <100.00%> (+0.31%) ⬆️
services/wallet/common/mock/feed_subscription.go 90.47% <100.00%> (+0.47%) ⬆️
waku/v1/peer.go 58.00% <ø> (-0.42%) ⬇️
wakuv2/waku.go 70.21% <ø> (+0.24%) ⬆️
metrics/metrics.go 0.00% <0.00%> (ø)
... and 7 more

... and 31 files with indirect coverage changes

@igor-sirotin igor-sirotin force-pushed the feat/LogOnPanic-linter branch 11 times, most recently from b0c689a to 2362d1d Compare October 22, 2024 21:37
@igor-sirotin igor-sirotin marked this pull request as ready for review October 22, 2024 21:40
@igor-sirotin igor-sirotin requested review from ilmotta, qfrank, osmaczko and a team October 22, 2024 21:41
@igor-sirotin igor-sirotin self-assigned this Oct 22, 2024
Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super cool @igor-sirotin 💫 I did a few quick checks, works pretty well!

I use gopls and it works flawlessly for me, but when I removed calls to defer LogOnPanic() I didn't see errors from gopls in my editor, only via make lint it works. Is the in-editor experience with gopls working for you?

@@ -0,0 +1,153 @@
package gopls
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igor-sirotin, I'm under the impression the gopls/ directory is mostly boilerplate and that the code is unrelated to the panic linter. Wouldn't it be better to move this whole package out of the lint-panics/ directory? That way we facilitate the creation of new linters in the future by keeping the language server part decoupled a bit more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it is quite some boilerplate, I was surprised that I had to write this. I'm still unsure that I did it right here, but didn't find any better way.

We can extract it, but same as for parseFile, I'd rather do that when it's needed, e.g. when we decided to write a new linter or smth.

}
}

func (p *Analyzer) parseFile(path string, pass *analysis.Pass) (*ast.File, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be somewhere else to reduce friction to implement a new linter in the future? Seems reusable, not specific of the panic linter.

Well, I guess it might be better to wait for another custom linter to decide on what/how to best split and reuse code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, better to wait for the need for it 👍
Also, this one is quite small, so I'm not sure if we need to extract it.

Copy link
Contributor

@qfrank qfrank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job although there is an issue with the test. 🚀

cmd/lint-panics/gopls/client.go Outdated Show resolved Hide resolved
cmd/lint-panics/utils/utils.go Outdated Show resolved Hide resolved
cmd/lint-panics/gopls/gopls.go Outdated Show resolved Hide resolved
@igor-sirotin
Copy link
Collaborator Author

... when I removed calls to defer LogOnPanic() I didn't see errors from gopls in my editor, only via make lint it works.
Is the in-editor experience with gopls working for you?

@ilmotta This one is not integrated into IDE at all, that would require some more work.
Good news is that I implemented it with Analyzer interface, so it can be integrated into golangci-lint or any other linter runners, which I guess includes IDEs.

But again, this would require more work and I'm not sure if we need it right now.
We can consider to do it if we encounter many-many such errors on PR level which would slow down development. But I doubt that this particular check will lead to such problems. Maybe some future linters will, but that's in the future 😄

@igor-sirotin igor-sirotin force-pushed the feat/LogOnPanic-linter branch from 9de1a4b to 7735ef9 Compare October 23, 2024 11:36
services/wallet/api.go Outdated Show resolved Hide resolved
@@ -4,6 +4,7 @@ import (
"context"
"sync"

gocommon "github.com/status-im/status-go/common"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gocommon "github.com/status-im/status-go/common"
status_common "github.com/status-im/status-go/common"

Copy link
Contributor

@osmaczko osmaczko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice engineering!

I am concerned that a 5-minute context might be too short for fresh installs. It's probably faster for you because your gopls already has a cache and index built for status-go. Could you check how long it takes for a fresh repo?

cmd/lint-panics/analyzer/analyzer.go Outdated Show resolved Hide resolved
cmd/lint-panics/analyzer/analyzer.go Outdated Show resolved Hide resolved
cmd/lint-panics/analyzer/analyzer.go Outdated Show resolved Hide resolved
cmd/lint-panics/analyzer/analyzer.go Outdated Show resolved Hide resolved
cmd/lint-panics/analyzer/analyzer.go Show resolved Hide resolved
Makefile Show resolved Hide resolved
cmd/lint-panics/gopls/stream.go Outdated Show resolved Hide resolved
@igor-sirotin
Copy link
Collaborator Author

I am concerned that a 5-minute context might be too short for fresh installs. It's probably faster for you because your gopls already has a cache and index built for status-go. Could you check how long it takes for a fresh repo?

@osmaczko I don't think it will be a problem. In fact, I think 5 minutes is way too much.
We run fresh gopls server, so I'd expect it to have 0 cache.

But let me try 👌

@igor-sirotin igor-sirotin merged commit 6793919 into develop Oct 23, 2024
17 of 18 checks passed
@igor-sirotin igor-sirotin deleted the feat/LogOnPanic-linter branch October 23, 2024 20:33
shashankshampi added a commit that referenced this pull request Oct 30, 2024
fix_: functional tests (#5979)

* fix_: generate on test-functional

* chore(test)_: fix functional test assertion

---------

Co-authored-by: Siddarth Kumar <[email protected]>

feat(accounts)_: cherry-pick Persist acceptance of Terms of Use & Privacy policy (#5766) (#5977)

* feat(accounts)_: Persist acceptance of Terms of Use & Privacy policy (#5766)

The original GH issue status-im/status-mobile#21113
came from a request from the Legal team. We must show to Status v1 users the new
terms (Terms of Use & Privacy Policy) right after they upgrade to Status v2
from the stores.

The solution we use is to create a flag in the accounts table, named
hasAcceptedTerms. The flag will be set to true on the first account ever
created in v2 and we provide a native call in mobile/status.go#AcceptTerms,
which allows the client to persist the user's choice in case they are upgrading
(from v1 -> v2, or from a v2 older than this PR).

This solution is not the best because we should store the setting in a separate
table, not in the accounts table.

Related Mobile PR status-im/status-mobile#21124

* fix(test)_: Compare addresses using uppercased strings

---------

Co-authored-by: Icaro Motta <[email protected]>

test_: restore account (#5960)

feat_: `LogOnPanic` linter (#5969)

* feat_: LogOnPanic linter

* fix_: add missing defer LogOnPanic

* chore_: make vendor

* fix_: tests, address pr comments

* fix_: address pr comments

fix(ci)_: remove workspace and tmp dir

This ensures we do not encounter weird errors like:
```
+ ln -s /home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907 /home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907@tmp/go/src/github.com/status-im/status-go
ln: failed to create symbolic link '/home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907@tmp/go/src/github.com/status-im/status-go': File exists
script returned exit code 1
```

Signed-off-by: Jakub Sokołowski <[email protected]>

chore_: enable windows and macos CI build (#5840)

- Added support for Windows and macOS in CI pipelines
- Added missing dependencies for Windows and x86-64-darwin
- Resolved macOS SDK version compatibility for darwin-x86_64

The `mkShell` override was necessary to ensure compatibility with the newer
macOS SDK (version 11.0) for x86_64. The default SDK (10.12) was causing build failures
because of the missing libs and frameworks. OverrideSDK creates a mapping from
the default SDK in all package categories to the requested SDK (11.0).

fix(contacts)_: fix trust status not being saved to cache when changed (#5965)

Fixes status-im/status-desktop#16392

cleanup

added logger and cleanup

review comments changes
shashankshampi added a commit that referenced this pull request Oct 30, 2024
author shashankshampi <[email protected]> 1729780155 +0530
committer shashankshampi <[email protected]> 1730274350 +0530

test: Code Migration from status-cli-tests
fix_: functional tests (#5979)

* fix_: generate on test-functional

* chore(test)_: fix functional test assertion

---------

Co-authored-by: Siddarth Kumar <[email protected]>

feat(accounts)_: cherry-pick Persist acceptance of Terms of Use & Privacy policy (#5766) (#5977)

* feat(accounts)_: Persist acceptance of Terms of Use & Privacy policy (#5766)

The original GH issue status-im/status-mobile#21113
came from a request from the Legal team. We must show to Status v1 users the new
terms (Terms of Use & Privacy Policy) right after they upgrade to Status v2
from the stores.

The solution we use is to create a flag in the accounts table, named
hasAcceptedTerms. The flag will be set to true on the first account ever
created in v2 and we provide a native call in mobile/status.go#AcceptTerms,
which allows the client to persist the user's choice in case they are upgrading
(from v1 -> v2, or from a v2 older than this PR).

This solution is not the best because we should store the setting in a separate
table, not in the accounts table.

Related Mobile PR status-im/status-mobile#21124

* fix(test)_: Compare addresses using uppercased strings

---------

Co-authored-by: Icaro Motta <[email protected]>

test_: restore account (#5960)

feat_: `LogOnPanic` linter (#5969)

* feat_: LogOnPanic linter

* fix_: add missing defer LogOnPanic

* chore_: make vendor

* fix_: tests, address pr comments

* fix_: address pr comments

fix(ci)_: remove workspace and tmp dir

This ensures we do not encounter weird errors like:
```
+ ln -s /home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907 /home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907@tmp/go/src/github.com/status-im/status-go
ln: failed to create symbolic link '/home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907@tmp/go/src/github.com/status-im/status-go': File exists
script returned exit code 1
```

Signed-off-by: Jakub Sokołowski <[email protected]>

chore_: enable windows and macos CI build (#5840)

- Added support for Windows and macOS in CI pipelines
- Added missing dependencies for Windows and x86-64-darwin
- Resolved macOS SDK version compatibility for darwin-x86_64

The `mkShell` override was necessary to ensure compatibility with the newer
macOS SDK (version 11.0) for x86_64. The default SDK (10.12) was causing build failures
because of the missing libs and frameworks. OverrideSDK creates a mapping from
the default SDK in all package categories to the requested SDK (11.0).

fix(contacts)_: fix trust status not being saved to cache when changed (#5965)

Fixes status-im/status-desktop#16392

cleanup

added logger and cleanup

review comments changes

fix_: functional tests (#5979)

* fix_: generate on test-functional

* chore(test)_: fix functional test assertion

---------

Co-authored-by: Siddarth Kumar <[email protected]>

feat(accounts)_: cherry-pick Persist acceptance of Terms of Use & Privacy policy (#5766) (#5977)

* feat(accounts)_: Persist acceptance of Terms of Use & Privacy policy (#5766)

The original GH issue status-im/status-mobile#21113
came from a request from the Legal team. We must show to Status v1 users the new
terms (Terms of Use & Privacy Policy) right after they upgrade to Status v2
from the stores.

The solution we use is to create a flag in the accounts table, named
hasAcceptedTerms. The flag will be set to true on the first account ever
created in v2 and we provide a native call in mobile/status.go#AcceptTerms,
which allows the client to persist the user's choice in case they are upgrading
(from v1 -> v2, or from a v2 older than this PR).

This solution is not the best because we should store the setting in a separate
table, not in the accounts table.

Related Mobile PR status-im/status-mobile#21124

* fix(test)_: Compare addresses using uppercased strings

---------

Co-authored-by: Icaro Motta <[email protected]>

test_: restore account (#5960)

feat_: `LogOnPanic` linter (#5969)

* feat_: LogOnPanic linter

* fix_: add missing defer LogOnPanic

* chore_: make vendor

* fix_: tests, address pr comments

* fix_: address pr comments

chore_: enable windows and macos CI build (#5840)

- Added support for Windows and macOS in CI pipelines
- Added missing dependencies for Windows and x86-64-darwin
- Resolved macOS SDK version compatibility for darwin-x86_64

The `mkShell` override was necessary to ensure compatibility with the newer
macOS SDK (version 11.0) for x86_64. The default SDK (10.12) was causing build failures
because of the missing libs and frameworks. OverrideSDK creates a mapping from
the default SDK in all package categories to the requested SDK (11.0).

fix(contacts)_: fix trust status not being saved to cache when changed (#5965)

Fixes status-im/status-desktop#16392

test_: remove port bind

chore(wallet)_: move route execution code to separate module

chore_: replace geth logger with zap logger (#5962)

closes: #6002

feat(telemetry)_: add metrics for message reliability (#5899)

* feat(telemetry)_: track message reliability

Add metrics for dial errors, missed messages,
missed relevant messages, and confirmed delivery.

* fix_: handle error from json marshal

chore_: use zap logger as request logger

iterates: status-im/status-desktop#16536

test_: unique project per run

test_: use docker compose v2, more concrete project name

fix(codecov)_: ignore folders without tests

Otherwise Codecov reports incorrect numbers when making changes.
https://docs.codecov.com/docs/ignoring-paths

Signed-off-by: Jakub Sokołowski <[email protected]>

test_: verify schema of signals during init; fix schema verification warnings (#5947)

fix_: update defaultGorushURL (#6011)

fix(tests)_: use non-standard port to avoid conflicts

We have observed `nimbus-eth2` build failures reporting this port:
```json
{
  "lvl": "NTC",
  "ts": "2024-10-28 13:51:32.308+00:00",
  "msg": "REST HTTP server could not be started",
  "topics": "beacnde",
  "address": "127.0.0.1:5432",
  "reason": "(98) Address already in use"
}
```
https://ci.status.im/job/nimbus-eth2/job/platforms/job/linux/job/x86_64/job/main/job/PR-6683/3/

Signed-off-by: Jakub Sokołowski <[email protected]>

fix_: create request logger ad-hoc in tests

Fixes `TestCall` failing when run concurrently.

chore_: configure codecov (#6005)

* chore_: configure codecov

* fix_: after_n_builds
shashankshampi added a commit that referenced this pull request Oct 30, 2024
author shashankshampi <[email protected]> 1729780155 +0530
committer shashankshampi <[email protected]> 1730274350 +0530

test: Code Migration from status-cli-tests
fix_: functional tests (#5979)

* fix_: generate on test-functional

* chore(test)_: fix functional test assertion

---------

Co-authored-by: Siddarth Kumar <[email protected]>

feat(accounts)_: cherry-pick Persist acceptance of Terms of Use & Privacy policy (#5766) (#5977)

* feat(accounts)_: Persist acceptance of Terms of Use & Privacy policy (#5766)

The original GH issue status-im/status-mobile#21113
came from a request from the Legal team. We must show to Status v1 users the new
terms (Terms of Use & Privacy Policy) right after they upgrade to Status v2
from the stores.

The solution we use is to create a flag in the accounts table, named
hasAcceptedTerms. The flag will be set to true on the first account ever
created in v2 and we provide a native call in mobile/status.go#AcceptTerms,
which allows the client to persist the user's choice in case they are upgrading
(from v1 -> v2, or from a v2 older than this PR).

This solution is not the best because we should store the setting in a separate
table, not in the accounts table.

Related Mobile PR status-im/status-mobile#21124

* fix(test)_: Compare addresses using uppercased strings

---------

Co-authored-by: Icaro Motta <[email protected]>

test_: restore account (#5960)

feat_: `LogOnPanic` linter (#5969)

* feat_: LogOnPanic linter

* fix_: add missing defer LogOnPanic

* chore_: make vendor

* fix_: tests, address pr comments

* fix_: address pr comments

fix(ci)_: remove workspace and tmp dir

This ensures we do not encounter weird errors like:
```
+ ln -s /home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907 /home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907@tmp/go/src/github.com/status-im/status-go
ln: failed to create symbolic link '/home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907@tmp/go/src/github.com/status-im/status-go': File exists
script returned exit code 1
```

Signed-off-by: Jakub Sokołowski <[email protected]>

chore_: enable windows and macos CI build (#5840)

- Added support for Windows and macOS in CI pipelines
- Added missing dependencies for Windows and x86-64-darwin
- Resolved macOS SDK version compatibility for darwin-x86_64

The `mkShell` override was necessary to ensure compatibility with the newer
macOS SDK (version 11.0) for x86_64. The default SDK (10.12) was causing build failures
because of the missing libs and frameworks. OverrideSDK creates a mapping from
the default SDK in all package categories to the requested SDK (11.0).

fix(contacts)_: fix trust status not being saved to cache when changed (#5965)

Fixes status-im/status-desktop#16392

cleanup

added logger and cleanup

review comments changes

fix_: functional tests (#5979)

* fix_: generate on test-functional

* chore(test)_: fix functional test assertion

---------

Co-authored-by: Siddarth Kumar <[email protected]>

feat(accounts)_: cherry-pick Persist acceptance of Terms of Use & Privacy policy (#5766) (#5977)

* feat(accounts)_: Persist acceptance of Terms of Use & Privacy policy (#5766)

The original GH issue status-im/status-mobile#21113
came from a request from the Legal team. We must show to Status v1 users the new
terms (Terms of Use & Privacy Policy) right after they upgrade to Status v2
from the stores.

The solution we use is to create a flag in the accounts table, named
hasAcceptedTerms. The flag will be set to true on the first account ever
created in v2 and we provide a native call in mobile/status.go#AcceptTerms,
which allows the client to persist the user's choice in case they are upgrading
(from v1 -> v2, or from a v2 older than this PR).

This solution is not the best because we should store the setting in a separate
table, not in the accounts table.

Related Mobile PR status-im/status-mobile#21124

* fix(test)_: Compare addresses using uppercased strings

---------

Co-authored-by: Icaro Motta <[email protected]>

test_: restore account (#5960)

feat_: `LogOnPanic` linter (#5969)

* feat_: LogOnPanic linter

* fix_: add missing defer LogOnPanic

* chore_: make vendor

* fix_: tests, address pr comments

* fix_: address pr comments

chore_: enable windows and macos CI build (#5840)

- Added support for Windows and macOS in CI pipelines
- Added missing dependencies for Windows and x86-64-darwin
- Resolved macOS SDK version compatibility for darwin-x86_64

The `mkShell` override was necessary to ensure compatibility with the newer
macOS SDK (version 11.0) for x86_64. The default SDK (10.12) was causing build failures
because of the missing libs and frameworks. OverrideSDK creates a mapping from
the default SDK in all package categories to the requested SDK (11.0).

fix(contacts)_: fix trust status not being saved to cache when changed (#5965)

Fixes status-im/status-desktop#16392

test_: remove port bind

chore(wallet)_: move route execution code to separate module

chore_: replace geth logger with zap logger (#5962)

closes: #6002

feat(telemetry)_: add metrics for message reliability (#5899)

* feat(telemetry)_: track message reliability

Add metrics for dial errors, missed messages,
missed relevant messages, and confirmed delivery.

* fix_: handle error from json marshal

chore_: use zap logger as request logger

iterates: status-im/status-desktop#16536

test_: unique project per run

test_: use docker compose v2, more concrete project name

fix(codecov)_: ignore folders without tests

Otherwise Codecov reports incorrect numbers when making changes.
https://docs.codecov.com/docs/ignoring-paths

Signed-off-by: Jakub Sokołowski <[email protected]>

test_: verify schema of signals during init; fix schema verification warnings (#5947)

fix_: update defaultGorushURL (#6011)

fix(tests)_: use non-standard port to avoid conflicts

We have observed `nimbus-eth2` build failures reporting this port:
```json
{
  "lvl": "NTC",
  "ts": "2024-10-28 13:51:32.308+00:00",
  "msg": "REST HTTP server could not be started",
  "topics": "beacnde",
  "address": "127.0.0.1:5432",
  "reason": "(98) Address already in use"
}
```
https://ci.status.im/job/nimbus-eth2/job/platforms/job/linux/job/x86_64/job/main/job/PR-6683/3/

Signed-off-by: Jakub Sokołowski <[email protected]>

fix_: create request logger ad-hoc in tests

Fixes `TestCall` failing when run concurrently.

chore_: configure codecov (#6005)

* chore_: configure codecov

* fix_: after_n_builds
fbarbu15 pushed a commit that referenced this pull request Nov 9, 2024
author shashankshampi <[email protected]> 1729780155 +0530
committer shashankshampi <[email protected]> 1730274350 +0530

test: Code Migration from status-cli-tests
fix_: functional tests (#5979)

* fix_: generate on test-functional

* chore(test)_: fix functional test assertion

---------

Co-authored-by: Siddarth Kumar <[email protected]>

feat(accounts)_: cherry-pick Persist acceptance of Terms of Use & Privacy policy (#5766) (#5977)

* feat(accounts)_: Persist acceptance of Terms of Use & Privacy policy (#5766)

The original GH issue status-im/status-mobile#21113
came from a request from the Legal team. We must show to Status v1 users the new
terms (Terms of Use & Privacy Policy) right after they upgrade to Status v2
from the stores.

The solution we use is to create a flag in the accounts table, named
hasAcceptedTerms. The flag will be set to true on the first account ever
created in v2 and we provide a native call in mobile/status.go#AcceptTerms,
which allows the client to persist the user's choice in case they are upgrading
(from v1 -> v2, or from a v2 older than this PR).

This solution is not the best because we should store the setting in a separate
table, not in the accounts table.

Related Mobile PR status-im/status-mobile#21124

* fix(test)_: Compare addresses using uppercased strings

---------

Co-authored-by: Icaro Motta <[email protected]>

test_: restore account (#5960)

feat_: `LogOnPanic` linter (#5969)

* feat_: LogOnPanic linter

* fix_: add missing defer LogOnPanic

* chore_: make vendor

* fix_: tests, address pr comments

* fix_: address pr comments

fix(ci)_: remove workspace and tmp dir

This ensures we do not encounter weird errors like:
```
+ ln -s /home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907 /home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907@tmp/go/src/github.com/status-im/status-go
ln: failed to create symbolic link '/home/jenkins/workspace/go_prs_linux_x86_64_main_PR-5907@tmp/go/src/github.com/status-im/status-go': File exists
script returned exit code 1
```

Signed-off-by: Jakub Sokołowski <[email protected]>

chore_: enable windows and macos CI build (#5840)

- Added support for Windows and macOS in CI pipelines
- Added missing dependencies for Windows and x86-64-darwin
- Resolved macOS SDK version compatibility for darwin-x86_64

The `mkShell` override was necessary to ensure compatibility with the newer
macOS SDK (version 11.0) for x86_64. The default SDK (10.12) was causing build failures
because of the missing libs and frameworks. OverrideSDK creates a mapping from
the default SDK in all package categories to the requested SDK (11.0).

fix(contacts)_: fix trust status not being saved to cache when changed (#5965)

Fixes status-im/status-desktop#16392

cleanup

added logger and cleanup

review comments changes

fix_: functional tests (#5979)

* fix_: generate on test-functional

* chore(test)_: fix functional test assertion

---------

Co-authored-by: Siddarth Kumar <[email protected]>

feat(accounts)_: cherry-pick Persist acceptance of Terms of Use & Privacy policy (#5766) (#5977)

* feat(accounts)_: Persist acceptance of Terms of Use & Privacy policy (#5766)

The original GH issue status-im/status-mobile#21113
came from a request from the Legal team. We must show to Status v1 users the new
terms (Terms of Use & Privacy Policy) right after they upgrade to Status v2
from the stores.

The solution we use is to create a flag in the accounts table, named
hasAcceptedTerms. The flag will be set to true on the first account ever
created in v2 and we provide a native call in mobile/status.go#AcceptTerms,
which allows the client to persist the user's choice in case they are upgrading
(from v1 -> v2, or from a v2 older than this PR).

This solution is not the best because we should store the setting in a separate
table, not in the accounts table.

Related Mobile PR status-im/status-mobile#21124

* fix(test)_: Compare addresses using uppercased strings

---------

Co-authored-by: Icaro Motta <[email protected]>

test_: restore account (#5960)

feat_: `LogOnPanic` linter (#5969)

* feat_: LogOnPanic linter

* fix_: add missing defer LogOnPanic

* chore_: make vendor

* fix_: tests, address pr comments

* fix_: address pr comments

chore_: enable windows and macos CI build (#5840)

- Added support for Windows and macOS in CI pipelines
- Added missing dependencies for Windows and x86-64-darwin
- Resolved macOS SDK version compatibility for darwin-x86_64

The `mkShell` override was necessary to ensure compatibility with the newer
macOS SDK (version 11.0) for x86_64. The default SDK (10.12) was causing build failures
because of the missing libs and frameworks. OverrideSDK creates a mapping from
the default SDK in all package categories to the requested SDK (11.0).

fix(contacts)_: fix trust status not being saved to cache when changed (#5965)

Fixes status-im/status-desktop#16392

test_: remove port bind

chore(wallet)_: move route execution code to separate module

chore_: replace geth logger with zap logger (#5962)

closes: #6002

feat(telemetry)_: add metrics for message reliability (#5899)

* feat(telemetry)_: track message reliability

Add metrics for dial errors, missed messages,
missed relevant messages, and confirmed delivery.

* fix_: handle error from json marshal

chore_: use zap logger as request logger

iterates: status-im/status-desktop#16536

test_: unique project per run

test_: use docker compose v2, more concrete project name

fix(codecov)_: ignore folders without tests

Otherwise Codecov reports incorrect numbers when making changes.
https://docs.codecov.com/docs/ignoring-paths

Signed-off-by: Jakub Sokołowski <[email protected]>

test_: verify schema of signals during init; fix schema verification warnings (#5947)

fix_: update defaultGorushURL (#6011)

fix(tests)_: use non-standard port to avoid conflicts

We have observed `nimbus-eth2` build failures reporting this port:
```json
{
  "lvl": "NTC",
  "ts": "2024-10-28 13:51:32.308+00:00",
  "msg": "REST HTTP server could not be started",
  "topics": "beacnde",
  "address": "127.0.0.1:5432",
  "reason": "(98) Address already in use"
}
```
https://ci.status.im/job/nimbus-eth2/job/platforms/job/linux/job/x86_64/job/main/job/PR-6683/3/

Signed-off-by: Jakub Sokołowski <[email protected]>

fix_: create request logger ad-hoc in tests

Fixes `TestCall` failing when run concurrently.

chore_: configure codecov (#6005)

* chore_: configure codecov

* fix_: after_n_builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the commit check for logOnPanic
5 participants